Jaysds1 Posted July 28, 2011 Share Posted July 28, 2011 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
CapY Posted July 28, 2011 Author Share Posted July 28, 2011 (edited) Jaysds1 , first test resource when you wrote it . Error on 2 and 12 line . Edited July 28, 2011 by Guest Link to comment
Jaysds1 Posted July 28, 2011 Share Posted July 28, 2011 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
Jaysds1 Posted July 28, 2011 Share Posted July 28, 2011 (edited) ya, It's server side, Does it work? Edited July 28, 2011 by Guest Link to comment
JR10 Posted July 28, 2011 Share Posted July 28, 2011 Do you know what getControlState even do? Checks if the player is pressing a control, which is not what he wants. Link to comment
Jaysds1 Posted July 28, 2011 Share Posted July 28, 2011 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
CapY Posted July 28, 2011 Author Share Posted July 28, 2011 Guys , it doesn't works , if you wanna come to the server to see what is the problem , name is : Fg Clan ... P.S. Resedit added , so if you will come to server, you can edit that resource in-game. Link to comment
Jaysds1 Posted July 28, 2011 Share Posted July 28, 2011 Are you signed in as Admin??? Link to comment
Scooby Posted July 30, 2011 Share Posted July 30, 2011 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. Link to comment
Plastid Posted July 30, 2011 Share Posted July 30, 2011 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 - toggleControl ( Player, "vehicle_secondary_fire", false) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now