lucascba Posted July 13, 2014 Share Posted July 13, 2014 Hello I would like to know how to do to disable grenades in interior. sorry for my bad English Link to comment
Max+ Posted July 13, 2014 Share Posted July 13, 2014 you can , use more than one way .. First # --ClientSide addEventHandler ( 'onClientPlayerWeaponFire', resourceRoot, function (nWeapon) if ( getElementData ( localPlayer, 'NoGrenades' == false ) and nWeapon == 16 ) then cancelEvent ( ) outputChatBox ( '* Using Grenades Are Not Allowed Here * ' , 255, 0, 0 ) end end ) if the intro - clientSide , then setElementData ( localPlayer ,'NoGrenades', false ) if it was serverside use , setElementData ( source ,'NoGrenades', false ) second # ID = { 592, 553, 577, 488, 511, 497, 548, 563, 512, 476, 593, 447, 425, 519, 520, 460, 417, 469, 487, 513, 509, 481, 510, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454 } addEventHandler ( 'onClientPlayerWeaponFire', resourceRoot, function (nWeapon ) for _, v in ipairs (ID) do if ( getElementInterior (v ) and (nWeapon ) == 16 ) then cancelEvent ( ) outputChatBox ( '* Using Grenades Are Not Allowed Here * ' , 255, 0, 0 ) end end end ) Replace the ids, with your interior ids , Third # --ClientSide addEventHandler( 'onClientPlayerWeaponSwitch', root, function ( ) if ( getPedWeapon(localPlayer ) == 17 ) and getElementInterior(localPlayer) ~= 0 then toggleControl ( "fire", false ) else toggleControl ( "fire", true ) end end ) 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