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)
+--- Thread: SetPlayerMarkerForPlayer (
/showthread.php?tid=297304)
SetPlayerMarkerForPlayer -
Infamous - 15.11.2011
This may seem like a stupid question but is there any reason I can't use this function like this:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == BLUE_TEAM)
{
SetPlayerMarkerForPlayer(playerid, i, COLOR_BLUE);
}
}
Re: SetPlayerMarkerForPlayer -
[MG]Dimi - 15.11.2011
No. It looks just fine
Re: SetPlayerMarkerForPlayer -
Infamous - 15.11.2011
hmm it's only ment to show for the blue team although red team see it also.
Re: SetPlayerMarkerForPlayer -
Elka_Blazer - 15.11.2011
FIX
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == BLUE_TEAM && gTeam[playerid] == BLUE_TEAM)
{
SetPlayerMarkerForPlayer(playerid, i, COLOR_BLUE);
}
}
Cuz you only checked if "i" is in the blue team , u forget to checek if "playerid" is in the blue team too
Re: SetPlayerMarkerForPlayer -
Infamous - 15.11.2011
I do actually run a check to see if the player is on the blue team just above this code. :S
Re: SetPlayerMarkerForPlayer -
Elka_Blazer - 15.11.2011
Can you post the whole code of this parte ?
Re: SetPlayerMarkerForPlayer -
Infamous - 15.11.2011
Quote:
Originally Posted by Elka_Blazer
Can you post the whole code of this parte ?
|
pawn Код:
public OnPlayerSpawn(playerid)
{
if(gTeam[playerid] == BLUE_TEAM)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == BLUE_TEAM)
{
SetPlayerMarkerForPlayer(playerid, i, COLOR_BLUE);
}
}
}
return 1;
}
I can see the problem, it's calling for all players.. i just can't think of a way to only call one team.. it's been a long day lol.
Re: SetPlayerMarkerForPlayer -
Elka_Blazer - 15.11.2011
LOL where did u set the player in "BLUE_TEAM" ?
Re: SetPlayerMarkerForPlayer -
Infamous - 15.11.2011
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0)
{
gTeam[playerid] = RED_TEAM;
}
else if(classid == 1)
{
gTeam[playerid] = BLUE_TEAM;
}
}
Re: SetPlayerMarkerForPlayer -
Elka_Blazer - 15.11.2011
And where did u use this function ?