Need help with markers
#1

Hi ,
im working in RP script so i need to help about markers on the map
i need to remove them .
They need to show only when admin is on duty.
there's my admin duty code :
pawn Code:
if(strcmp(cmd, "/aduty", true) == 0)
    {
        new aodName[MAX_PLAYER_NAME],string[128];
        GetPlayerName(playerid, aodName, sizeof(aodName));
        if(IsPlayerConnected(playerid))
        {
            if(pData[playerid][AdminLevel]>= 1)
            {
                new Float:Armour,Float:Health;
                GetPlayerHealth(playerid,Health);
                GetPlayerArmour(playerid,Armour);
                if(pData[playerid][pAOnDuty] == 0)
                {
                    SetPlayerColor(playerid, COLOR_YELLOW);
                    pData[playerid][pAOnDuty] = 1;
                    SendClientMessage(playerid, COLOR_GREY, "You are now on-duty as an admin.");
                    format(string, sizeof(string), "%s is now on-duty as an admin.",aodName);
                    dini_FloatSet(file,"Armour",Armour);
                    dini_FloatSet(file,"Health",Health);
                    SetPlayerHealth(playerid, 100);
                    SetPlayerArmour(playerid, 100);
                    SendClientMessageToAll(COLOR_RED, string);
                    return 1;
                }
                else
                {
                    SetPlayerColor(playerid, 0xFFFFFFFF);
                    pData[playerid][pAOnDuty] = 0;
                    SendClientMessage(playerid, COLOR_GREY, "You are no longer on-duty as an admin.");
                    format(string, sizeof(string), "%s is no longer on-duty as an admin.",aodName);
                    SetPlayerArmour(playerid,dini_Int(file, "Armour"));
                    SetPlayerHealth(playerid,dini_Int(file, "Health"));
                    SendClientMessageToAll(COLOR_BLUE, string);
                    return 1;
                }
            }
        }
        return 1;
     }
Reply
#2

Change
pawn Code:
SetPlayerColor(playerid, 0xFFFFFFFF);
to
pawn Code:
SetPlayerColor(playerid, 0xFFFFFFAA);
Reply
#3

Code:
ShowPlayerMarkers(0);
use that on OnGameModeInit

and then use the following function to show only admins:

Code:
SetPlayerMarkerForPlayer( playerid, put_the_admins_here, put_a_color_here );
https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer
https://sampwiki.blast.hk/wiki/ShowPlayerMarkers

I use this... but I think that mr cluckinbell script works too...
Reply
#4

Sorry, it should be

pawn Code:
0xFFFFFF00
Reply
#5

Thank You knackworst
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)