Admin Marker
#1

Hi,

I've been searching and i dont found nothing, i want.

if anyone can help me, i pretend:

In my GM, i have ShowPlayerMarkers(false)

That is right, but i want is when admin enter on Duty, a marker has show on mini-map.

Anyone can tell me how i put that?
Reply
#2

This is in ZCMD i made /onduty /offduty you will need to edit a few things to go with your mode.

I even made it so it announces it to global players xD

pawn Код:
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;
}
Enjoy,

EDIT: typo
Reply
#3

^ 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.
Reply
#4

Quote:
Originally Posted by AlExAlExAlEx
Посмотреть сообщение
^ 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.
Then use a status variable.
Reply
#5

Quote:
Originally Posted by AlExAlExAlEx
Посмотреть сообщение
^ 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.
Ok i made it into one commad... /aduty

pawn Код:
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;
}
Enjoy,


EDIT

Edits commented..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)