Updating SetPlayerMarkerForPlayer
#1

Hi,

Can anyone help me with SetPlayerMarkerForPlayer function? I currently a timer running to update the marker on radar. Like:
pawn Код:
//OnPlayerSpawn: SetTimerEx("Police_CheckWanted", 1000, true, "d", playerid);
forward Police_CheckWanted(playerid);
public Police_CheckWanted(playerid)
{
    foreach(Player, i)
    {
        if (GetPlayerWantedLevel(i) > 0)
            SetPlayerMarkerForPlayer(playerid, i, RED);
        else
        {
            switch (pInfo[i][Class])
            {
                case TRUCKER: SetPlayerMarkerForPlayer(playerid, i, COLOR_TRUCKER);
                case PILOT: SetPlayerMarkerForPlayer(playerid, i, COLOR_PILOT);
                case POLICE: SetPlayerMarkerForPlayer(playerid, i, COLOR_POLICE);
                case MECHANIC: SetPlayerMarkerForPlayer(playerid, i, COLOR_MECHANIC);
            }
        }
    }
}
And its kinda buggy like if i set another marker, the marker is flashing with 2 or 3 colors. Are there any ways that i can update it without having to set a timer? Or i must use a timer to keep updating it on radar?
Reply
#2

/bump
Reply
#3

Makes absolutely no sense to use a timer for this for one.
Reply
#4

Is it possible for your players to change class without having to spawn again ? If not,then there is no need for using a timer,you can just use the Onplayerrequestclass area to put your codes.
Just imagine what happens if a server with about 50 players keeps updating each player's marker every second.
Reply
#5

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Makes absolutely no sense to use a timer for this for one.
Well, without a timer i had a problem like, the marker was resetting to normal player color after the player has been streamed out. Thats why i had to set a timer to keep updating the marker whenever player streams out, but setting a timer was pretty buggy so i came here for help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)