senddeathmessage force colour
#1

Hi,

I use in

- OnGameModeInit ShowPlayerMarkers(1);
- OnPlayerDeath SendDeathMessage(killerid,playerid,reason);
- OnPlayerSpawn SetPlayerColor

So if a player death the team color player is show. Now I create a command for to be invisible for a team ( SetPlayerColor(playerid, 0xFFFFFF00) but if a player/team kill we see the name in white. I would want that the player/team have the team colour shown when they kills/die while they are invisible.

Thanks.
Reply
#2

If you use foreach (highly recommended):
pawn Код:
foreach(new i : Player) SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid) & 0xFFFFFFFF));
If you don't use foreach:
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++) SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid) & 0xFFFFFFFF));
playerid is the player who's blip will become invisible.
i is the player to show an invisible blip to.

That will retain the color.
Reply
#3

thanks I saw that, but I want to be invible for 1 team against 1 other team it's not only playerid
Reply
#4

pawn Код:
foreach(new i : Player)
{
    if(GetPlayerTeam(i) != GetPlayerTeam(playerid)) // If they are not on the same team
    {
        SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid) & 0xFFFFFFFF));
    }
}
Reply
#5

Thanks. For playerid ( cmds...) It's ok but for reset the invisible mod after a timer/kill I need to use it:

Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
	if(IsPlayerConnected(i))
	{
			    if(gTeam[i] == Zone[ zone ][ZoneOwner])
		    	    {
					for(new a = 0; a < MAX_PLAYERS; a++)
					{
						if(IsPlayerConnected(a))
						{
					   		SetPlayerMarkerForPlayer(a, i, GetPlayerColor(i));
					        }
					}
		    	   }
		    	   if(gTeam[i] == attacker)
		    	   {
					for(new a = 0; a < MAX_PLAYERS; a++)
					{
						if(IsPlayerConnected(a))
						{
					   		SetPlayerMarkerForPlayer(a, i, GetPlayerColor(i));
					        }
					}
                           }
       }
}
There are not optimal code?
Reply
#6

Actually I'm having doubts about that. SetPlayerMarkerForPlayer just changes the radar blip, right? So why not just set it to 0xFFFFFF00? It'll be transparent right? SetPlayerColor isn't used so their color should still be the same right? I've said right too many times in this post, right?
I'll test it tomorrow.
Reply
#7

Quote:
Originally Posted by MP2
Посмотреть сообщение
Actually I'm having doubts about that. SetPlayerMarkerForPlayer just changes the radar blip, right? So why not just set it to 0xFFFFFF00? It'll be transparent right? SetPlayerColor isn't used so their color should still be the same right? I've said right too many times in this post, right?
I'll test it tomorrow.
right.
Reply
#8

yes 0xFFFFFFFF don't work 0xFFFFFF00 its correct.

So I test it:

Код:
if(strcmp(cmd, "/test", true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
	if(IsPlayerConnected(i))
	{
			    if(gTeam[i] == Zone[ zone ][ZoneOwner])
		    	    {
					for(new a = 0; a < MAX_PLAYERS; a++)
					{
						if(IsPlayerConnected(a))
						{
					   		SetPlayerMarkerForPlayer(a, i, (GetPlayerColor(i) & 0xFFFFFF00));
					        }
					}
		    	   }
		    	   if(gTeam[i] == attacker)
		    	   {
					for(new a = 0; a < MAX_PLAYERS; a++)
					{
						if(IsPlayerConnected(a))
						{
					   		SetPlayerMarkerForPlayer(a, i, (GetPlayerColor(i) & 0xFFFFFF00));
					        }
					}
                           }
       }
}
}
this command works I don't see the player on the map after /test but after I kill him we are visible ( map icon ) if he finds me/close to me. WTF?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)