Function Posted March 1, 2017 Share Posted March 1, 2017 (edited) 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 March 1, 2017 by Function Link to comment
Bananovy Posted March 1, 2017 Share Posted March 1, 2017 What about getTeamColor and setBlipColor? Normally when player is in the team his nickname is using it's color. If you want to color player's name completly into team's color, you have to remove hex codes from their nicknames Link to comment
Function Posted March 1, 2017 Author Share Posted March 1, 2017 I know how to get the team color in the name the only problem is how can I get the blip from the player? local teamcolor = getTeamColor(team) setBlipColor(?,teamcolor) Do you know what i mean bra? Link to comment
Mr.Loki Posted March 2, 2017 Share Posted March 2, 2017 When players login do they already have blips? Link to comment
Function Posted March 2, 2017 Author Share Posted March 2, 2017 Yes, even if they join I do not want to create a blip, i want to get the existing blip from the player. Such as "getPlayerBlip" even if this does not exist... Link to comment
Mr.Loki Posted March 2, 2017 Share Posted March 2, 2017 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
Function Posted March 2, 2017 Author Share Posted March 2, 2017 Only now i noticed that the script wrong, I forgot to use: "getTeamName" and "getTeamFromName" .... 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