xeon17 Posted May 10, 2014 Share Posted May 10, 2014 How i can dissable weapons in interiors ? if possible in every interior ,or only in banks. Link to comment
xeon17 Posted May 10, 2014 Author Share Posted May 10, 2014 this ? addEventHandler("onPlayerDamage", root, function ( player ) if ( getElementInterior( player ) then cancelEvent() end Link to comment
justn Posted May 10, 2014 Share Posted May 10, 2014 addEventHandler("onPlayerDamage", root, function ( player ) if ( getElementInterior( player ) ) then cancelEvent() end end) Link to comment
cheez3d Posted May 10, 2014 Share Posted May 10, 2014 onPlayerDamage - Canceling this event has no effect. Cancel the client-side event onClientPlayerDamage instead. + that if statement will always get executed as the getElementInterior function returns an integer (which is ≠ nil or false). Link to comment
LonelyRoad Posted May 10, 2014 Share Posted May 10, 2014 addEventHandler("onClientPlayerDamage", root, function(player) if (getElementInterior(player) > 0) then cancelEvent() end end) The above code should work, run it client side. Link to comment
xeon17 Posted May 10, 2014 Author Share Posted May 10, 2014 No work , when player enter an interior he still can use his weapons.. i want just he can't shot. tried to take his weapon , it worked really bad. Link to comment
LonelyRoad Posted May 10, 2014 Share Posted May 10, 2014 That will at least prevent any damage from when someone is attacked inside an interior. Preventing the player equipping a weapon, I suppose could be done with this event OnPlayerWeaponSwitch and with function setPedWeaponSlot. 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