Looking for a admin duty system
#7

Quote:
Originally Posted by Walsh
View Post
Made this in 10 minutes lmao. Tested.
pawn Code:
new bool:IsOnAdminDuty[MAX_PLAYERS] = false;
CMD:aduty(playerid,params[]) // Onduty
{
    if(!IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid,-1,"You are not authorised to use that command.");
        return 1;
    }
    if(IsOnAdminDuty[playerid] == false)
    {
        IsOnAdminDuty[playerid] = true;
        new pname[24],dstring[124];
        GetPlayerName(playerid,pname,sizeof(pname));
        format(dstring,sizeof(dstring),"Administrator %s is now on duty.",pname);
        SendClientMessageToAll(-1,dstring);
        SetPlayerHealth(playerid,99999);
        SetPlayerArmour(playerid,99999);
        SetPlayerSkin(playerid,271);
    }
    return 1;
}
CMD:aoffduty(playerid,params[]) // Off duty
{
    if(!IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid,-1,"You are not authorised to use that command.");
        return 1;
    }
    if(IsOnAdminDuty[playerid] == true)
    {
        IsOnAdminDuty[playerid] = false;
        new name[24],ostring[124];
        GetPlayerName(playerid,name,sizeof(name));
        format(ostring,sizeof(ostring),"Administrator %s is now off duty.",name);
        SendClientMessageToAll(-1,ostring);
        SetPlayerHealth(playerid,100);
        SetPlayerArmour(playerid,0);
    }
    return 1;
}
CMD:admins(playerid,params[]) // Admins command
{
    SendClientMessage(playerid,-1,"----Current on duty Administrators----");
    for(new i = 0; i <MAX_PLAYERS; i++)
    {
        if(IsOnAdminDuty[i] == true)
        {
            new aname[24],astring[124];
            GetPlayerName(playerid,aname,sizeof(aname));
            format(astring,sizeof(astring),"%s",aname);
            SendClientMessage(playerid,-1,astring);
         }
    }
    return 1;
}
Are you sure he is using ZCMD not Dcmd or strcmp ?
Reply


Messages In This Thread
Looking for a admin duty system - by Captain_jeffree95 - 17.01.2012, 04:25
Re: Looking for a admin duty system - by Quinlynn - 03.03.2012, 02:05
Re: Looking for a admin duty system - by Deduction - 03.03.2012, 02:51
Re: Looking for a admin duty system - by Walsh - 03.03.2012, 03:01
Re: Looking for a admin duty system - by Deduction - 03.03.2012, 03:44
Re: Looking for a admin duty system - by Walsh - 03.03.2012, 06:13
Re: Looking for a admin duty system - by VIPAwesome - 03.03.2012, 06:21
Re: Looking for a admin duty system - by Walsh - 03.03.2012, 06:28
Re: Looking for a admin duty system - by VIPAwesome - 03.03.2012, 07:20
Re: Looking for a admin duty system - by Danish7 - 06.03.2014, 04:08

Forum Jump:


Users browsing this thread: 1 Guest(s)