PHP код:
forward LoginCallback(playerid, password[]);
public LoginCallback(playerid, password[])
{
new rows,fields,maximum[128];
cache_get_data(rows, fields);
if(!rows)
{
if(GetPVarInt(playerid, "PasswordNot") == 2) return KickD(playerid,"Вы ввели 3 раза неверный пароль, поэтому были кикнуты сервером");
SetPVarInt(playerid, "PasswordNot", GetPVarInt(playerid, "PasswordNot")+1);
format(maximum,128, "Ваш ник зарегистрирован\n\nЛогин: %s\nВведите пароль:\n\n{FF0000}Неверный пароль Осталось %d попытки",Player[playerid][pSendername],3 - GetPVarInt(playerid, "PasswordNot"));
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "{6495ED}Авторизация", maximum, "Вход", "Отмена");
return 1;
}
Player[playerid][pID] = cache_get_field_content_int(0,"id");
cache_get_field_content(0, "password",Player[playerid][pPassword],connectionHandl,16);
cache_get_field_content(0, "ip",Player[playerid][pIP],connectionHandl,16);
cache_get_field_content(0, "mail",Player[playerid][pMail],connectionHandl,64);
cache_get_field_content(0, "datareg",Player[playerid][pRegData],connectionHandl,16);
Player[playerid][pSex] = cache_get_field_content_int(0,"sex");
Player[playerid][pModel] = cache_get_field_content_int(0,"model");
Player[playerid][pLevel] = cache_get_field_content_int(0,"level");
Player[playerid][pMoney] = cache_get_field_content_int(0,"money");
SetSpawnInfo(playerid, 255, Player[playerid][pModel], 0, 0, 0, 1.0, -1, -1, -1, -1, -1, -1);
PlayerLogged[playerid] = true;
SetPlayerScore(playerid, Player[playerid][pLevel]);
SpawnPlayer(playerid);
return 1;
}