How to hide all Player markers and name tags from a team? -
DaneAMattie - 15.05.2010
Title sais so
and i want something like a command so u can make them visible or hide again.
Thanks,
ikbenhet
Re: How to hide all Player markers and name tags from a team? -
DJ-CJ89 - 15.05.2010
First Step: Put this on Script Header; #define invisible 0xFFFFFF00
Thats easy
I use the same function in my gamemode
its selfmade
example code! you have to edit your team variables.
//under OnPlayerUpdate
Код:
for(new i=0; i<MAXPLAYERS; i++)
{
if(gTeam[playerid] == your_Team_no1_here)
{
SetPlayerMarkerForPlayer(playerid, i, GetPlayerColor(playerid) & invisible);
}
else if(gTeam[playerid] == your_Team_no2_here)
{
SetPlayerMarkerForPlayer(playerid, i, GetPlayerColor(playerid) & invisible);
}
}
I can explain it that way:
SetPlayerMarkerForPlayer(playerid,i, ThePlayerColorForChatBox & ThePlayersMapColor);
To add a command to switch this function on/off u can simply use a variable.
Re: How to hide all Player markers and name tags from a team? -
DaneAMattie - 15.05.2010
Quote:
Originally Posted by DJ-CJ89
First Step: Put this on Script Header; #define invisible 0xFFFFFF00
Thats easy
I use the same function in my gamemode
its selfmade
example code! you have to edit your team variables.
//under OnPlayerUpdate
Код:
for(new i=0; i<MAXPLAYERS; i++)
{
if(gTeam[playerid] == your_Team_no1_here)
{
SetPlayerMarkerForPlayer(playerid, i, GetPlayerColor(playerid) & invisible);
}
else if(gTeam[playerid] == your_Team_no2_here)
{
SetPlayerMarkerForPlayer(playerid, i, GetPlayerColor(playerid) & invisible);
}
}
I can explain it that way:
SetPlayerMarkerForPlayer(playerid,i, ThePlayerColorForChatBox & ThePlayersMapColor);
To add a command to switch this function on/off u can simply use a variable.
|
Thanks i will try it
Re: How to hide all Player markers and name tags from a team? -
DaneAMattie - 15.05.2010
Quote:
Originally Posted by DJ-CJ89
First Step: Put this on Script Header; #define invisible 0xFFFFFF00
Thats easy
I use the same function in my gamemode
its selfmade
example code! you have to edit your team variables.
//under OnPlayerUpdate
Код:
for(new i=0; i<MAXPLAYERS; i++)
{
if(gTeam[playerid] == your_Team_no1_here)
{
SetPlayerMarkerForPlayer(playerid, i, GetPlayerColor(playerid) & invisible);
}
else if(gTeam[playerid] == your_Team_no2_here)
{
SetPlayerMarkerForPlayer(playerid, i, GetPlayerColor(playerid) & invisible);
}
}
I can explain it that way:
SetPlayerMarkerForPlayer(playerid,i, ThePlayerColorForChatBox & ThePlayersMapColor);
To add a command to switch this function on/off u can simply use a variable.
|
LoL i tried it, but now are all players and vehicles invisible and in TAB (score list) the team color is the same as mine now :/
(i tested it with some friends) and if they are on the ennemy team, (witch is color reD) for them im also red on their score list, and when im green team they are green for me)
Re: How to hide all Player markers and name tags from a team? -
Zh3r0 - 15.05.2010
Quote:
Originally Posted by ikbenhet
Quote:
Originally Posted by DJ-CJ89
First Step: Put this on Script Header; #define invisible 0xFFFFFF00
Thats easy
I use the same function in my gamemode
its selfmade
example code! you have to edit your team variables.
//under OnPlayerUpdate
Код:
for(new i=0; i<MAXPLAYERS; i++)
{
if(gTeam[playerid] == your_Team_no1_here)
{
SetPlayerMarkerForPlayer(playerid, i, GetPlayerColor(playerid) & invisible);
}
else if(gTeam[playerid] == your_Team_no2_here)
{
SetPlayerMarkerForPlayer(playerid, i, GetPlayerColor(playerid) & invisible);
}
}
I can explain it that way:
SetPlayerMarkerForPlayer(playerid,i, ThePlayerColorForChatBox & ThePlayersMapColor);
To add a command to switch this function on/off u can simply use a variable.
|
LoL i tried it, but now are all players and vehicles invisible and in TAB (score list) the team color is the same as mine now :/
(i tested it with some friends) and if they are on the ennemy team, (witch is color reD) for them im also red on their score list, and when im green team they are green for me)
|
Visible on scoreboard, invisible on map...
Re: How to hide all Player markers and name tags from a team? -
DaneAMattie - 15.05.2010
Visible on scoreboard, invisible on map...
[/quote]
yes but on the score board the colors are getting weird (like the ennemy team is the same as mine team) and just the players are invisible in the world
Re: How to hide all Player markers and name tags from a team? -
Zh3r0 - 15.05.2010
Quote:
Originally Posted by ikbenhet
Visible on scoreboard, invisible on map...
|
yes but on the score board the colors are getting weird (like the ennemy team is the same as mine team) and just the players are invisible in the world
[/quote]
Then get the enemy colors and set them after you set them invisible.
Maybe?
Re: How to hide all Player markers and name tags from a team? -
DaneAMattie - 15.05.2010
Quote:
Originally Posted by PlayON
Quote:
Originally Posted by ikbenhet
Visible on scoreboard, invisible on map...
|
yes but on the score board the colors are getting weird (like the ennemy team is the same as mine team) and just the players are invisible in the world
|
Then get the enemy colors and set them after you set them invisible.
Maybe?
[/quote]
sure but the players are invisible too :S just on the map, i cant see them walking
Re: How to hide all Player markers and name tags from a team? -
DaneAMattie - 15.05.2010
Anyone another idea??
Re: How to hide all Player markers and name tags from a team? -
juice.j - 15.05.2010
You definitely don't want to go for using OnPlayerUpdate for that...
If you want to make it as an command, here's a brief instruction how:
E.g. something like:
/hidetag playerid/playername 0/1
-> user for playerid
-> val for true (hide), false (show)
Код:
#define invisible 0xFFFFFF00 // on top of the script
Parts of your command code:
Код:
if(val){
switch(gTeam[user]){
case TEAM_NO1:{
for(new i;i<MAX_PLAYERS;i++)
SetPlayerMarkerForPlayer(i, user, COLOR_TEAM_1);
}
case TEAM_NO2:{
for(new i;i<MAX_PLAYERS;i++)
SetPlayerMarkerForPlayer(i, user, COLOR_TEAM_2);
}
}
} else {
for(new i;i<MAX_PLAYERS;i++)
SetPlayerMarkerForPlayer(i, user, COLOR_INV);
}
Adjust COLOR_TEAM_X and TEAM_NO1 as you please.