ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. setPlayerBlipColor

Function

setPlayerBlipColor

Server and clientBlipsTrilogy Hub only

Changes the colour of a player's map icon (red by default). On the server everyone sees it, on the client the change is local to that player.

Syntax

bool setPlayerBlipColor(player thePlayer, int r, int g, int b [, int a = 255])

Arguments

thePlayerplayer
The player.
rint
Red 0-255. On the client nil restores the server colour.
gint
Green 0-255.
bint
Blue 0-255.
aint, optional = 255
Opacity 0-255.

Returns

true on success.

Example

addEventHandler("onPlayerSpawn", root, function()
    local team = getPlayerTeam(source)
    if team then
        local r, g, b = getTeamColor(team)
        setPlayerBlipColor(source, r, g, b)
    end
end)

See also