Reflex# Posted April 2, 2012 Share Posted April 2, 2012 addEvent ( 'onPlayerPickUpRacePickup', true ); function zaa ( vehicle, id ) if ( getPlayerTeam ( source ) ) then if ( eventName == 'onPlayerPickUpRacePickup' and id == 'vehiclechange' or id == 'repair' or id == 'nitro' ) then local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) setVehicleColor ( vehicle, r, g, b ); else local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) setVehicleColor ( vehicle, r, g, b ) end end end addEventHandler ( 'onPlayerVehicleEnter', root, zaa ); addEventHandler ( 'onPlayerPickUpRacePickup', root, zaa ); /debugscript 3: Bad argument @ setVehicleColor Link to comment
MIKI785 Posted April 2, 2012 Share Posted April 2, 2012 'onPlayerPickUpRacePickup' doesn't provide vehicle element.. try this: addEvent ( 'onPlayerPickUpRacePickup', true ) function zaa ( id, type, model ) if ( getPlayerTeam ( source ) ) then if ( eventName == 'onPlayerPickUpRacePickup' and id == 'vehiclechange' or id == 'repair' or id == 'nitro' ) then local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ); else local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ) end end end addEventHandler ( 'onPlayerVehicleEnter', root, zaa ) addEventHandler ( 'onPlayerPickUpRacePickup', root, zaa ) Link to comment
Reflex# Posted April 2, 2012 Author Share Posted April 2, 2012 'onPlayerPickUpRacePickup' doesn't provide vehicle element..try this: addEvent ( 'onPlayerPickUpRacePickup', true ) function zaa ( id, type, model ) if ( getPlayerTeam ( source ) ) then if ( eventName == 'onPlayerPickUpRacePickup' and id == 'vehiclechange' or id == 'repair' or id == 'nitro' ) then local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ); else local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ) end end end addEventHandler ( 'onPlayerVehicleEnter', root, zaa ) addEventHandler ( 'onPlayerPickUpRacePickup', root, zaa ) But why bad argument on setVehicleColor? Link to comment
MIKI785 Posted April 2, 2012 Share Posted April 2, 2012 Because variable vehicle wasn't vehicle element? Link to comment
Reflex# Posted April 2, 2012 Author Share Posted April 2, 2012 Because variable vehicle wasn't vehicle element? my bad Edit: I must change r,g,b or it automatically change,beacuse Draken said that i must.. Link to comment
Reflex# Posted April 2, 2012 Author Share Posted April 2, 2012 Because variable vehicle wasn't vehicle element? my bad Edit: I must change r,g,b or it automatically change,beacuse Draken said that i must.. Oh forget about this,all work,thx Link to comment
drk Posted April 2, 2012 Share Posted April 2, 2012 I said because i've not seen the part of team 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