Jump to content

Hydra .


CapY

Recommended Posts

try this:

addEventHandler("onVehicleStartEnter",getRootElement(), 
function(player) 
    local account = getPlayerAccount(player) 
    local accountName = getAccountName(account) 
    if not isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then 
    if ( getControlState(player,"vehicle_fire") == true) then 
       setControlState(player,"vehicle_fire",false) 
    end 
    if ( getControlState(player,"vehicle_secondary_fire") == true) then 
       setControlState(player,"vehicle_secondary_fire", false) 
    end 
end) 

Link to comment

sorry, I 4got to add the next end:

addEventHandler("onVehicleStartEnter",getRootElement(), 
function(player) 
    local account = getPlayerAccount(player) 
    local accountName = getAccountName(account) 
    if not isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then 
    if ( getControlState(player,"vehicle_fire") == true) then 
       setControlState(player,"vehicle_fire",false) 
    end 
    if ( getControlState(player,"vehicle_secondary_fire") == true) then 
       setControlState(player,"vehicle_secondary_fire", false) 
    end 
    end 
end) 

Link to comment

ok, Here then:

addEventHandler("onVehicleStartEnter",getRootElement(), 
function(player) 
    local account = getPlayerAccount(player) 
    local accountName = getAccountName(account) 
    if not isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then 
        toggleControl ( player, "vehicle_secondary_fire", false ) -- disable their fire key 
        toggleControl (player, "vehicle_fire", false ) 
    else 
        toggleControl ( source, "vehicle_secondary_fire", true ) -- enable their fire key 
        toggleControl (player, "vehicle_fire", true) 
    end 
end) 

Link to comment

when i last tried this (around may 2011), its seems it wasnt possible to disable the vehicle weapons for ALL players,

i tried for a long time adding things here and there to disable the vehicle weapons...

whilst i was about 98% successful, there was still the odd couple of players that could still shoot.

eventually after many nights of trying different things, i ended up removing the vehicles that could shoot. :crazyeyes:

Link to comment

From: MTA10/core/CKeyBinds.cpp

  
    AddGTAControl ( "lalt", "vehicle_fire" ); 
    AddGTAControl ( "mouse1", "vehicle_fire" ); 
  [b]  AddGTAControl ( "ctrl", "vehicle_secondary_fire" );[/b] 
    AddGTAControl ( "num_0", "vehicle_secondary_fire" ); 
  

This should work (Server of Client ) side - :arrow:

toggleControl ( Player, "vehicle_secondary_fire", false) 

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