SA-MP Forums Archive
Looking for a admin duty system - 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: Looking for a admin duty system (/showthread.php?tid=311523)



Looking for a admin duty system - Captain_jeffree95 - 17.01.2012

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


Re: Looking for a admin duty system - Quinlynn - 03.03.2012

Yes. I am scripting this now.


Re: Looking for a admin duty system - Deduction - 03.03.2012

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


Re: Looking for a admin duty system - Walsh - 03.03.2012

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;
}



Re: Looking for a admin duty system - Deduction - 03.03.2012

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


Re: Looking for a admin duty system - Walsh - 03.03.2012

I can make a passworded /aduty if the dude wants.


Re: Looking for a admin duty system - VIPAwesome - 03.03.2012

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 ?


Re: Looking for a admin duty system - Walsh - 03.03.2012

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


Re: Looking for a admin duty system - VIPAwesome - 03.03.2012

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


Re: Looking for a admin duty system - Danish7 - 06.03.2014

*****