Jump to content

Creating Vehicle on server side


Recommended Posts

Hi, i have my script :

local modele = {
    [1] = {dff="pojazdy/samochody/bugattiveyron.dff",txd="pojazdy/samochody/bugattiveyron.txd"};
}

for v,c in ipairs(modele) do
    local requestid = engineRequestModel("vehicle")
    txd = engineLoadTXD(c.txd)
    engineImportTXD(txd, requestid)
    dff = engineLoadDFF(c.dff)
    engineReplaceModel(dff, requestid)
    triggerServerEvent("stworzAuto",root,requestid,1364.53418, -1040.15503, 26.14062)
end

and im trying to spawn vehicle on server side

 

function stworzAuto(id,x,y,z)
	createVehicle(id,x,y,z)
	print("b")
end

addEvent("stworzAuto",true)
addEventHandler("stworzAuto",root,stworzAuto)

 

 

I want create vehicle with custom id on server side, please help me

Link to post
  • Moderators

Hi. Your thread has been moved to Scripting section,

However, currently this is not possible, you can't create server-sided vehicle with freshly requested ID.

Link to post
13 hours ago, Patrick said:

Hi. Your thread has been moved to Scripting section,

However, currently this is not possible, you can't create server-sided vehicle with freshly requested ID.

But i can't enter to this vehicle

Link to post
16 hours ago, Kezoto said:

i can't enter to this vehicle

U cant enter to vehicle only if vehicle is created on client side

or you have event onVehicleEnter with cancelEvent()

Link to post

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