Jump to content

Problem Spwan vehicle


abu5lf

Recommended Posts

Posted (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 by Guest

╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗

║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║

║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║

║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║

╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝

«سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك»

M7mdAl7arthy : لتواصل سكايب

Posted
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) 

My ingame nickname : Ops!

-DeathMatch GameMode By Ops! : 5%

Posted
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 =(

╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗

║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║

║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║

║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║

╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝

«سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك»

M7mdAl7arthy : لتواصل سكايب

Posted
what are you trying to make here ?

I want to go with the vehicle I have a player spawn

╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗

║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║

║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║

║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║

╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝

«سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك»

M7mdAl7arthy : لتواصل سكايب

Posted
you want if you are in a vehicle you want to spawn your self with the vehicle ?

This is exactly I want

╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗

║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║

║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║

║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║

╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝

«سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك»

M7mdAl7arthy : لتواصل سكايب

Posted
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 
) 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted
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

╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗

║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║

║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║

║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║

╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝

«سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك»

M7mdAl7arthy : لتواصل سكايب

Posted

You set the id of the vehicle? stop just copy the code and say it does not work.

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

Well Well I no longer needed to help

╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗

║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║

║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║

║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║

╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝

«سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك»

M7mdAl7arthy : لتواصل سكايب

Posted
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) 

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