Jokeℝ1472771893 Posted July 21, 2012 Share Posted July 21, 2012 Server Side local vehicles = { } addEvent ( "spawnvehicle", true ) addEventHandler ( "spawnvehicle", root, function ( vehID ) if ( isElement ( vehicles [ source ] ) ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( vehID, 2168.0910644531, -2275.087890625, 13.5,0,0,220 ) if ( vehicles [ source ] ) then end setTimer ( warpPedIntoVehicle, 200, 1, source, vehicles [ source ] ) triggerClientEvent ( source, "closeWindow", root ) end) when I spawn a car always it spawn 2 of them . Link to comment
unknooooown Posted July 21, 2012 Share Posted July 21, 2012 Check for any mistakes where you trigger the "spawnvehicle" event. If there are no mistakes there, then try checking your meta file and see if you added it twice by accident. Link to comment
Jaysds1 Posted July 21, 2012 Share Posted July 21, 2012 try this: local vehicles = { } addEvent ( "spawnvehicle", true ) addEventHandler ( "spawnvehicle", root,function ( vehID ) if ( isElement ( vehicles [ source ] ) ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( vehID, 2168.0910644531, -2275.087890625, 13.5,0,0,220 ) if ( vehicles [ source ] ) then --Don't leave if statements blank setTimer ( warpPedIntoVehicle, 200, 1, source, vehicles [ source ] ) triggerClientEvent ( source, "closeWindow", root ) end end) 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