-Jigsaw Posted January 9, 2013 Share Posted January 9, 2013 So, I got a code that's supposed to set the vehicle's color to white if the source aint in a team. Problem is that sometimes when the player spawns the vehicle is a different and random color. What's wrong with it? Thank you in advance addEventHandler("onPlayerSpawn", getRootElement(), function() if isPedInVehicle(source) then local team = getPlayerTeam(source) local vehicle = getPedOccupiedVehicle(source) if team then return end setVehicleColor(vehicle, 255, 255, 255) end end ) Link to comment
Castillo Posted January 9, 2013 Share Posted January 9, 2013 You may want to set it when he enters the vehicle instead. addEventHandler ( "onVehicleEnter", getRootElement(), function ( player ) local team = getPlayerTeam ( player ) if ( not team ) then setVehicleColor ( source, 255, 255, 255 ) end end ) Link to comment
-Jigsaw Posted January 10, 2013 Author Share Posted January 10, 2013 Sorry for the late answer. The script works and I haven't metioned anything wrong after some tests. Thank you! 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