[HELP]SetPlayerMarkerForPlayer
#1

I am making a COD like FFA and have made it so you cant see enemies unless you activate a UAV (/uav cmd)

The problem: When a player spawns, the script will check each spawned player if they have a UAV. If they do have a UAV then put all the red markers on, if they dont have a UAV then all markers turn invisible. However, when a person spawns, they will always appear on the map to everybody as a white marker for about a second even if the UAV is offline.

Is they anyway to stop that from happening? I know its not a big problem but it would make the GM a bit unfair and make the UAV more pointless.

Code under OnPlayerSpawn
pawn Код:
if (GameMode == MODE_FREE) {
        if (UAVTimer[playerid] > 0) {
            for(new w = 0; w < MAX_PLAYERS; w++) {
                SetPlayerMarkerForPlayer(playerid, w, (0xFF0000AA & 0xFF0000AA));
            }
        }
        else {
            for(new w = 0; w < MAX_PLAYERS; w++) {
                SetPlayerMarkerForPlayer(playerid, w, (0xFF0000AA & 0xFFFFFF00));
            }
        }
    }
Similar code is also ran under a repeating timer to update the UAV.
Reply
#2

pawn Код:
Change playerid for "i", like i made.
if (GameMode == MODE_FREE) {
        if (UAVTimer[playerid] > 0) {
            for(new w = 0; w < MAX_PLAYERS; w++) {
                SetPlayerMarkerForPlayer(i w, (0xFF0000AA & 0xFF0000AA));
            }
        }
        else {
            for(new w = 0; w < MAX_PLAYERS; w++) {
                SetPlayerMarkerForPlayer(i, w, (0xFF0000AA & 0xFFFFFF00));
            }
        }
    }
Reply
#3

But this is under OnPlayerSpawn. And theres different code under a timer using "i"
Reply
#4

I messed up, sorry.
Reply
#5

np, any others could help me?
Reply
#6

Didnt seem to work =/
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)