Alex_Jemison
Умник
Делаю авторизацию и у меня неадекватно выводит сообщение.
И по возможности помогите избавиться PVar
Скрин:
Код:
И по возможности помогите избавиться PVar
Скрин:
Код:
PHP:
public OnPlayerConnect(playerid)
{
SetPVarInt(playerid, "WrongPassword", 3);
return 1;
}
PHP:
case 6:
{
if(response)
{
if(!strlen(inputtext))
{
ShowLogin(playerid);
return 1;
}
if(strcmp(PlayerInfo[playerid][pPassword], inputtext, true, 30) == 0)
{
static const fmt_query[] = "SELECT * FROM `accounts` WHERE `Name` = '%s' AND `Password` = '%s' ";
new query[sizeof(fmt_query) +(-2+MAX_PLAYER_NAME)+(-2+30)];
format(query, sizeof(query), fmt_query, PlayerInfo[playerid][pName],PlayerInfo[playerid][pPassword]);
mysql_tquery(mysql, query, "PlayerLogin", "i", playerid);
}
else
{
new string[60];
SetPVarInt(playerid, "WrongPassword", GetPVarInt(playerid, "WrongPassword")-1);
if(GetPVarInt(playerid, "WrongPassword") > 0)
{
format(string, sizeof(string), ">> Вы ввели неправильный пароль. У вас осталось %s попыток !", GetPVarInt(playerid, "WrongPassword"));
SendClientMessage(playerid, COLOR_WHITE, string);
}
if(GetPVarInt(playerid, "WrongPassword") == 0)
{
SendClientMessage(playerid, COLOR_WHITE, ">> Вы использовали все попытки для входа");
}
ShowLogin(playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_GOLD, "Для выхода из игры используйте /quit");
return Kick(playerid);
}
}
}
return 1;
}
