[HELP]SetPlayerMarkerForPlayer - 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: [HELP]SetPlayerMarkerForPlayer (
/showthread.php?tid=173714)
[HELP]SetPlayerMarkerForPlayer -
viper_viper - 03.09.2010
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.
Re: [HELP]SetPlayerMarkerForPlayer -
CyNiC - 03.09.2010
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));
}
}
}
Re: [HELP]SetPlayerMarkerForPlayer -
viper_viper - 03.09.2010
But this is under OnPlayerSpawn. And theres different code under a timer using "i"
Re: [HELP]SetPlayerMarkerForPlayer -
CyNiC - 03.09.2010
I messed up, sorry.
Re: [HELP]SetPlayerMarkerForPlayer -
viper_viper - 03.09.2010
np, any others could help me?
Re: [HELP]SetPlayerMarkerForPlayer -
viper_viper - 03.09.2010
Didnt seem to work =/