28.05.2018, 19:19
Hello, im making an autologin based on last ip. This is how i scripted it:
But i'm getting this error:
The error is referred to the last "else".
What's wrong? :/
pawn Код:
function OnPlayerDataLoaded(playerid, race_check)
{
if (race_check != g_MysqlRaceCheck[playerid]) return Kick(playerid);
new string[115];
if (!strcmp(Player[playerid][LastIP], ReturnPlayerIp(playerid), true))
{
cache_set_active(Player[playerid][Cache_ID]);
AssignPlayerData(playerid);
cache_delete(Player[playerid][Cache_ID]);
Player[playerid][Cache_ID] = MYSQL_INVALID_CACHE;
KillTimer(Player[playerid][LoginTimer]);
Player[playerid][LoginTimer] = 0;
Player[playerid][IsLoggedIn] = true;
}
else
{
if(cache_num_rows() > 0)
{
cache_get_value(0, "password", Player[playerid][Password], 65);
cache_get_value(0, "salt", Player[playerid][Salt], 17);
Player[playerid][Cache_ID] = cache_save();
format(string, sizeof string, "This account (%s) is registered. Please login by entering your password in the field below:", Player[playerid][Name]);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", string, "Login", "Abort");
Player[playerid][LoginTimer] = SetTimerEx("OnLoginTimeout", SECONDS_TO_LOGIN * 1000, false, "d", playerid);
}
}
else
{
format(string, sizeof string, "Welcome %s, you can register by entering your password in the field below:", Player[playerid][Name]);
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registration", string, "Register", "Abort");
}
return 1;
}
Quote:
error 029: invalid expression, assumed zero |
What's wrong? :/