MySQL position saving and loading
#1

Well, i have an problem.
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if(Logged[playerid] == 1)
    {
        new mangutunde = GetPlayerScore(playerid);
        new raha = GetPlayerMoney(playerid);
        new Float:x, Float:y, Float:z, query[200], pname[24];
        GetPlayerName(playerid, pname, 24);
        GetPlayerPos(playerid, x, y, z);
        format(query, sizeof(query), "UPDATE playerinfo SET mangutunde=%d AND raha=%d AND `x`= '%f' AND `y`= '%f' AND `z`= '%f' WHERE kasutaja='%s'", mangutunde, raha, x, y, z, pname);
        mysql_query(query);

    }
    return 1;
}
This code wont save x,y and z. Can somebody help me?

http://www.upload.ee/image/1843317/lolololo.PNG this is at the phpmyadmin.
Reply
#2

try like this:

Код:
public OnPlayerDisconnect(playerid, reason)
{
    if(Logged[playerid] == 1)
    {
        new mangutunde = GetPlayerScore(playerid);
        new raha = GetPlayerMoney(playerid);
        new Float:x, Float:y, Float:z, query[200], pname[24];
        GetPlayerName(playerid, pname, 24);
        GetPlayerPos(playerid, x, y, z);
        format(query, sizeof(query), "UPDATE playerinfo SET `mangutunde`='%d', `raha`='%d', `x`= '%f', `y`= '%f' ,`z`= '%f' WHERE kasutaja='%s'", mangutunde, raha, x, y, z, pname);
        mysql_query(query);

    }
    return 1;
}
Reply
#3

"UPDATE playerinfo SET mangutunde=%d, aha=%d, `x`= '%f', `y`= '%f', `z`= '%f' WHERE kasutaja='%s'"

Try this.

And be sure all your variable's have to good valeu.
So your x,y,z colums in your database should be FLOAT.
If it still doesn't work tell me.

Edit: Look above, I was to late
Reply
#4

Still
x = 0
y = 0
z = 0
and these variables are float?
Reply
#5

Can you make a screenshot of the structuur of your database if you don't bother...

(You also should enable your MySQL debug function so you can see if there are any errors.
Reply
#6

http://www.upload.ee/image/1844026/lol.PNG
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)