Jump to content

Vehicle problems in freeroam server with hedit.


blurryshadow1

Recommended Posts

well, i got this vehicle respawner from the mta resources website ( https://community.multitheftauto.com/index.php?p= ... ils&id=699 ) and im running a freeroam server, so when a player creates a vehicle and then the vehicle they created blows up. The vehicle they just created respawns at the creation point.

How would i make it so when they create a vehicle and it blows up the vehicle gets removed.

Also, whenever a player modifies the handling of a pre spawned vehicle on the map and then it explodes the vehicle stays exactly the same way the player left it last.

How do i make it so the modded handling line of the vehicle doesnt still save even after the vehicle has exploded?

i want it so the handling line goes back to default right after the vehicle has exploded but i honestly have no idea how to do this.

Link to comment

Use getOriginalHandling and setVehicleHandling.

This is NOT a handling editor issue and therefore the resource will not be modified to suit this need. Please post any problems with handling editor on the official topic, which you can find on the RESOURCES section. There may be a setting in the future to reset handling on blow.

Link to comment

i still dont understand :/. I wish i could but im no where near to real scripting. All i am really doing is downloading resources from people and like delete, copy, and pasting. So basically i just do alot of minor editing....

the only script i was ever able to do sucessfully on my own is a script where a sound or song plays when you join the server then it stops when you spawn. although i did get some help from the wiki.

Link to comment

That's because setVehicleHandling is a SERVER ONLY function and onClientVehicleRespawn is CLIENT SIDE.

function resetVehicleHandling() 
    local h = getOriginalHandling(getElementModel(source)) 
    for k,val in pairs(h) do 
       setVehicleHandling(source, k, val) 
    end 
end 
addEventHandler("onVehicleRespawn", getRootElement(), resetVehicleHandling) 

Link to comment
  
timers = {} 
function onLeave() 
    if isTimer(timers[source]) then killTimer(timers[source]) end 
    timers[source] = setTimer(destroyVehicle, 10*1000, 1, source) 
end 
function destroyVehicle(veh) 
   if veh then destroyElement(veh) end 
end 
function onEnter() 
   if isTimer(timers[source]) then killTimer(timers[source]) end 
end 
addEventHandler("onVehicleEnter",root, onEnter) 
addEventHandler("onVehicleLeave", root, onLeave) 
  

not tested

wait ten seconds for it to delete

Link to comment

like the car doesnt delete. i want it so anytime you create a vehicle and the vehicle you created is idle for a certain amount of time the vehicle deletes. (even if you havent even entered your created vehicle at all )

edit: nvm i actually found out theres settings in the freeroam script for this... lol sorry..

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