SA-MP Forums Archive
Admin Marker - 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: Admin Marker (/showthread.php?tid=226649)



Admin Marker - bernardo - 16.02.2011

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?


Re: Admin Marker - YungGee - 16.02.2011

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


Re: Admin Marker - AlExAlExAlEx - 16.02.2011

^ 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.


Re: Admin Marker - _Tommy - 16.02.2011

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.


Re: Admin Marker - YungGee - 16.02.2011

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..