Koristite /changepass [novi apssword]


Započeo [IF] mariomako, Jul 26, 2010, 13:39:42 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

CMD:changepassword(playerid, params[])
{
    if(!UserExists(playerid)) return SendClientMessage(playerid, COLOR_RED,"To ime nije registrirano napisi /register [lozinka].");
    if(!params[0]) return SendClientMessage(playerid, COLOR_RED, "Tocnije: /changepassword [nova lozinka]");
   	if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid, COLOR_RED,"Nisi ulogiran!");

   	new FilePath[128];
	format(FilePath, sizeof(FilePath), "Korisnici/%s.ini", PlayerName(playerid));

   	new password = num_hash(params);
    PlayerInfo[playerid][Password] = password;

	dini_IntSet(FilePath,"Password",PlayerInfo[playerid][Password]);
	if (IgracInfo[playerid][Jezik] == 1)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Èíôîðìàöè¼à:");
	new string[256]; format(string, sizeof(string), "Ã"ñïåøíî ¼à ïðîìåíèâòå âàøàòà ëîçèíêà, íîâàòà ëîçèíêà Ã¥: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
	}
	if (IgracInfo[playerid][Jezik] == 2)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Informacije:");
	new string[256]; format(string, sizeof(string), "Uspesno ste promenili password, novi password je: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
 	}
	if (IgracInfo[playerid][Jezik] == 3)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Information:");
	new string[256]; format(string, sizeof(string), "Successful change your password, your new password is: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
	}
	return PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}


Ovo je moja komanda za mjenjanje password ali kad upisem samo /changepassword pobrisemi password a kad upisem /changepassword [neki password] tada radi sve normalno a sad me zanima kako da napravim kad upisem smo /changepassword da mi izage da sam krivo koristio komandu kako sto ima na neki servere korsitite /ban [id] [razlog]

S obzirom da koristis ZCMD, stavi
if (isnull(params))


RESPECT 4 EVER: John, GLC,bAndzi, Nikola, Sop, Zoki, Bruno_Venuti, Mele, Luka P,ExtremePower,Wang(neki kineski frajer)

NAJBOLJI CITATI:
Citat: [GF]Alive poslato Jun 24, 2010, 18:20:19 POSLE PODNE
Paizte ljud mozda je KayLoger! ! !
MOJI RADOVI:
[FS]Trofeji


Evo ti gotova komanda:
CMD:changepassword(playerid, params[])
{
    if(!UserExists(playerid)) return SendClientMessage(playerid, COLOR_RED,"To ime nije registrirano napisi /register [lozinka].");
    if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Tocnije: /changepassword [nova lozinka]");
   	if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid, COLOR_RED,"Nisi ulogiran!");

   	new FilePath[128];
	format(FilePath, sizeof(FilePath), "Korisnici/%s.ini", PlayerName(playerid));

   	new password = num_hash(params);
    PlayerInfo[playerid][Password] = password;

	dini_IntSet(FilePath,"Password",PlayerInfo[playerid][Password]);
	if (IgracInfo[playerid][Jezik] == 1)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Èíôîðìàöè¼à:");
	new string[256]; format(string, sizeof(string), "Ã"ñïåøíî ¼à ïðîìåíèâòå âàøàòà ëîçèíêà, íîâàòà ëîçèíêà Ã¥: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
	}
	if (IgracInfo[playerid][Jezik] == 2)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Informacije:");
	new string[256]; format(string, sizeof(string), "Uspesno ste promenili password, novi password je: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
 	}
	if (IgracInfo[playerid][Jezik] == 3)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Information:");
	new string[256]; format(string, sizeof(string), "Successful change your password, your new password is: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
	}
	return PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}


RESPECT 4 EVER: John, GLC,bAndzi, Nikola, Sop, Zoki, Bruno_Venuti, Mele, Luka P,ExtremePower,Wang(neki kineski frajer)

NAJBOLJI CITATI:
Citat: [GF]Alive poslato Jun 24, 2010, 18:20:19 POSLE PODNE
Paizte ljud mozda je KayLoger! ! !
MOJI RADOVI:
[FS]Trofeji

Ili samo makni ovaj ! ispred
params[0]

Last nick: Paradox

problem resen

a sada sam malo editao komandu pa zasto mi nalazi ove errore

