In y_weapondata there is a function you can check for valid weapons with.
new valid = Weapon_IsValid(weaponid);
You can use Weapon_GetFireType
to get a certain weapon's fire type.
Weapon_GetFireType(weaponid);
It returns one of the fire types shown below, depending on given weapon's ID:
WEAPON_FIRE_TYPE_MELEE
WEAPON_FIRE_TYPE_PROJECTILE
WEAPON_FIRE_TYPE_INSTANT_HIT
WEAPON_FIRE_TYPE_AREA_EFFECT
WEAPON_FIRE_TYPE_USE
WEAPON_FIRE_TYPE_CAMERA
Get a certain weapon's minimum range using:
Float:Weapon_GetMinRange(weaponid);
Or, get its maximum range using:
Float:Weapon_GetMaxRange(weaponid);
y_weapondata also provides some minimal information about the weapon ammo.
Get a certain weapon's ammo name using:
bool:Weapon_GetAmmoName(weaponid, dest[], size = sizeof (dest));
Get a standard weapon's animation group using:
bool:Weapon_GetAnimGroup(weaponid, dest[], size = sizeof (dest));
Get a pro
weapon's animation group using:
bool:Weapon_GetProAnimGroup(weaponid, dest[], size = sizeof (dest));
Get a weapon slot using:
Weapon_GetSlot(weaponid);
Get a weapon model ID using:
Weapon_GetModelID(weaponid);
TIP: You can also get a weapon ID from a model ID using:
Weapon_GetIDFromModelID(modelid);
#if !defined YSI_WEAPDATA_MAX_STRING_SIZE
#define YSI_WEAPDATA_MAX_STRING_SIZE (24)
#endif
If you want to increase the size, just define YSI_WEAPDATA_MAX_STRING_SIZE
at the very top of your script code.
bool:Weapon_IsAssaultRifle
bool:Weapon_IsPistol
bool:Weapon_IsShotgun
bool:Weapon_IsSubmachineGun
bool:Weapon_IsRifle