код диалога
PHP код:
static const s_t[] = "SELECT * FROM `Accounts` WHERE `Nickname` = '%s' AND `Password` = '%s'";
new s_up[sizeof(s_t) + (-2 + MAX_PLAYER_NAME) + (-2 + 30)];
format(s_up, sizeof(s_up),s_t, PlayerInfo[playerid][pName], inputtext);
mysql_tquery(MYSQL_ARG, s_up, "Avtoriz", "ds", playerid, inputtext);
PHP код:
public Avtoriz(playerid, password[])
{
new rows, fields;
cache_get_data(rows, fields);
if(!rows)
{
SetPVarInt(playerid,"FailLogin",GetPVarInt(playerid,"FailLogin") + 1);
if(GetPVarInt(playerid,"FailLogin") == 3)
{
SendLanguageMessage(playerid,orange, "INFORMATION: {FFFFFF}You was kicked for entering the wrong password 3/3","ИНФОРМАЦИЯ: {FFFFFF}Вы были кикнуты за ввод неверного пароля 3/3");
return Kick(playerid);
}
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_PASSWORD, "{FF4500}Ошибка","{FF7F00}Вы указали неверный пароль!\n {FFA500}Введите пароль заново!", "Войти", "");
return true;
}
LoggedIn[playerid] = 1;
DeletePVar(playerid, "player_kick_time");
SetPVarInt(playerid, "count_time", 0);
PlayerTextDrawDestroy(playerid, CheckTimeLog[0]);
PlayerTextDrawDestroy(playerid, CheckTimeLog[1]);
for(new i = 0; i < rows;i++)
{
Avt(i,playerid);
}
format(PlayerInfo[playerid][pPassword], 30,"%s", password);//Записываем пароль в переменную
return true;
}
PHP код:
stock Avt(i,playerid)
{
Kills_Lvl[playerid] = cache_get_field_content_int(i, "Level");
SetPlayerScore(playerid,cache_get_field_content_int(i, "Score"));
ALevel[playerid] = cache_get_field_content_int(i, "Admin");
GivePlayerMoney(playerid,cache_get_field_content_int(i, "Money"));
NBAN[playerid] = cache_get_field_content_int(i,"Banned");
SetPVarInt( playerid, "Mute", cache_get_field_content_int( 0, "Mute" ) );
pDuelAll[playerid] = cache_get_field_content_int(i, "DuelAll");
pDuelWin[playerid] = cache_get_field_content_int(i, "DuelWin");
pDuelLoose[playerid] = cache_get_field_content_int(i, "DuelLoose");
pDragAll[playerid] = cache_get_field_content_int(i, "DragAll");
pDragLoose[playerid] = cache_get_field_content_int(i, "DragLoose");
pDragWin[playerid] = cache_get_field_content_int(i, "DragWin");
pVIP[playerid] = cache_get_field_content_int(i, "AccountType");
pKiss[playerid] = cache_get_field_content_int(i, "Kiss");
SKin[playerid] = cache_get_field_content_int(i, "Skin");
Deaths[playerid] = cache_get_field_content_int(i, "Deaths");
Kills[playerid] = cache_get_field_content_int(i, "Kills");
BizFlood[playerid] = cache_get_field_content_int(i, "BizFlood");
ZapretPlayeridPM[playerid] = cache_get_field_content_int(i, "ZapretPM");
ZapretPlayeridDrag[playerid] = cache_get_field_content_int(i, "ZapretDRAG");
ZapretPlayeridDuel[playerid] = cache_get_field_content_int(i, "ZapretDUEL");
ZapretVhod[playerid] = cache_get_field_content_int(i, "ZapretCONNECT");
Language[playerid] = cache_get_field_content_int(i, "Language");
PlayerInfo[playerid][AllPick] = cache_get_field_content_int(i, "AllPick");
SetPVarInt(playerid,"DateUnAdm",cache_get_field_content_int(i, "TimeUnAdm"));
SI[playerid][Time] = cache_get_field_content_int(i, "AutoTime");
PlayerInfo[playerid][uGang] = cache_get_field_content_int(i, "Gang");
PlayerInfo[playerid][uGangState] = cache_get_field_content_int(i, "GangState");
SI[playerid][WeatherID] = cache_get_field_content_int(i, "WeatherID");
SColor[playerid] = cache_get_field_content_int(i, "SColor");
LoggedIn[playerid] = 1;
}