SA-MP Forums Archive
Help with admins. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with admins. (/showthread.php?tid=77427)



Help with admins. - FreeSoul - 11.05.2009

I have the following things.
Quote:

//----------------AOD --------------------------------//
if(strcmp(cmd, "/adminonduty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
SetPlayerHealth(playerid,99999);
SetPlayerArmour(playerid,100);
format(string, sizeof(string), "[Info] %s is now on duty as an admin. ", sendername);
SendClientMessageToAll(COLOR_BLUE, string);
SetPlayerColor(playerid, COLOR_YELLOW2); //
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not an Admin !");
}
}
return 1;
}
//----------------AOF // --------------------------------//
if(strcmp(cmd, "/adminoffduty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{

GetPlayerName(playerid, sendername, sizeof(sendername));
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,0);
format(string, sizeof(string), "[Info] %s is no longer on duty as an admin.", sendername);
SendClientMessageToAll(COLOR_YELLOW2, string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not an Admin !");
}
}
return 1;
}

In addition to this CMD,I want an /admins CMD.
Like,if the player types /admins,if the admin is on-duty he will see like " Admin-FreeSoul-3-On Duty" with the color green.Like Admin-PlayerName-AdminLevel-OnDuty.
And if the admin is not on duty he will se like Admin-FreeSoul-3-OffDuty with red.
Can somebody help me with this?
It usually use [pAdmin]
Thanks.


Re: Help with admins. - MenaceX^ - 11.05.2009

You don't have any duty variable.


Re: Help with admins. - FreeSoul - 11.05.2009

How can I add it? I need to make a new command?


Re: Help with admins. - NeRoSiS - 11.05.2009

new duty[MAX_PLAYERS];

Under your on

duty[playerid] = 1;

and off

duty[playerid] = 0