Okay, I get it now. Well then looks like the best now you can do is to make a small "check" if player has his color already. I did it by using setElementData/getElementData:
function setRandomColor()
for _,player in ipairs(getElementsByType("player")) do
for _,blip in ipairs(getElementsByType("blip")) do
local team = getPlayerTeam(player)
local r,g,b = math.random(255),math.random(255),math.random(255)
if not (team) then
local gotHisColor = getElementData(player, "gotRandomColor") or false
if gotHisColor == false then
setPlayerNametagColor(player,r,g,b)
setBlipColor(blip,r,g,b,255)
setElementData(player, "gotRandomColor", true)
end
end
end
end
end
setTimer(setRandomColor,50,0)