Garry's Mod Wiki

Revision Difference

Structures/Bullet#517087

<cat>struct</cat> <structure> <description>Tables used for bullets see <page>Entity:FireBullets</page> and <page>GM:EntityFireBullets</page>.</description> <fields> {{StructureField|Entity|Attacker|The entity that should be reported as attacker eg. a player By default this would be set to the entity <page>Entity:FireBullets</page> is called on.|self⤶ <item name="Attacker" type="Entity" default="self">The entity that should be reported as attacker eg. a player By default this would be set to the entity <page>Entity:FireBullets</page> is called on.</item>⤶ <item name="Callback" type="function" default="nil">Function to be called **after** the bullet was fired. The arguments are:⤶ * <page>Entity</page> attacker⤶ * <page>table</page> tr - See <page>TraceResult</page>⤶ * <page>CTakeDamageInfo</page> dmgInfo</item>⤶ <item name="Damage" type="number" default="1">The damage dealt by the bullet</item>⤶ <item name="Force" type="number" default="1">The force of the bullets</item>⤶ <item name="Distance" type="number" default="56756">Maximum distance the bullet can travel</item>⤶ <item name="HullSize" type="number" default="0">The hull size of the bullet</item>⤶ <item name="Num" type="number" default="1">The amount of bullets to fire</item>⤶ <item name="Tracer" type="number" default="1">Show tracer for every x bullets</item>⤶ <item name="AmmoType" type="string" default="\u0022\u0022">The ammunition name</item>⤶ <item name="TracerName" type="string" default="nil">The tracer name. You can find a list of default effects [here](/gmod/Effects).</item>⤶ <item name="Dir" type="Vector" default="Vector( 0, 0, 0 )">The fire direction</item>⤶ <item name="Spread" type="Vector" default="Vector( 0, 0, 0 )">The spread, only x and y are needed</item>⤶ <item name="Src" type="Vector" default="Vector( 0, 0, 0 )">The position to fire the bullets from</item>⤶ <item name="IgnoreEntity" type="Entity" default="NULL">The entity that the bullet will ignore when it will be shot.</item>⤶ </fields> </structure> {{StructureField|function|Callback|Function to be called **after** the bullet was fired. The arguments are:⤶ * <page>Entity</page> attacker⤶ * <page>table</page> tr - See <page>TraceResult</page>⤶ * <page>CTakeDamageInfo</page> dmgInfo|nil⤶ }}{{StructureField|number|Damage|The damage dealt by the bullet|1}}{{StructureField|number|Force|The force of the bullets|1}}{{StructureField|number|Distance|Maximum distance the bullet can travel|56756}}{{StructureField|number|HullSize|The hull size of the bullet|0}}{{StructureField|number|Num|The amount of bullets to fire|1}}{{StructureField|number|Tracer|Show tracer for every x bullets|1}}{{StructureField|string|AmmoType|The ammunition name|""}}{{StructureField|string|TracerName|The tracer name. You can find a list of default effects [here](/gmod/Effects).|nil}}{{StructureField|Vector|Dir|The fire direction|Vector( 0, 0, 0 )}}{{StructureField|Vector|Spread|The spread, only x and y are needed|Vector( 0, 0, 0 )}}{{StructureField|Vector|Src|The position to fire the bullets from|Vector( 0, 0, 0 )}}{{StructureField|Entity|IgnoreEntity|The entity that the bullet will ignore when it will be shot.|NULL}}⤶ }}