Confirmed:
pawn Код:
#include <a_samp>
main() {}
public OnPlayerConnect(playerid)
{
SetPVarInt(playerid, "test", 69);
return 1;
}
public OnPlayerSpawn(playerid)
{
print("OnPlayerSpawn");
printf("test: %i", GetPVarInt(playerid, "test"));
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
print("OnPlayerDisconnect");
printf("test: %i", GetPVarInt(playerid, "test"));
return 1;
}
Output:
[19:08:54] [join] James has joined the server (0:127.0.0.1)
Console input: gmx
[19:09:03] test: 0
----------
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3e, ©2005-2012 SA-MP Team
- plugins etc. removed to shorten -
[19:09:49] Loaded 5 filterscripts.
[19:09:49] Number of vehicle models: 0
[19:09:52] Incoming connection: 127.0.0.1:53367
[19:09:52] [join] James has joined the server (0:127.0.0.1)
[19:09:55] OnPlayerSpawn
[19:09:55] test: 69
Console input: gmx
[19:10:00] OnPlayerDisconnect
[19:10:00] test: 0
[19:10:12] Number of vehicle models: 0
[19:10:14] OnPlayerSpawn
[19:10:14] test: 69
[19:10:16] [chat] [James]: now i /q
[19:10:17] OnPlayerDisconnect
[19:10:17] test: 69
[19:10:17] [part] James has left the server (0:1)
I suggest not using the default gmx command, and instead using SendRconCommand in your game-mode, and BEFORE you send 'gmx' with SendRconCommand set a global 'gmx' variable to 1, and under OnPlayerDisconnect if that gmx variable is 1 don't save the data. You can save it in your restart command. You can also make a 'restart' (for example) command for your console with OnRconCommand, but if your server is hosted that's not a problem.
I don't think things can be saved when a GMX occurs, I've not tried it.