SetPlayerColor
#1

Allright, so when i set a team's color to invisible.. It still shows a random color in the chat. How do i make it so the players marker is invisible on map and the color of the player on the chat and in the player list (tab) is something else?
Basically, I am making a team which should be invisible on map but the color of the player name in player list and on chat should be grey.
Reply
#2

If you want to set the color to invisible (transparent) you need to set the alpha value to 0xRRGGBB00
See this wiki page:
https://sampwiki.blast.hk/wiki/Color_list

This will make the map marker invisible.

You should be able to format the chat messages under OnPlayerText, check if the player belongs to the invisible team and format their message to be grey.
Reply
#3

Quote:
Originally Posted by MEW273
Посмотреть сообщение
If you want to set the color to invisible (transparent) you need to set the alpha value to 0xRRGGBB00
See this wiki page:
https://sampwiki.blast.hk/wiki/Color_list

This will make the map marker invisible.

You should be able to format the chat messages under OnPlayerText, check if the player belongs to the invisible team and format their message to be grey.
All Right but how do i change that players color in the "playerlist aka tab"
Reply
#4

The tab list color should remain non-transparent/visible. Try setting the player color to this:
0xD3D3D300
It should be grey in the tab list and in chat, but transparent/invisible on the map. If you want a different color just change the hex value 0xD3D3D300 but keep the alpha value to maintain transparency/invisibility.
Reply
#5

You can learn more about them from the Wiki too.

https://sampwiki.blast.hk/wiki/Color_list
Reply
#6

Код:
public OnGameModeInit()
{
    ShowPlayerMarkers(0);
//ID	Mode
//0	PLAYER_MARKERS_MODE_OFF
//1	PLAYER_MARKERS_MODE_GLOBAL
//2	PLAYER_MARKERS_MODE_STREAMED
}
public OnPlayerConnect(playerid)
{
    SetPlayerColor(playerid,-1); // sets the player color to white.
}
Reply
#7

Quote:
Originally Posted by Uvais
Посмотреть сообщение
All Right but how do i change that players color in the "playerlist aka tab"
All you have to do is use the following format: 0xRRGGBB00. By having the '00' (alpha value) it means that will not appear in your map, but the color will be visible to the chat box (if available) and tab list through the usage of SetPlayerColor, similar to what MEW273 said.

For example, if you want 'playerid' to have a red color in the tab list, you simply do the following:

Код:
SetPlayerColor(playerid,0xAA333300);
That will make it transparent from the map but visible to the tab list.
Reply
#8

why didn't anyone suggest SetPlayerMarkerForPlayer
PHP код:
for(new 0MAX_PLAYERSi++)
{
    
SetPlayerMarkerForPlayeriplayerid, ( GetPlayerColorplayerid ) & 0xFFFFFF00 ) );
    } 
Reply
#9

Small optimization, the code should work as @RougeDrifter said.

Код:
for(new i = 0,j = GetPlayerPoolSize();i <= j;i++)
{
    SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
}
Reply
#10

Quote:
Originally Posted by Bolex_
Посмотреть сообщение
Small optimization, the code should work as @RougeDrifter said.

Код:
for(new i = 0,j = GetPlayerPoolSize();i <= j;i++)
{
    SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
}
Ah true thanks.
@OP: use the code Bolex suggested that should work perfectly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)