Return to Main Docs Page

game.AddAmmoType

NewerShared.png Adds a new ammo type to the game.

game.AddAmmoType( string name , number dmgtype , number tracer , number plydmg , number npcdmg , number force , number maxcarry , number minsplash , number maxsplash , nubmer flags  )
               

Arguments:


  • 1) string name
  • Name of the ammo.

  • 2) number dmgtype
  • Damage type using DMG enum.
    Default: DMG_BULLET

  • 3) number tracer
  • Tracer type using TRACER enum.
    Default: TRACER_NONE

  • 4) number plydmg
  • The damage dealt to players.
    Can also be a string pointing to a convar.

  • 5) number npcdmg
  • The damage dealt to NPCs.
    Can also be a string pointing to a convar.

  • 6) number maxcarry
  • Maximum amount of ammo of this type the player should be able to carry in reserve.
    Can also be a string pointing to a convar.

  • 7) number minsplash
  • The minimum water splash size.

  • 8) number maxsplash
  • The maximum water splash size.

  • 9) number flags
  • Flags for the ammo type using AMMO enum.
    Default: 0

Example:


--Custom Ammo Example

CreateConVar("sk_ply_dmg_smg3", "1", FCVAR_NONE,"", "0", "999")
CreateConVar("sk_npc_dmg_smg3", "1", FCVAR_NONE,"", "0", "999")
CreateConVar("sk_max_smg3", "500", FCVAR_NONE,"", "0", "999")

game.AddAmmoType("SMG3",2,1,"sk_plr_dmg_smg3", "sk_npc_dmg_smg3", "sk_max_smg3",0, 0 );