I pretty much figured how to hook into standard weapons but not those, as the player seems to have empty hands by the time OnPlayerAttack fires.
Also rockets aren't affected by the OnPlayerAttack return value?
EDIT: If you had a tip on also denying mines&traps that would be great.
Prevent a player from throwing grenades/c4/rockets?
Discussion in 'Rust Development' started by Kyrah Abattoir, May 4, 2016.
-
OnExplosiveThrown(BasePlayer player, BaseEntity entity)
OnMeleeThrown(BasePlayer player, Item item)
For throwables
OnItemDeployed(Deployer deployer, BaseEntity entity)
For traps
The docs is your friend
-
Yeah i've seen those but since they don't have a blocking return value, i have no idea of an elegant way to "deny" their usage.
-
Just kill/destroy the entity/item
-
I guess I can do that, maybe spawn the undeployed version on the ground immediately?
Currently for guns and other weapons i have the player throw the gun on the floor which is kind of funny.
