Little help
#1

Hello, im making an autologin based on last ip. This is how i scripted it:

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;
}
But i'm getting this error:

Quote:

error 029: invalid expression, assumed zero

The error is referred to the last "else".

What's wrong? :/
Reply


Messages In This Thread
Little help - by KinderClans - 28.05.2018, 19:19
Re: Little help - by Dayrion - 28.05.2018, 19:51
Re: Little help - by KinderClans - 28.05.2018, 21:14
Re: Little help - by Exhibit - 28.05.2018, 22:36
Re: Little help - by KinderClans - 28.05.2018, 23:19
Re: Little help - by KinderClans - 29.05.2018, 13:41
Re: Little help - by KinderClans - 30.05.2018, 21:41

Forum Jump:


Users browsing this thread: 1 Guest(s)