I made this
local blip = { }
addEventHandler ( "onPlayerSpawn", root,
function ( )
if ( not isElement ( blip [ source ] ) ) then
blip [ source ] = createBlipAttachedTo ( source )
end
local theTeam = getPlayerTeam ( source )
if ( not theTeam ) then
return
end
local r, g, b = getTeamColor ( theTeam )
setPlayerNametagColor ( source, r, g, b )
setBlipColor ( blip [ source ], r, g, b, 255 )
end
)
addEventHandler ( "onResourceStart", resourceRoot,
function ()
for k, v in ipairs ( getElementsByType("player") ) do
if ( not isElement ( blip [ v ] ) ) then
blip [ v ] = createBlipAttachedTo ( v )
end
local theTeam = getPlayerTeam ( v )
if (not theTeam) then
return
end
local r, g, b = getTeamColor ( theTeam )
setPlayerNametagColor ( v, r, g, b )
setBlipColor ( blip [ v ], r, g, b, 255 )
end
)
addEventHandler ( "onPlayerQuit", root,
function ( )
if isElement ( blip [ source ] ) then
destroyElement ( blip [ source ] )
end
end
)
But it doesnt work for me.