Jump to content
Mr. Green Gaming

custom vehicles bug


Borz

Recommended Posts

Posted

addEventHandler('onClientResourceStart', resourceRoot,

function()

txd = engineLoadTXD ( "copcarvg.txd" )

engineImportTXD ( txd, 402 )

dff = engineLoadDFF ( "copcarvg.dff", 411 )

engineReplaceModel ( dff, 598 )

end

)

Guest AleksCore
Posted (edited)

402 and 598 and 411.. It is vehicle IDs. It must be or 402 or 598 or 411 everywhere.

 

If you want to replace infernus (411 id):

local vehicleID = 411addEventHandler('onClientResourceStart', resourceRoot,function()txd = engineLoadTXD ( "copcarvg.txd" )engineImportTXD ( txd, vehicleID )       dff = engineLoadDFF ( "copcarvg.dff", vehicleID )        engineReplaceModel ( dff, vehicleID )end)
Edited by AleksCore
Guest AleksCore
Posted (edited)

Try this. I've just made this script. It must works, thought.

addEventHandler('onClientResourceStart', resourceRoot,function()local vehicles = getElementsByType("vehicle")   for key, vehicle in ipairs(vehicles) do     if getElementType( getVehicleOccupant(vehicle) ) == "player" then     else     setElementCollisionsEnabled(vehicle, true)     end   endend)
Edited by AleksCore
Posted

 

Try this. I've just made this script. It must works, thought.

addEventHandler('onClientResourceStart', resourceRoot,function()local vehicles = getElementsByType("vehicle")   for key, vehicle in ipairs(vehicles) do     if getElementType( getVehicleOccupant(vehicle) ) == "player" then     else     setElementCollisionsEnabled(vehicle, true)     end   endend)

didnt work

Guest AleksCore
Posted (edited)

I know right. Wait. Let me fix it.

 

For some reason setElementCollisionsEnabled don't work for vehicles created by map editor.

Edited by AleksCore
Guest AleksCore
Posted (edited)

You must to create vehicles using script, not map editor. I don't want to explain how to do it right now.

 

In few words:

addEventHandler('onClientResourceStart', resourceRoot,function()cop = createVehicle(vehID, x, y, z, rx, ry, rz)setElementCollisionsEnabled(cop, true)end)
Edited by AleksCore

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...