25.12.2010, 12:51
pawn Код:
SavePlayer(playerid)
{
if(!PlayerLogged[playerid])
return 0;
UserStats[playerid][moneysave] = GetPlayerMoney(playerid);
new string[512];
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
format(string, sizeof(string), "UPDATE `users` SET `adminlevel` = '%d', `money` = '%d', `kill` = '%d',`death` = '%d',`score` = '%d',`interior` = '%d' WHERE `username` = '%s'", UserStats[playerid][admin], UserStats[playerid][moneysave], UserStats[playerid][kills], UserStats[playerid][deaths], UserStats[playerid][score], UserStats[playerid][interior], UserStats[playerid][name]);
mysql_query(string);
format(string, sizeof(string), "UPDATE `users` SET `boss` = '%s', `classid` = '%d', `x` = '%f', `y` = '%f', `z` ='%f', `health` = '%f' WHERE `username`= '%s'", UserStats[playerid][boss], UserStats[playerid][gang], x, y, z, UserStats[playerid][healthsave], UserStats[playerid][name]);
mysql_query(string);
return 1;
}
And use threaded queries.