SA-MP Forums Archive
SetPlayerColor - 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: SetPlayerColor (/showthread.php?tid=647216)



SetPlayerColor - Uvais - 01.01.2018

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.


Re: SetPlayerColor - MEW273 - 01.01.2018

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.


Re: SetPlayerColor - Uvais - 01.01.2018

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"


Re: SetPlayerColor - MEW273 - 01.01.2018

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.


Re: SetPlayerColor - Logic_ - 01.01.2018

You can learn more about them from the Wiki too.

https://sampwiki.blast.hk/wiki/Color_list


Re: SetPlayerColor - jasperschellekens - 01.01.2018

Код:
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.
}



Re: SetPlayerColor - Beckett - 01.01.2018

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.


Re: SetPlayerColor - RogueDrifter - 01.01.2018

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



Re: SetPlayerColor - Bolex_ - 01.01.2018

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

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



Re: SetPlayerColor - RogueDrifter - 01.01.2018

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.