stock SaveStats(playerid) { new query[256]; new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); PlayerInfo[playerid][PosX] = x; PlayerInfo[playerid][PosY] = y; PlayerInfo[playerid][PosZ] = z; format(query, sizeof(query), "UPDATE playerdata SET Cash=%i PosX=%f AND PosY=%f AND PosZ=%f WHERE Name='%s'", PlayerInfo[playerid][Cash], PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosX], GetName(playerid)); mysql_query(query); printf("Player Saved"); return 1; }
stock SaveStats(playerid) { new query[256]; new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); PlayerInfo[playerid][PosX] = x; PlayerInfo[playerid][PosY] = y; PlayerInfo[playerid][PosZ] = z; format(query, sizeof(query), "UPDATE playerdata SET Cash=%i PosX=%f AND PosY=%f AND PosZ=%f WHERE Name='%s'", PlayerInfo[playerid][Cash], PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ], GetName(playerid)); mysql_query(query); printf("Player Saved"); return 1; }
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
PlayerInfo[playerid][PosX] = x;
PlayerInfo[playerid][PosY] = y;
PlayerInfo[playerid][PosZ] = z;
GetPlayerPos(playerid, PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ]);
MP2 is right.You can save lines xD....
You can do the same for angle ... |
UPDATE playerdata SET Cash=%i, PosX=%f, PosY=%f, PosZ=%f WHERE Name='%s'