GamerDeMTA Posted June 23, 2013 Share Posted June 23, 2013 local thevehicle = getPedOccupiedVehicle ( getRootElement() ) local function ( thevehicle ) setVehicleHeadLightColor ( thevehicle, 0, 255,0 ) setVehicleColor( thevehicle, 0, 0, 255 ) end addEventHandler ( "onClientPlayerSpawn", getRootElement(), ) It says somthing about a "attempt" to call global. Link to comment
iPrestege Posted June 23, 2013 Share Posted June 23, 2013 local thevehicle = getPedOccupiedVehicle ( getRootElement() ) local function ( thevehicle ) setVehicleHeadLightColor ( thevehicle, 0, 255,0 ) setVehicleColor( thevehicle, 0, 0, 255 ) end addEventHandler ( "onClientPlayerSpawn", getRootElement(), ) It says somthing about a "attempt" to call global. function ( ) local thevehicle = getPedOccupiedVehicle ( localPlayer ) setVehicleHeadLightColor ( thevehicle, 0, 255,0 ) setVehicleColor( thevehicle, 0, 0, 255 ) end addEventHandler ( "onClientPlayerSpawn", getRootElement(), ) I'm not sure if the player will have a vehicle when he spawn . Link to comment
GamerDeMTA Posted June 23, 2013 Author Share Posted June 23, 2013 No. It says bad argument in the line 3 and 4 Link to comment
iPrestege Posted June 23, 2013 Share Posted June 23, 2013 As what i thought try with a timer : function ( ) setTimer( function ( ) local thevehicle = getPedOccupiedVehicle ( localPlayer ) setVehicleHeadLightColor ( thevehicle, 0, 255,0 ) setVehicleColor( thevehicle, 0, 0, 255 ) end,3000,1 ) end addEventHandler ( "onClientPlayerSpawn", getRootElement(), ) Link to comment
GamerDeMTA Posted June 23, 2013 Author Share Posted June 23, 2013 thanks :DDD It works. ah and u know any event or "export" for when I take a vehicle in the RACE (a vehicle pickup),? Link to comment
iPrestege Posted June 23, 2013 Share Posted June 23, 2013 You're welcome . No idea about the race . Link to comment
bandi94 Posted June 23, 2013 Share Posted June 23, 2013 thanks :DDD It works. ah and u know any event or "export" for when I take a vehicle in the RACE (a vehicle pickup),? addEvent( "onPlayerPickUpRacePickup" ) addEventHandler( "onPlayerPickUpRacePickup", g_Root, function( _, type, veh ) onPlayerPickUpRacePickup() source = player argument's = int/string pickupID, string pickupType ("nitro" "repair" "vehiclechange"), int vehicleModel Link to comment
PaiN^ Posted June 23, 2013 Share Posted June 23, 2013 "g_Root" is not defined in his script i think, he should use "getRootElement()" or "root" . Link to comment
Castillo Posted June 23, 2013 Share Posted June 23, 2013 Instead of using a timer when the player spawns, just use the 'onClientVehicleEnter' event. function ( ) setVehicleHeadLightColor ( source, 0, 255,0 ) setVehicleColor( source, 0, 0, 255 ) end addEventHandler ( "onClientVehicleEnter", getRootElement(), ) 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