Jump to content

help


Laffu

Recommended Posts

addEvent("spawnBike", true) 
addEventHandler("spawnBike", root, 
function () 
        local x,y,z = getElementPosition( source ) 
        createVehicle ( 509, x, y, z ) 
end 
) 
  
addEvent("spawnBmx", true) 
addEventHandler("spawnBmx", root, 
function () 
        local x,y,z = getElementPosition( source ) 
        createVehicle ( 481, x, y, z ) 
end 
) 

I want when the player withdraw a vehicle, he enters inside the vehicle,automatically.

Link to comment
Guest Guest4401
I want when the player withdraw a vehicle, he enters inside the vehicle,automatically.
addEvent("spawnBike", true) 
addEventHandler("spawnBike", root, 
function () 
        local x,y,z = getElementPosition( source ) 
        local vehicle = createVehicle ( 509, x, y, z ) 
        warpPedIntoVehicle(source, vehicle) 
end 
) 
  
addEvent("spawnBmx", true) 
addEventHandler("spawnBmx", root, 
function () 
        local x,y,z = getElementPosition( source ) 
        local vehicle = createVehicle ( 481, x, y, z ) 
        warpPedIntoVehicle(source, vehicle) 
end 
) 

Link to comment

You could just have one event for all your vehicles, just triggering a vehicle model.

addEvent ( "spawnVehicle", true ) 
addEventHandler ( "spawnVehicle", root, 
    function ( model ) 
        local x,y,z = getElementPosition ( source ) 
        local vehicle = createVehicle ( tonumber ( model ), x, y, z ) 
        if ( vehicle ) then 
            warpPedIntoVehicle ( source, vehicle ) 
        end 
    end 
) 

For the bike:

triggerServerEvent ( "spawnVehicle", localPlayer, 509 ) 

For the BMX:

triggerServerEvent ( "spawnVehicle", localPlayer, 481 ) 

Link to comment
You could just have one event for all your vehicles, just triggering a vehicle model.
addEvent ( "spawnVehicle", true ) 
addEventHandler ( "spawnVehicle", root, 
    function ( model ) 
        local x,y,z = getElementPosition ( source ) 
        local vehicle = createVehicle ( tonumber ( model ), x, y, z ) 
        if ( vehicle ) then 
            warpPedIntoVehicle ( source, vehicle ) 
        end 
    end 
) 

For the bike:

triggerServerEvent ( "spawnVehicle", localPlayer, 509 ) 

For the BMX:

triggerServerEvent ( "spawnVehicle", localPlayer, 481 ) 

God i like organized Posts :D

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...