E:\SAMP Server\PitBull Freeroam\gamemodes\pitbull.pwn(774) : error 029: invalid expression, assumed zero


CMD:changepassword(playerid, params[])
{
    if(!UserExists(playerid))
	else
	{
		if (IgracInfo[playerid][Jezik] == 1)
		{
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [nova lozinka]");
		}
		if (IgracInfo[playerid][Jezik] == 2)
		{
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [novi password]");
		}
		if (IgracInfo[playerid][Jezik] == 3)
		{
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [new password]");
		}
	}
    if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Tocnije: /changepassword [nova lozinka]");
   	if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid, COLOR_RED,"Nisi ulogiran!");

   	new FilePath[128];
	format(FilePath, sizeof(FilePath), "Korisnici/%s.ini", PlayerName(playerid));

   	new password = num_hash(params);
    PlayerInfo[playerid][Password] = password;

	dini_IntSet(FilePath,"Password",PlayerInfo[playerid][Password]);
	if (IgracInfo[playerid][Jezik] == 1)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Èíôîðìàöè¼à:");
	new string[256]; format(string, sizeof(string), "Ã"ñïåøíî ¼à ïðîìåíèâòå âàøàòà ëîçèíêà, íîâàòà ëîçèíêà Ã¥: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
	}
	if (IgracInfo[playerid][Jezik] == 2)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Informacije:");
	new string[256]; format(string, sizeof(string), "Uspesno ste promenili password, novi password je: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
 	}
	if (IgracInfo[playerid][Jezik] == 3)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Information:");
	new string[256]; format(string, sizeof(string), "Successful change your password, your new password is: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
	}
	return PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}

A da nam das mozda liniju?

I zasto pobogu koristis veličinu stringa 256 kad samp ne dopušta da ispišeš string veći od 128(i to je previse jer ni tolko slova nemas).


RESPECT 4 EVER: John, GLC,bAndzi, Nikola, Sop, Zoki, Bruno_Venuti, Mele, Luka P,ExtremePower,Wang(neki kineski frajer)

NAJBOLJI CITATI:
Citat: [GF]Alive poslato Jun 24, 2010, 18:20:19 POSLE PODNE
Paizte ljud mozda je KayLoger! ! !
MOJI RADOVI:
[FS]Trofeji

evo sada cela komanda ne nalazi errore

ali kad idem /changepass od svi poruke mi izage po jedna i plus mi obrise password

CMD:changepassword(playerid, params[])
{
	if(UserExists(playerid)) {
	if(IgracInfo[playerid][Jezik] == 1)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Îâàà êîðèñíè÷êî èìå íå å ðåãèñòèðàíî.");
	}
	if (IgracInfo[playerid][Jezik] == 2)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ovo korisnicko ime nije registirano.");
 	}
	if (IgracInfo[playerid][Jezik] == 3)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "This username is not registred.");
	}
	}
	if(isnull(params)) {
	if(IgracInfo[playerid][Jezik] == 1)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [íîâà ëîçèíêà]");
	}
	if (IgracInfo[playerid][Jezik] == 2)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [novi password]");
 	}
	if (IgracInfo[playerid][Jezik] == 3)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [new password]");
	}
	}
   	if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid, COLOR_RED,"Nisi ulogiran!");

   	new FilePath[128];
	format(FilePath, sizeof(FilePath), "Korisnici/%s.ini", PlayerName(playerid));

   	new password = num_hash(params);
    PlayerInfo[playerid][Password] = password;

	dini_IntSet(FilePath,"Password",PlayerInfo[playerid][Password]);
	if (IgracInfo[playerid][Jezik] == 1)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Èíôîðìàöè¼à:");
	new string[256]; format(string, sizeof(string), "Ã"ñïåøíî ¼à ïðîìåíèâòå âàøàòà ëîçèíêà, íîâàòà ëîçèíêà Ã¥: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
	}
	if (IgracInfo[playerid][Jezik] == 2)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Informacije:");
	new string[256]; format(string, sizeof(string), "Uspesno ste promenili password, novi password je: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
 	}
	if (IgracInfo[playerid][Jezik] == 3)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Information:");
	new string[256]; format(string, sizeof(string), "Successful change your password, your new password is: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
	}
	return PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}