Jump to content

help with handling


F-22

Recommended Posts

Hello!

Im having some trouble with changing handling. When i start the script, it works in the play gamemode, but it does not want to work in race.

function handling (  ) 
    for _,veh in pairs(getElementsByType("vehicle")) do 
        if getElementModel(veh) == 541 then 
            setVehicleHandling(veh, "handlingFlags", 0x284020) 
        end 
    end 
end 
  
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), handling ) 

It just wont work in race :/

Link to comment

Well, on race you don't enter a vehicle, you just get spawned in it so,

function handling (  ) 
    if ( getElementModel ( source ) == 541 ) then 
        setVehicleHandling ( source, "handlingFlags", 0x284020 ) 
    end 
end 
addEventHandler ( "onResourceStart", resourceRoot, handling ) 

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