03.03.2012, 03:01
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;
}