SA-MP Forums Archive
Set '!IsPlayerAdmin' To 1 With /aduty command? - 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: Set '!IsPlayerAdmin' To 1 With /aduty command? (/showthread.php?tid=540211)



Set '!IsPlayerAdmin' To 1 With /aduty command? - XGreen - 03.10.2014

is that possible? can anyone do it for me on this cmd:
PHP код:
CMD:aduty(playerid)
if(
pInfo[playerid][pAdminLevel] >= 1)
        {
            if(
pInfo[playerid][pAdminDuty] == 0)
            {
            
pInfo[playerid][pAdminDuty] = 1;
            new 
adutyonstring[128];
            
format(adutyonstringsizeof(adutyonstring), "%s is now on admin duty" ,PlayerName(playerid));
            
SendClientMessageToAll(-1,adutyonstring);
            
SetPlayerColor(playerid,COLOR_WHITE);
            
SetPlayerHealth(playerid,999999.0);
            
SendClientMessage(playerid,COLOR_RED,"Remember to /aduty when you play as regular player.");
            }
            else
            {
                if(
pInfo[playerid][pAdminDuty] == 1)
                {
                
pInfo[playerid][pAdminDuty] = 0;
                new 
adutyoffstring[128];
                
format(adutyoffstringsizeof(adutyoffstring), "%s is now off admin duty" ,PlayerName(playerid));
                
SendClientMessageToAll(-1,adutyoffstring);
                if(
team[playerid] == TEAM_ZOMBIE)
                {
                    
SetPlayerColor(playerid,COLOR_ZOMBIE);
                }
                if(
team[playerid] == TEAM_HUMAN)
                {
                    
SetPlayerColor(playerid,COLOR_HUMAN);
                }
                
SetPlayerHealth(playerid,100);
                }
            }
        }
    } 
sorry for missed codes, i just removed a part from there.


Re: Set '!IsPlayerAdmin' To 1 With /aduty command? - XGreen - 03.10.2014

anyone?


Re: Set '!IsPlayerAdmin' To 1 With /aduty command? - JJack - 03.10.2014

if(pInfo[playerid][pAdminLevel] >= 1)
Already defines whether the player is an admin or not...
Why do you want IsPlayerAdmin?


Re: Set '!IsPlayerAdmin' To 1 With /aduty command? - XGreen - 03.10.2014

Quote:
Originally Posted by JJack
Посмотреть сообщение
if(pInfo[playerid][pAdminLevel] >= 1)
Already defines whether the player is an admin or not...
Why do you want IsPlayerAdmin?
whatever.... BTW, thanks for reply. +1


Re: Set '!IsPlayerAdmin' To 1 With /aduty command? - JJack - 03.10.2014

Quote:
Originally Posted by XGreen
Посмотреть сообщение
whatever.... BTW, thanks for reply. +1
Welcome lol, you should check your code first ;p