Mysql spawning
#3

Testing now
Edit: its still not working:
What am i doing wrong here:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new Float:X, Float:Y, Float:Z, string[120];
    GetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
    format(string, sizeof(string), "UPDATE Users SET X='%d',Y='%d',Z='%d' WHERE Name='%s'",X, Y, Z,UserStats[playerid][Name]);
    mysql_query(string);
    SavePlayer(playerid);

    UserStats[playerid][Admin] = 0;
    UserStats[playerid][Money] = 0;
    AccountExists[playerid] = 0;
    PlayerLogged[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    new string[128], load[50];
    format(string, sizeof(string), "SELECT `X`, `Y`, `Z` FROM Users WHERE Name = '%s'", UserStats[playerid][Name]);
    mysql_query(string);
    mysql_store_result();
    if(mysql_num_rows() != 0 && mysql_fetch_row(load))
    {
        sscanf(load, "p<|>fff", UserStats[playerid][X], UserStats[playerid][Y], UserStats[playerid][Z]);
        SetPlayerPos(playerid, UserStats[playerid][X], UserStats[playerid][Y], UserStats[playerid][Z]);
    }
    mysql_free_result();
    return 1;
}
Reply


Messages In This Thread
Mysql spawning - by thimo - 08.12.2011, 16:50
Re: Mysql spawning - by Laronic - 08.12.2011, 16:54
Re: Mysql spawning - by thimo - 08.12.2011, 16:57
Re: Mysql spawning - by Laronic - 08.12.2011, 16:58
Re: Mysql spawning - by thimo - 08.12.2011, 17:09
Re: Mysql spawning - by Laronic - 08.12.2011, 17:11
Re: Mysql spawning - by thimo - 08.12.2011, 17:18
Re: Mysql spawning - by Laronic - 08.12.2011, 17:24
Re: Mysql spawning - by thimo - 08.12.2011, 17:25
Re: Mysql spawning - by Laronic - 08.12.2011, 17:27

Forum Jump:


Users browsing this thread: 1 Guest(s)