SA-MP Forums Archive
/changepass yini help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /changepass yini help (/showthread.php?tid=608946)



/changepass yini help - N0FeaR - 06.06.2016

Trying make a cmd to change password but the cmd doesn't change the password, maybe you guys can help me, thanks in advance!


PHP код:
CMD:changepass(playeridparams[])
{
    new 
string[256], hashpass[129], PlayerName2[MAX_PLAYER_NAME];
    if(
sscanf(params"s[256]"params))return SendSyntaxMessage(playerid" Usage: /changepass [password]");
    
format(string256"/Users/%s.ini"PlayerName2);
    new 
INI:file INI_Open(string);
    
INI_SetTag(file,"data");
    
INI_WriteInt(file,"Password",udb_hash(params));
    
INI_Close(file);
    
SendServerMessage(playerid"You change password to %s"params);
    return 
1;




Re: /changepass yini help - F1N4L - 06.06.2016

Change your pass or of the other player?
Код:
GetPlayerName(playerid, PlayerName2, sizeof PlayerName2);



Re: /changepass yini help - N0FeaR - 06.06.2016

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Change your pass or of the other player?
Код:
GetPlayerName(playerid, PlayerName2, sizeof PlayerName2);
I just realize that was missing thanks mate, rep!


Re: /changepass yini help - Stinged - 06.06.2016

Why do you use sscanf if you only want to use a string?
256 cells are gone to waste.

Just use params since it's already a string.
Use the function isnull to check if the player didn't enter anything.