Jump to content

Problem with an event


Hero192

Recommended Posts

Vehicles are created via using createVehicle. You would need to create this event yourself, for example you can do it like this;

function ExampleCode() 
    local theVehicle = createVehicle(...) 
    if(theVehicle) then 
        triggerEvent("onPlayerSpawnVehicle", root, argument1, argument2) -- You can pass for example the player that spawned it, the vehicle id and so on. 
    end 
end 
  
function onPlayerSpawnVehicle_Handler(arg1, arg2) 
    -- Code to be executed when a vehicle is spawned 
end 
addEvent("onPlayerSpawnVehicle", true) 
addEventHandler("onPlayerSpawnVehicle", root, onPlayerSpawnVehicle_Handler) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...