Jump to content

HELP toggleControl[not solved]


#RooTs

Recommended Posts

Posted (edited)

Hello guys I'm trying to set this function to the player does not fire in overhead the bike.

What is wrong?

function disableFireForHydra ( theVehicle, seat ) 
local Vehicle = getPedOccupiedVehicle(getLocalPlayer()) 
    if Vehicle then 
        local Type = getVehicleType(Vehicle) 
        if Type == "Motorbikes" or Type == "Bicycles" then 
            toggleControl ( "vehicle_secondary_fire", false ) 
        else 
            toggleControl ( "vehicle_secondary_fire", true ) 
        end 
    end 
end 
addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), disableFireForHydra ) 

other controls to set

toggleControl ( "aim_weapon", false) 
toggleControl ( "vehicle_fire", false) 
toggleControl ( "fire", false) 

Edited by Guest

 DUyJ810.gif

Posted
Hello ? :o

be patient bro , anyways try this

local vehicleType = {["BMX"] = true, ["Bike"] = true} 
local controls = {"vehicle_secondary_fire","vehicle_secondary_fire","aim_weapon","vehicle_fire", "fire"} 
  
function disableFire ( theVehicle, seat ) 
    if theVehicle then  
        local Type = getVehicleType(theVehicle) 
        if vehicleType[Type] then 
             for i, v in pairs(controls) do 
                toggleControl(tostring(v), false) 
            end 
        else 
             for i, v in pairs(controls) do 
                toggleControl(tostring(v), true) 
            end 
        end 
    end 
end 
addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), disableFire ) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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