Jump to content

help with handling


F-22

Recommended Posts

Posted

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 :/

Posted

Try this:

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

Posted

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 ) 

Posted

Why don't you just reply what was the problem and help everybody. You guys are just asking and asking but not cooperating nor helping other people

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