Variable reset
#1

Hello everyone,

I have a question for you guys.
If I have a gamemode with variables for every user. I don't use Pvars because they don't seem to work for me.
So, my script loads and saves the position into a mysql database.
I store the positions when loggin in in this format:
px[playerid] = field[0];
For example.
This system works fine. But when I quit samp, and reload it (without reloading the server) it doesnt seem to work anymore.
Here is my script that loads the position:
pawn Code:
public ContinueLogin(playerid)
{
    format(query, sizeof (query), "SELECT px, py, pz FROM players WHERE username='%s'", playername[playerid]);
    mysql_query(query);
    mysql_store_result();
    while (mysql_fetch_row(data, "|"))
    {
        split(data, field, '|');
    }
    mysql_free_result();
    px[playerid] = strval(field[0]);
    py[playerid] = strval(field[1]);
    pz[playerid] = strval(field[2]);
   
    if (strval(pstatus[playerid]) == 1)
    {
        StartTutorial(playerid);
    }
    else
    {
        ploggedin[playerid] = 1;
        TogglePlayerSpectating(playerid, 0);
        SetPlayerPos(playerid, px[playerid], py[playerid], pz[playerid]);
    }
    return 1;
}
This funtion is called after some other steps like login/register.
So when I reload samp, and I want to login, I jsut get the <<<, >> and Spawn buttons. Should I reset the variables or something? It's really frustrating :S

Thanks so far
Reply


Messages In This Thread
Variable reset - by baske007 - 23.07.2010, 22:04
Re: Variable reset - by baske007 - 24.07.2010, 09:23
Re: Variable reset - by dice7 - 24.07.2010, 09:37
Re: Variable reset - by baske007 - 24.07.2010, 11:40
Re: Variable reset - by baske007 - 24.07.2010, 12:18

Forum Jump:


Users browsing this thread: 1 Guest(s)