CMD:onduty(playerid, params[])
{
new aName[24];
new string [128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0x0,"Your not a Admin");//Set for RCON admins but change to your Admin variable
{
ShowPlayerMarkers(2);//Shows for nearby players and (1) = for all players
GetPlayerName(playerid, aName, sizeof(aName));
format(string, sizeof(string),"Admin %s [%d] is On Duty",aName,playerid);
SendClientMessageToAll(0x0,string);//Again change color
}
return true;
}
CMD:offduty(playerid, params[])
{
new aName[24];
new string [128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0x0,"Your not a Admin");//Set for RCON admins but change to your Admin variable
{
ShowPlayerMarkers(0);//Disables marker
GetPlayerName(playerid, aName, sizeof(aName));
format(string, sizeof(string),"Admin %s [%d] is Off Duty",aName,playerid);
SendClientMessageToAll(0x0,string);//Again change color
}
return true;
}
^ Not liking that way, you can make it in one command, if you type it once you're on duty if you type it twice you're off-duty.
|
^ Not liking that way, you can make it in one command, if you type it once you're on duty if you type it twice you're off-duty.
|
new bool:IsOnDuty[MAX_PLAYERS];//Top of script...
public OnPlayerConnect(playerid)//Under...
{
IsOnDuty[playerid] = false;
return 1;
}
public OnPlayerDisconnect(playerid)//Under...
{
IsOnDuty[playerid] = false;
return 1;
}
CMD:aduty(playerid, params[])
{
new aName[24];
new string [128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0x0,"Your not a Admin");//Set for RCON admins but change to your Admin variable
{
if(IsOnDuty[playerid] == false)
{
ShowPlayerMarkers(2);//Shows for nearby players and (1) = for all players
GetPlayerName(playerid, aName, sizeof(aName));
format(string, sizeof(string),"Admin %s [%d] is On Duty",aName,playerid);
SendClientMessageToAll(0x0,string);//Again change color
IsOnDuty[playerid] = true;//Forgot this xD
}
else
{
ShowPlayerMarkers(0);//Disables marker
GetPlayerName(playerid, aName, sizeof(aName));
format(string, sizeof(string),"Admin %s [%d] is Off Duty",aName,playerid);
SendClientMessageToAll(0x0,string);//Again change color
IsOnDuty[playerid] = false;//Forgot this also xD
}
}
return true;
}