Rougue90 Posted October 5, 2022 Share Posted October 5, 2022 hello, my idea is make a few teams, something around 10 teams. Soo, when i spawn the player in their base, i do something like addEventHandler('onPlayerSpawn', root, function() local team = getPlayerTeam(source) local players = getPlayersInTeam(team) for i,v in ipairs(players) do createBlipAttachedTo(v, 0, 2, 255, 100, 100, 255,0, 65535, players) end end) But i want it to each team, have it blip with it own color set. Need few idea to manage Link to comment
Hydra Posted October 6, 2022 Share Posted October 6, 2022 (edited) local blip local teams = { {name = "Red Team", r = 255, g = 0, b = 0}, {name = "Blue Team", r = 0, g = 0, b = 255} } function onTeam() local team = getPlayerTeam(source) if team then if getTeamName(team) == teams[1].name then for _, v in ipairs(getPlayersInTeam(team)) do blip = createBlipAttachedTo(v, 0, 2, teams[1].r, teams[1].g, teams[1].b, 255) end elseif getTeamName(team) == teams[2].name then for _, v in ipairs(getPlayersInTeam(team)) do blip = createBlipAttachedTo(v, 0, 2, teams[2].r, teams[2].g, teams[2].b, 255) end end end end addEventHandler("onPlayerSpawn", root, onTeam) Edited October 6, 2022 by Hydra Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now