Jump to content

NAME AND BLIP IN TEAMCOLOR?


Function

Recommended Posts

addEventHandler("onPlayerQuit",getRootElement(),
function()
local team = getPlayerTeam(source)
local account = getPlayerAccount(source)
if (account) then setAccountData(source,"playerteam",team)
end
end)

addEventHandler("onPlayerLogin",getRootElement(),
function()
local team = getAccountData(account,"playerteam")
local account = getPlayerAccount(source)
if (team) then setPlayerTeam(source,team)
end
end)

addEventHandler("onPlayerLogout",getRootElement(),
function()
setPlayerTeam(source,nil)
end)

Please can anyone tell me how I can set the name and blip color in team color?

Edited by Function
Link to comment

Add this to your login event

local elements = getAttachedElements(source) -- get all elements attached to the player who just logged in

for _,blip in pairs(elements)do -- loop through every element
  if getElementType(blip)=="blip" then -- checks if the element is a blip
    setBlipColor(blip, teamcolor) -- sets the blip's color
  end
end

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...