11.04.2010, 17:50
I found an SA-MP bug. The PVars are resetted before OnPlayerDisconnect is called, when you restart the server. If you leave the server it works.
Take a look at this:
You see that the PVar: "MyVar" is resetted to zero if i restart the server, but not if i am leaving the server.
The code that i used is:
Because of this bug, my stats are not saved, because the PVar which is checking if i'm logged in fails, because the PVar is resetted.
Sorry for my bad English.
Wanted.
Take a look at this:
Код:
[17:52:50] [chat] [Wanted]: I am now restarting... [17:52:52] RCON (In-Game): Player [Wanted] sent command: gmx [17:52:52] MyVar: 0 [17:53:04] Number of vehicle models: 0 [17:53:13] [chat] [Wanted]: And now i am leaving the server. [17:53:17] MyVar: 5 [17:53:17] [part] Wanted has left the server (2:1)
The code that i used is:
Код:
public OnPlayerConnect(playerid) { SetPVarInt(playerid, "MyVar", 5); return 1; } public OnPlayerDisconnect(playerid, reason) { printf("MyVar: %d", GetPVarInt(playerid, "MyVar")); return 1; }
Sorry for my bad English.
Wanted.