10.07.2012, 11:49
pawn Код:
stock Login(playerid,key[])
{
new Spielerdatei[64];
new name[MAX_PLAYER_NAME];
new str;
str = dini_get(data, "password");
GetPlayerName(playerid,name,sizeof(name));
format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
if(!strcmp(key,str,false))
{
LoadAccount(playerid);
SendClientMessage(playerid,BLUE,"Info: logged in!");
PlayerPlaySound(playerid,1150,0,0,0);
return 1;
}
else
{
SendClientMessage(playerid,RED,"Error: wrong password");
PlayerPlaySound(playerid,5201,0,0,0);
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Info: your account was foundet.","Login","Cancel");
return 1;
}
}