05.09.2014, 00:00
If server restarts and player held a weapon before gmx was called then OnPlayerUpdate will return the same weaponid regardless of re-connection.
To test, simply give yourself a weapon in game and restart your server by using rcon gmx. You will notice that just after the restart, weaponid in console output will remain the same for some period of time.
*Subject to circumstance where you will have the same playerid after restart - (0) in this case.
Edit:
If instructions above give no results to approve this bug then try to pause the player and then restart the server via console box.
To test, simply give yourself a weapon in game and restart your server by using rcon gmx. You will notice that just after the restart, weaponid in console output will remain the same for some period of time.
*Subject to circumstance where you will have the same playerid after restart - (0) in this case.
Код:
COMMAND:restart(playerid, params[]) { SendRconCommand("gmx"); return 1; } public OnPlayerUpdate(playerid) { static weaponid; weaponid = GetPlayerWeapon(playerid); if(46 >= weaponid >= 0) { printf("weaponid %d", weaponid); } #if defined weapons_OnPlayerUpdate return weapons_OnPlayerUpdate(playerid); #else return 1; #endif } #if defined _ALS_OnPlayerUpdate #undef OnPlayerUpdate #else #define _ALS_OnPlayerUpdate #endif #define OnPlayerUpdate weapons_OnPlayerUpdate #if defined weapons_OnPlayerUpdate forward weapons_OnPlayerUpdate(playerid); #endif
If instructions above give no results to approve this bug then try to pause the player and then restart the server via console box.