abu5lf Posted April 5, 2012 Share 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 Link to comment
X-SHADOW Posted April 5, 2012 Share 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) Link to comment
abu5lf Posted April 5, 2012 Author Share 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 =( Link to comment
X-SHADOW Posted April 5, 2012 Share Posted April 5, 2012 what are you trying to make here ? Link to comment
abu5lf Posted April 5, 2012 Author Share Posted April 5, 2012 what are you trying to make here ? I want to go with the vehicle I have a player spawn Link to comment
X-SHADOW Posted April 5, 2012 Share Posted April 5, 2012 you want if you are in a vehicle you want to spawn your self with the vehicle ? Link to comment
abu5lf Posted April 5, 2012 Author Share 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 Link to comment
X-SHADOW Posted April 5, 2012 Share Posted April 5, 2012 and can you show your full code please ? Link to comment
DNL291 Posted April 5, 2012 Share 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 ) Link to comment
abu5lf Posted April 5, 2012 Author Share 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 Link to comment
DNL291 Posted April 5, 2012 Share Posted April 5, 2012 You set the id of the vehicle? stop just copy the code and say it does not work. Link to comment
abu5lf Posted April 5, 2012 Author Share Posted April 5, 2012 Well Well I no longer needed to help Link to comment
X-SHADOW Posted April 5, 2012 Share Posted April 5, 2012 make sure its ServerSide in meta.xml Link to comment
CapY Posted April 5, 2012 Share 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) 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