Team player marker
#1

Hi,
I have 2 teams and I want to show Player marker only for players in team.

In OnPlayerSpawn I have this code for show and hide player markers

Код:
	for(new i=0;i<MAX_PLAYERS;i++){
		if(IsPlayerConnected(i)){
		    if(Player[i][Team]==Player[playerid][Team]){
		    	if(Player[playerid][Team]==1){ SetPlayerMarkerForPlayer(playerid,i,T1); SetPlayerMarkerForPlayer(i,playerid,T1); }
		    	if(Player[playerid][Team]==2){ SetPlayerMarkerForPlayer(playerid,i,T2); SetPlayerMarkerForPlayer(i,playerid,T2); }
			}else{
		    	if(Player[playerid][Team]==1){ SetPlayerMarkerForPlayer(playerid,i,T2I); SetPlayerMarkerForPlayer(i,playerid,T1I); }
		    	if(Player[playerid][Team]==2){ SetPlayerMarkerForPlayer(playerid,i,T1I); SetPlayerMarkerForPlayer(i,playerid,T2I); }
			}
		}
	}
Color definition is :
#define T1 0x38FF06FF
#define T1I 0x38FF0600
#define T2 0xFFFF00FF
#define T2I 0xFFFF0000


My code don't work correct know why.

Sorry for english.
Reply
#2

Quote:
Originally Posted by straco
Посмотреть сообщение
Hi,
I have 2 teams and I want to show Player marker only for players in team.

In OnPlayerSpawn I have this code for show and hide player markers

Код:
	for(new i=0;i<MAX_PLAYERS;i++){
		if(IsPlayerConnected(i)){
		    if(Player[i][Team]==Player[playerid][Team]){
		    	if(Player[playerid][Team]==1){ SetPlayerMarkerForPlayer(playerid,i,T1); SetPlayerMarkerForPlayer(i,playerid,T1); }
		    	if(Player[playerid][Team]==2){ SetPlayerMarkerForPlayer(playerid,i,T2); SetPlayerMarkerForPlayer(i,playerid,T2); }
			}else{
		    	if(Player[playerid][Team]==1){ SetPlayerMarkerForPlayer(playerid,i,T2I); SetPlayerMarkerForPlayer(i,playerid,T1I); }
		    	if(Player[playerid][Team]==2){ SetPlayerMarkerForPlayer(playerid,i,T1I); SetPlayerMarkerForPlayer(i,playerid,T2I); }
			}
		}
	}
Color definition is :
#define T1 0x38FF06FF
#define T1I 0x38FF0600
#define T2 0xFFFF00FF
#define T2I 0xFFFF0000


My code don't work correct know why.

Sorry for english.
You said you got 2 teams, why you got 2 for 1 team, and 2 for other team??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)