On player marker - 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)
+--- Thread: On player marker (
/showthread.php?tid=616938)
On player marker -
StR_MaRy - 12.09.2016
Hey guys i have a War sistem but i want to make a marker for every player in War attackers and defenders i have only this
Код HTML:
public OnPlayerStreamIn(playerid, forplayerid)
{
if(Undercover[playerid] == 1)
{
TeamColor(playerid);
ShowPlayerNameTagForPlayer(forplayerid, playerid, 0);
SetPlayerMarkerForPlayer( playerid, forplayerid, ( GetPlayerColor( forplayerid ) & 0xFFFFFF00 ) );
SetPlayerMarkerForPlayer( forplayerid, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
return 1;
}
if(IsInWar1(playerid) && IsInWar1(forplayerid) || IsInWar2(playerid) && IsInWar2(forplayerid))
{
new zone = GetPlayerZone(playerid);
if(zone == -1 || TakeON[zone] == 0 || !IsPlayerInZone(forplayerid, zone))
{
SetPlayerMarkerForPlayer( playerid, forplayerid, ( GetPlayerColor( forplayerid ) ) );
SetPlayerMarkerForPlayer( forplayerid, playerid, ( GetPlayerColor( playerid ) ) );
}
}
else
{
if(PlayerPaintballing[playerid] && PlayerPaintballing[forplayerid] || InClanWar[playerid] && InClanWar[forplayerid])
{
SetPlayerMarkerForPlayer( playerid, forplayerid, GetPlayerColor( forplayerid ) );
SetPlayerMarkerForPlayer( forplayerid, playerid, GetPlayerColor( playerid ) );
}
else
{
SetPlayerMarkerForPlayer( playerid, forplayerid, ( GetPlayerColor( forplayerid ) & 0xFFFFFF00 ) );
SetPlayerMarkerForPlayer( forplayerid, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
}
}
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
if(!IsInWar1(playerid) && !IsInWar2(playerid) && !IsInWar1(forplayerid) && !IsInWar2(forplayerid))
{
SetPlayerMarkerForPlayer( playerid, forplayerid, ( GetPlayerColor( forplayerid ) & 0xFFFFFF00 ) );
SetPlayerMarkerForPlayer( forplayerid, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
}
return 1;
}
nothing else is something wrong why i can't see my team mate's or oponent's ? can some1 help me ?
Re: On player marker -
Sew_Sumi - 12.09.2016
If you set Player Markers to global, you wouldn't need all of this...
Re: On player marker -
StR_MaRy - 12.09.2016
yea but i want only for players who have war in that zone
Re: On player marker -
Sew_Sumi - 12.09.2016
I'm semi-sure what you need to do is check the if statements, as they seem excessive, relative to what you are checking.
&& != ==, If you confirm one, you then don't need to confirm the other.
What also will happen, is if someone gets away from someone, and doesn't stream back in before the war is finished, their marker will be visible to the player all the time. Same in regards to Undercover. If they switch the state outside of the stream area, they'll be visible until they stream back in.
-Edit- Ignore my comment regarding the usage of SetPlayerColor and the way I said about SetPlayerMarkerForPlayer. It appears I haven't looked at my own code for a long while.