Admin Duty Marker
#1

pawn Код:
CMD:aduty(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first before using that command.");
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not authorized to use this command.");
    if(!aDuty[playerid])
    {
        format(string, sizeof(string), "%s is now on duty as an Administrator. /report for any major problems.", RPN(playerid));
        SendClientMessageToAll(COLOR_LIME, string);
        aDuty[playerid] = 1;
        GetPlayerIp(playerid, PlayerInfo[playerid][pIP], 16);
        SetPlayerColor(playerid,COLOR_LIME);
        aDutyText[playerid] = CreateDynamic3DTextLabel("Admin Duty", COLOR_LIME, 0, 0, -20, 25, playerid);
        Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL,aDutyText[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.35);
    }
    else
    {
        if(Spec[playerid]) return SendClientMessage(playerid, COLOR_LIGHTRED, "You can not go off admin duty while spectating someone.");
        aDuty[playerid] = 0;
        format(string, sizeof(string), "%s is now off duty as an Administrator.", RPN(playerid));
        SendClientMessageToAll(COLOR_LIME, string);
        SetPlayerColor(playerid, COLOR_WHITE);
        DestroyDynamic3DTextLabel(aDutyText[playerid]);
    }
    return 1;
}
I have this code, but when I use /aduty it marks me as green and on the map, then when I use /aduty again to go off duty it marks me as white on the map, how do I make it just so it puts my name back as white and stops showing me on the map?
Reply
#2

this is usefull , try to work with it:
it's here
Reply
#3

Quote:
Originally Posted by Robert West
Посмотреть сообщение
this is usefull , try to work with it:
it's here
I don't use SetPlayerMarkerForPlayer as you can see if you looked in my code.
I use SetPlayerColor which is how I don't understand why it sets a player marker on the map when I SetPlayerColor..
Reply
#4

Do you mean when you go off admin duty you won't be visible on the map ?

Edit : Is that what you want to make ?
Reply
#5

Quote:
Originally Posted by Lexi'
Посмотреть сообщение
Do you mean when you go off admin duty you won't be visible on the map ?

Edit : Is that what you want to make ?
Yep that's it, I have tried for hours but can't seem to get it right, it either turns me white on the map when I go off duty or my name disappears from the TAB (players online menu).
Reply
#6

That is weird the code looks fine.
Reply
#7

This should do the trick possibly. https://sampwiki.blast.hk/wiki/ShowPlayerMarkers
Reply
#8

When someone joins the server do they have a marker (they can see eachother), or when someone joins no markers are shown ?

EDIT:
I don't think so.
Reply
#9

Quote:
Originally Posted by Lexi'
Посмотреть сообщение
When someone joins the server do they have a marker (they can see eachother), or when someone joins no markers are shown ?

EDIT:


I don't think so.
When I go on duty they can see me in lime colour on the mini map, then when I go off duty sometimes they see me still on the map but in white instead or I go invisible on TAB (player online menu)
Reply
#10

Are you using zGaming Roleplay ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)