Jump to content

block weapons?


Recommended Posts

where it is inserted? Function disableMinigunOnSwitch (prevSlot, NewSlots)

if getPedWeapon (getLocalPlayer (), NewSlots) == 38 then - if the weapon is turned on minigun

toggleControl ("aim_weapon", false) - disable the button order

else - if not the minigun

toggleControl ("aim_weapon", true) - renable button order

end

end

addEventHandler ("onClientPlayerWeaponSwitch", getRootElement (), disableMinigunOnSwitch)

Link to comment
where it is inserted? Function disableMinigunOnSwitch (prevSlot, NewSlots)

if getPedWeapon (getLocalPlayer (), NewSlots) == 38 then - if the weapon is turned on minigun

toggleControl ("aim_weapon", false) - disable the button order

else - if not the minigun

toggleControl ("aim_weapon", true) - renable button order

end

end

addEventHandler ("onClientPlayerWeaponSwitch", getRootElement (), disableMinigunOnSwitch)

what you mean ?

Link to comment

create a file and name it what ever you want

like

client.lua

and put this script into it

don't forget meta.xml

then create zip file and put meta.xml and client.lua into it

meta file must be like this

 <meta> 
  <info author="yourname" version="1" type="script" />  
  <script src="Client.lua" type="client" /> 
</meta> 

then run Mtaserver.exe

that's all

good luck

but if you're new in scripting you better read this

https://wiki.multitheftauto.com/wiki/Scr ... troduction

i recommend you again

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