ZeyadGTX Posted October 17, 2014 Share Posted October 17, 2014 Hello Guys Can you help me with this small script This script Makes you get the teamcolor and blip when you chat But the problem is if the player is not in team his blip is RED !! all the players Blips are red except Team players local blip = { } addEventHandler ( "onPlayerChat", 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 ( "onPlayerQuit", root, function ( ) if isElement ( blip [ source ] ) then destroyElement ( blip [ source ] ) end end ) Link to comment
Anubhav Posted October 17, 2014 Share Posted October 17, 2014 local blip = { } addEventHandler ( "onPlayerChat", 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 ) or 255, 255, 255 setPlayerNametagColor ( source, r, g, b ) setBlipColor ( blip [ source ], r, g, b, 255 ) end ) addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( blip [ source ] ) then destroyElement ( blip [ source ] ) end end ) Link to comment
ZeyadGTX Posted October 17, 2014 Author Share Posted October 17, 2014 Actually the Blip still Red ! , I have Just 1 Team i would like the player gets the Color of the team on his Blips and Nametag Link to comment
Anubhav Posted October 17, 2014 Share Posted October 17, 2014 local blip = { } addEventHandler ( "onPlayerChat", root, function ( ) if ( not isElement ( blip [ source ] ) ) then blip [ source ] = createBlipAttachedTo ( source ) end local theTeam = getPlayerTeam ( source ) if theTeam then local r, g, b = getTeamColor ( theTeam ) setPlayerNametagColor ( source, r, g, b ) setBlipColor ( blip [ source ], r, g, b, 255 ) else local r, g, b = 255, 255, 255 setPlayerNametagColor ( source, r, g, b ) setBlipColor ( blip [ source ], r, g, b, 255 ) end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( blip [ source ] ) then destroyElement ( blip [ source ] ) end end ) Link to comment
ZeyadGTX Posted October 17, 2014 Author Share Posted October 17, 2014 100 % works but i would like to ask can the player blip be the same as his name ? Link to comment
Anubhav Posted October 17, 2014 Share Posted October 17, 2014 No. You must make it yourself, I never tried that. Link to comment
ZeyadGTX Posted October 17, 2014 Author Share Posted October 17, 2014 I just wanna the player takes the teamcolor and Blip color of the Team but why it changes all players blips ! now it's white i can simply change them to another colors but isn't there way to make it According the player color ? 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