Skip to content

Player Blips

StyledStrike edited this page Sep 3, 2023 · 6 revisions

GMinimap automatically handles blips for players. You can fine tune the blips (or if they should be visible at all) with the following functions.

client GMinimap:SetOnlySameTeamBlips

GMinimap:SetOnlySameTeamBlips(sameTeamOnly: boolean)

Use this to set if the local player can only see players from the same team on the minimap.

client GMinimap:SetCanSeePlayerBlips

GMinimap:SetCanSeePlayerBlips(canSee: boolean)

Use this to set if the local player can see all players on the minimap. Overrides GMinimap:SetOnlySameTeamBlips.

Example

On a server with ULX Buildmode, don't let PvP players see other players.

timer.Create( "Example.HidePlayerBlips", 1, 0, function()
    -- periodically check in ULX Buildmode's NWBool value
    local isInBuild = LocalPlayer():GetNWBool( "_Kyle_Buildmode" )

    -- only let the local player see others while in build mode
    GMinimap:SetCanSeePlayerBlips( isInBuild )
end )

client Player:SetBlipIcon

Player:SetBlipIcon(icon?: string)

Set the icon path for a player's blip. Can be either a URL or a image file on the materials folder. Use nil to restore the default icon.

Note: "Dead" and "in a vehicle" icons overrides this.

Example

for _, ply in ipairs( player.GetAll() ) do
    if ply == LocalPlayer() then
        -- make the local player use a tank icon
        ply:SetBlipIcon( "gminimap/blips/tank.png" )
    else
        -- make other players use a cat icon from the web
        ply:SetBlipIcon( "https://cdn3.emoji.gg/emojis/2319-astonished-cat.png" )
        ply:SetBlipScale( 2 )
    end
end

client Player:SetBlipScale

Player:SetBlipScale(scale?: number)

Set the icon scale for a player's blip. Use nil to restore to default.

Note: "Dead" and "in a vehicle" icons overrides this.

client Player:SetBlipColor

Player:SetBlipColor(color?: Color)

Set the icon color for a player's blip. Use nil to restore to default.

Note: "Dead" and "in a vehicle" icons overrides this.

Clone this wiki locally