16.09.2010, 02:09
(
Последний раз редактировалось xyu3xx; 16.09.2010 в 14:18.
)
If i want to get the player position, when the player disconnect. i Got a float value 0.0000.
Follow my example
I have a solution, but it is not good.
I can run a timer to do this. Every 1 second.
Now, imagine this every second of the life of my server. Oh my Lag.
Anyone have a best solution?
Follow my example
Код:
public OnPlayerDisconnect(playerid, reason) {
GetPlayerHealth(playerid, playerInfo[playerid][pVida]); // i got 0.0000
playerInfo[playerid][pDinheiro] = GetPlayerMoney(playerid); // it is ok
GetPlayerPos(playerid, playerInfo[playerid][pPosX], playerInfo[playerid][pPosY], playerInfo[playerid][pPosZ]); // All 0.000
playerInfo[playerid][pSkin] = GetPlayerSkin(playerid); // 0
playerInfo[playerid][pInterior] = GetPlayerInterior(playerid); // 0
SaveData(playerid);
return 1;
}
I can run a timer to do this. Every 1 second.
Код:
setTimer("SaveData".... 1000
public SaveData() {
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
GetPlayerHealth(i, playerInfo[i][pVida]);
playerInfo[i][pDinheiro] = GetPlayerMoney(i);
GetPlayerPos(i, playerInfo[i][pPosX], playerInfo[i][pPosY], playerInfo[i][pPosZ]);
playerInfo[i][pSkin] = GetPlayerSkin(i);
playerInfo[i][pInterior] = GetPlayerInterior(i);
}
}
return 1;
}
Anyone have a best solution?


.

thats why the cords are 0. i remember i ran into the very same problem.