DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
AmmoTypes.c
Go to the documentation of this file.
2{
3 private void AmmoTypesAPI() {}
4 private void ~AmmoTypesAPI() {}
5
7 static proto bool Exists(string ammoType);
9 static proto bool GetAmmoType(string magazineType, out string ammoType);
10
12 static bool MagazineTypeToAmmoType(string magazineType, out string ammoType)
13 {
14 if ( !AmmoTypesAPI.Exists(magazineType) )
15 {
16 if ( !AmmoTypesAPI.GetAmmoType(magazineType, ammoType) )
17 {
18 ErrorEx(string.Format("%1 is not a magazineType or ammoType or has no default 'ammo' set up in config.", magazineType));
19 return false;
20 }
21 return true;
22 }
23 else
24 {
25 // This is already an ammoType
26 ammoType = magazineType;
27 return true;
28 }
29 }
30}
static proto bool GetAmmoType(string magazineType, out string ammoType)
Get the default ammoType of a magazine.
static proto bool Exists(string ammoType)
Check if ammoType exists (registered in cfgAmmoTypes)
static bool MagazineTypeToAmmoType(string magazineType, out string ammoType)
Helper method.
Definition AmmoTypes.c:12
private void AmmoTypesAPI()
Definition AmmoTypes.c:3
private void ~AmmoTypesAPI()
Definition AmmoTypes.c:4
enum ShapeType ErrorEx