Admin on~off duty
#2

Hi Johny_James,

A pretty simple function really

Код:
//Top of script
new AdminDuty[MAX_PLAYERS];

//OnPlayerConnect
AdminDuty[playerid] = 0;

//OnPlayerCommand
if(strcmp(cmdtext,"/adminduty",true) == 0)
{

    if(IsPlayerAdmin(playerid))
    {
        
        if(AdminDuty[playerid] == 0)
        {
             AdminDuty[playerid] = 1;
             SetPlayerColor(playerid,CUSTOM_COLOR);
             return 1;
         }
         else
         {
             AdminDuty[playerid] = 0;
             SetPlayerColour(playerid,DEFAULT_COLOUR);
             return 1;
         }

    }
    else
    {
        SendClientMessage(playerid,COLOUR_WARNING,"You are not an administrator!");
        return 1;
     }

}
Hope this helped out!

Cheers,

TJ
Reply


Messages In This Thread
Admin on~off duty - by Johny_James - 23.07.2010, 17:03
Re: Admin on~off duty - by TTJJ - 23.07.2010, 17:07
Re: Admin on~off duty - by Johny_James - 23.07.2010, 17:10
Re: Admin on~off duty - by DJDhan - 23.07.2010, 17:21
Re: Admin on~off duty - by TheKingOfSamp - 23.07.2010, 18:01
Re: Admin on~off duty - by Johny_James - 23.07.2010, 18:28
Re: Admin on~off duty - by Johny_James - 26.07.2010, 09:13
Re: Admin on~off duty - by Yamoo - 26.07.2010, 09:16
Re: Admin on~off duty - by Johny_James - 26.07.2010, 09:26
Re: Admin on~off duty - by Yamoo - 26.07.2010, 09:27

Forum Jump:


Users browsing this thread: 1 Guest(s)