Jaysds1 Posted July 28, 2011 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) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
CapY Posted July 28, 2011 Author 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
Jaysds1 Posted July 28, 2011 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) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Jaysds1 Posted July 28, 2011 Posted July 28, 2011 (edited) ya, It's server side, Does it work? Edited July 28, 2011 by Guest My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
JR10 Posted July 28, 2011 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. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Jaysds1 Posted July 28, 2011 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) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
CapY Posted July 28, 2011 Author 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.
Jaysds1 Posted July 28, 2011 Posted July 28, 2011 Are you signed in as Admin??? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Scooby Posted July 30, 2011 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. [UVA]Scooby Founder Of UVA - Ultimate Vice Assassins http://www.uvaclan.com/
Plastid Posted July 30, 2011 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)
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