14.09.2011, 15:52
PHP код:
forward OnPlayerLogin2(playerid,password[]);
public OnPlayerLogin2(playerid,password[])
{
new Password[64];
INI_ParseFile(UserFile(playerid), "ParsePlayerPass", false, true,playerid);
GetGVarString("pPass", Password, 64,playerid);
if(!strcmp(password,Password,true))
{
SetPVarInt(playerid, "Logged", 0);
SetPVarInt(playerid, "Registered", 0);
SetPVarInt(playerid, "BadPass", 0);
SendClientMessage(playerid, COLOR_GREEN, ".дъзбшъ бдцмзд мщшъ, лтъ аъд шщай мбзеш гоеъ емдъзйм мщзч");
PlaySound(playerid, 1057);
ShowPlayerDialog(playerid,23,DIALOG_STYLE_MSGBOX,"{00FFFF}"Community_Name" // змеп дъзбшеъ","!дъзбшъ бдцмзд","айщеш","");
LoginPlayer(playerid);
}
else
{
SetPVarInt(playerid, "BadPass",GetPVarInt(playerid, "BadPass") - 1);
format(stringEx, sizeof(stringEx),".сйсод щвейд реъше мк тег %d рйсйереъ",GetPVarInt(playerid, "BadPass"));
SendClientMessage(playerid,COLOR_RED,stringEx);
format(stringEx, sizeof(stringEx),"{FF0000}.дсйсод щдчщъ щвейд. рсд щеб",GetName(playerid));
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"{A9A9A9}"Community_Name" // змеп дъзбшеъ",stringEx,"дъзбш","ца одщшъ");
if(GetPVarInt(playerid, "BadPass") == 0) SetKick(playerid,-1,"Invalid Password 3/3");
}
return 1;
}
forward ParsePlayerPass(playerid,name[],value[]);
public ParsePlayerPass(playerid,name[],value[])
{
if(!strcmp(name,"Password")) SetGVarString("pPass", value,playerid);
}