Garry's Mod Wiki

GM:EntityFireBullets

  boolean GM:EntityFireBullets( Entity entity, table data )

Description

Called every time a bullet is about to be fired from an entity, which allows to completely modify the bullet structure before the bullet is actually fired.

See GM:PostEntityFireBullets if you wish to hook the final bullet values, such as the aim direction post spread calculations.

This hook is called directly from Entity:FireBullets. Due to this, you cannot call Entity:FireBullets inside this hook or an infinite loop will occur crashing the game.

Arguments

1 Entity entity
The entity that fired the bullet
2 table data
The bullet data. See Bullet structure.

Returns

1 boolean
  • Return true to apply all changes done to the bullet table.
  • Return false to suppress the bullet.