12.10.2014, 18:42
My Code:
No Save position players exit game
No Save position players exit game
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
new string[128];
format(string, sizeof(string), "%s покинул сервер", GN(playerid));
SendClientMessageToAll(-1, string);
if(User[playerid][USER_LOGGED_IN] == true)
{
new Query[256];
GetPlayerPos(playerid, User[playerid][USER_PositionX], User[playerid][USER_PositionY], User[playerid][USER_PositionZ]);
GetPlayerFacingAngle(playerid, User[playerid][USER_FacingAngle]);
User[playerid][USER_Interior] = GetPlayerInterior(playerid);
User[playerid][USER_VirtualWorld] = GetPlayerVirtualWorld(playerid);
format(Query, sizeof(Query), "UPDATE users SET admin = %d, vip = %d, money = %d, score = %d, kills = %d, deaths = %d, kd = %d, banned = %d, PositionX = %f, PositionY = %f, PositionZ = %f, FacingAngle= %f, Interior = %d, VirtualWorld = %i WHERE username = '%s'", User[playerid][USER_ADMIN], User[playerid][USER_VIP], GetPlayerMoney(playerid), GetPlayerScore(playerid), User[playerid][USER_KILLS], User[playerid][USER_DEATHS], User[playerid][USER_KD], User[playerid][USER_BANNED], User[playerid][USER_PositionX], User[playerid][USER_PositionY], User[playerid][USER_PositionZ], User[playerid][USER_FacingAngle], User[playerid][USER_VirtualWorld], DB_Escape(User[playerid][USER_NAME]));
db_query(Database, Query);
}
for(new i; i < _: USER_DATA; ++i) User[playerid][USER_DATA: i] = 0;
return 1;
}