22.09.2011, 21:13
I don't want to GetPlayerPos - OnPlayerUpdate or with timers. It would lag my server. So, I'm taking player position on his disconnect.
But I want to disable getting position, if I'm gmxing.
And I'm sorry for wrong section ;P
But I want to disable getting position, if I'm gmxing.
Код:
public OnPlayerDisconnect(playerid) { if(PlayerInfo[playerid][loggedIn] == 1) { GetPlayerPos(playerid, PlayerInfo[playerid][x], PlayerInfo[playerid][y], PlayerInfo[playerid][z]); GetPlayerFacingAngle(playerid, PlayerInfo[playerid][angle]); format(query, 128, "UPDATE `players` SET `x`=%f,`y`=%f,`z`=%f,`angle`=%f WHERE `login`='%s'", PlayerInfo[playerid][x], PlayerInfo[playerid][y], PlayerInfo[playerid][z], PlayerInfo[playerid][angle], playerName(playerid)); mysql_query(query); } return 1; }