JR10 Posted October 5, 2011 Share Posted October 5, 2011 Then tell me, how do you expect that there will be any teamVehicles? Do you mean vehicles with specified model? Or vehicles that a member of the team enters? Link to comment
Spyke25 Posted October 5, 2011 Author Share Posted October 5, 2011 I want yellow car only when you join the team, other member have random car color.. Then, i join GYG team, i have yellow car, i am not in, i have random car color. Link to comment
Castillo Posted October 5, 2011 Share Posted October 5, 2011 Could you post your teamVehicles TABLE? Link to comment
JR10 Posted October 5, 2011 Share Posted October 5, 2011 He doesn't have one. I want yellow car only when you join the team, other member have random car color..Then, i join GYG team, i have yellow car, i am not in, i have random car color. Where is that 'car'. The car he enters? A car defined somewhere? Link to comment
Spyke25 Posted October 5, 2011 Author Share Posted October 5, 2011 Ye the cars you used in race game mode, yellow car in spawn point and when you change the vehicle with pickups. Link to comment
JR10 Posted October 5, 2011 Share Posted October 5, 2011 addEventHandler ( "onVehicleStartEnter" , root , function ( player ) local team = getPlayerTeam ( player ) if not team then return end local r, g, b = getTeamColor ( team ) setVehicleColor ( source , r, g, b , r, g, b) end) Try that. Link to comment
Spyke25 Posted October 6, 2011 Author Share Posted October 6, 2011 Then, like that? local teamGyg = createTeam ( "~GYG~", 255, 255, 0 ) addEventHandler ( "onVehicleStartEnter" , root , function ( player ) local team = getPlayerTeam ( player ) if not team then return end local r, g, b = getTeamColor ( team ) setVehicleColor ( source , 255, 255, 0 , 255, 255, 0) end) If is like that, when i join the team my car color doesn't change. I have replaced your r , g , b with 255 , 0 , 0 is that right? Thanks. Link to comment
JR10 Posted October 6, 2011 Share Posted October 6, 2011 local teamGyg = createTeam ( "~GYG~", 255, 255, 0 ) function setColors() for index , player in ipairs ( getElementsByType ( "player" ) ) do if getPlayerTeam ( player ) then local r,g,b = getTeamColor ( getPlayerTeam ( player ) ) local veh = getPedOccupiedVehicle ( player ) if veh then setVehicleColor ( veh, r,g,b,r,g,b) end end end end setTimer( setColors, 500, 0 ) Link to comment
Spyke25 Posted October 6, 2011 Author Share Posted October 6, 2011 It finally works! thanks so much =) Link to comment
Spyke25 Posted October 7, 2011 Author Share Posted October 7, 2011 =) Anyway, If you have time to post it, you can post the script for enable an vehicle lights color too? ( At the team ) So, yellow car and yellow lights Thanks Link to comment
JR10 Posted October 7, 2011 Share Posted October 7, 2011 local teamGyg = createTeam ( "~GYG~", 255, 255, 0 ) function setColors() for index , player in ipairs ( getElementsByType ( "player" ) ) do if getPlayerTeam ( player ) then local r,g,b = getTeamColor ( getPlayerTeam ( player ) ) local veh = getPedOccupiedVehicle ( player ) if veh then setVehicleColor ( veh, r,g,b,r,g,b) setVehicleHeadLightColor ( veh , r,g,b ) end end end end setTimer( setColors, 500, 0 ) Link to comment
Spyke25 Posted October 7, 2011 Author Share Posted October 7, 2011 It works! Thanks again! =D Link to comment
Spyke25 Posted October 7, 2011 Author Share Posted October 7, 2011 You can help me with that too? viewtopic.php?f=91&t=36353 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