SA-MP Forums Archive
How to script this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to script this? (/showthread.php?tid=499638)



How to script this? - ChristianIvann09 - 09.03.2014

if an admin is on DUTY. and they /q to server they will go automatically OFF DUTY.

Admin Duty variable [AdminDuty]


Re: How to script this? - ChristianIvann09 - 09.03.2014

because im having bugged


Re: How to script this? - Stinged - 09.03.2014

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if(AdminDuty[playerid] == 1)
    {
        AdminDuty[playerid] = 0;
    }
    return 1;
}



Re: How to script this? - Scenario - 09.03.2014

The problem you're experiencing will likely be for ANY per-player variable you don't reset when a player connects or disconnects. You're simply experiencing this issue with admin duty simply because playerid 0 is on admin duty and during local testing, you're playerid 0.

Therefore, for every per-player variable, you'll want to set it to 0 (or w/e the default value is) when the player disconnects.


Re: How to script this? - ChristianIvann09 - 09.03.2014

Nevermind.. i will just change GM


Re: How to script this? - Scenario - 09.03.2014

No downloaded GM I've ever seen resets the variables when a player disconnects. Here's an idea: Make your own GM!