Jump to content

Problem Spwan vehicle


abu5lf

Recommended Posts

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 by Guest
Link to comment
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
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
  • Moderators
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
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

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