Jump to content

Disallowed weapos


Miika

Recommended Posts

Posted
takeWeapon on onClientWeaponFire and onClientPlayerWeaponSwitch and onClientPlayerWeaponTarget

But I want add minigun to shop ($50 000)

Posted

I use onClientWeaponFire but it doesn't work. I can kill people with minigun

function noDeagle() 
    local weaponID = getElementModel(source)  
    if weaponID == 38 then  
        cancelEvent()  
    end 
end 
addEventHandler("onClientWeaponFire", getRootElement(), noDeagle) 

Posted
I use onClientWeaponFire but it doesn't work. I can kill people with minigun

This event is only for weapons created with createWeapon. The example provided on the onClientPlayerDamage page should work for you, tho :)

------------------------------------------------------------------------------------------------------------------------------------------------

If you want to go abit more advanced: you can also decrease the minigun damage with setWeaponProperty, instead of completely deactivating it:

setWeaponProperty(38,"pro","damage",1.5) 

Just paste this into a server-side script and it should work ;)

The last number is the amount of damage per bullet, a player has 100 Health.

  • Moderators
Posted

That's only for custom weapons.(created weapons)

For player weapons:

onClientPlayerWeaponFire

Which can't cancel.

I know there is some confusion with: onClientPlayerWeaponFire and onClientWeaponFire

Just read the wiki better guys and the brains will :fadein: !

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