Looking for a admin duty system
#1

hello people i hope someone can help me with this problem i hope someone can leave a code for a admin duty script if would be really greatful with someone could script one or help another way please help.

cmds

/aduty- turns admin command s on and show the admins names in /admins, changes skin to 217

/aoffduty - turns admin caommands off and there name doesnt show up when they do /admin changes back to what they first choose.

please help guys
Reply
#2

Yes. I am scripting this now.
Reply
#3

Alright I will script this, and paste in the code in a few minutes.
Since Quinlynn is taking too long :P
Reply
#4

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;
}
Reply
#5

Lol nice Walsh, I tried doing something simliar but having a stored password like #define ADMIN_PASS "changeme"
But kept running into index issues lol
Reply
#6

I can make a passworded /aduty if the dude wants.
Reply
#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
#8

Quote:
Originally Posted by VIPAwesome
View Post
Are you sure he is using ZCMD not Dcmd or strcmp ?
Yes, this is ZCMD.
Reply
#9

Quote:
Originally Posted by Walsh
View Post
Yes, this is ZCMD.
I means Captain_jeffree95 Using ZCMD? Are you sure?
Reply
#10

*****
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)