abu5lf Posted April 5, 2012 Posted April 5, 2012 (edited) function (theVehicle) local model = getElementModel(player) if (getVehicleType(theVehicle) == "player") then spawnPlayer ( player, 1762.1877441406, 815.47033691406, 10.41355895996914, 0, model, 0, 0 ) outputChatBox("* Successfully spawn ", player, 0, 255, 0) end end I want to go with the vehicle I have a player spawn Edited December 25, 2012 by Guest
X-SHADOW Posted April 5, 2012 Posted April 5, 2012 addEventHandler( 'onResourceStart', root, function( Kenix) if getElementType( Kenix ) == 'player' and isPedInVehicle( Kenix ) then spawnPlayer ( Kenix, 1762.1877441406, 815.47033691406, 10.41355895996914 ) outputChatBox("* Successfully spawn ", source, 0, 255, 0) end end)
abu5lf Posted April 5, 2012 Author Posted April 5, 2012 addEventHandler( 'onResourceStart', root, function( Kenix) if getElementType( Kenix ) == 'player' and isPedInVehicle( Kenix ) then spawnPlayer ( Kenix, 1762.1877441406, 815.47033691406, 10.41355895996914 ) outputChatBox("* Successfully spawn ", source, 0, 255, 0) end end) not work =(
abu5lf Posted April 5, 2012 Author Posted April 5, 2012 what are you trying to make here ? I want to go with the vehicle I have a player spawn
X-SHADOW Posted April 5, 2012 Posted April 5, 2012 you want if you are in a vehicle you want to spawn your self with the vehicle ?
abu5lf Posted April 5, 2012 Author Posted April 5, 2012 you want if you are in a vehicle you want to spawn your self with the vehicle ? This is exactly I want
DNL291 Posted April 5, 2012 Posted April 5, 2012 addEventHandler( "onPlayerJoin", root, function () x = 1762.18774 y = 815.470336 z = 10.4135589 local _vehicle = createVehicle(id, x, y, z) spawnPlayer(source, x, y, z) setElementModel(source, math.random(0,312)) warpPedIntoVehicle(source, _vehicle) setCameraTarget( source, source ) outputChatBox("* Successfully spawn ", source, 0, 255, 0) end )
abu5lf Posted April 5, 2012 Author Posted April 5, 2012 addEventHandler( "onPlayerJoin", root, function () x = 1762.18774 y = 815.470336 z = 10.4135589 local _vehicle = createVehicle(id, x, y, z) spawnPlayer(source, x, y, z) setElementModel(source, math.random(0,312)) warpPedIntoVehicle(source, _vehicle) setCameraTarget( source, source ) outputChatBox("* Successfully spawn ", source, 0, 255, 0) end ) not work
DNL291 Posted April 5, 2012 Posted April 5, 2012 You set the id of the vehicle? stop just copy the code and say it does not work.
CapY Posted April 5, 2012 Posted April 5, 2012 stop just copy the code and say it does not work. Don't be an lazy ass and provide an debug, you haven't specified vehicle id here: vehicle = 411 -- Infernus local _vehicle = createVehicle(vehicle, x, y, z)
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