http://www.amxmodx.org/funcwiki.php?go=func&id=185 // Get Ammo in Backpack
http://www.amxmodx.org/funcwiki.php?go=func&id=186 // Set Ammo in Backpack
http://www.amxmodx.org/funcwiki.php?go=func&id=207 // Get Ammo in current Clip
http://www.amxmodx.org/funcwiki.php?go=func&id=208 // Set Ammo in current Clip
( Those four do not ask for players id - the entity ID of the weapon is meant )
http://www.amxmodx.org/funcwiki.php?go=module&id=4 // Weapon IDs
( NOT the Entity IDs - Entity IDs vary on every weapon on the servers instance of a map, situation and time )
http://www.amxmodx.org/funcwiki.php?go=func&id=156 // Get currently carried Weapon
http://www.amxmodx.org/funcwiki.php?go=func&id=163 // Get list of all owned Weapons
( First get the Weapons ID(s) ( NOT Entity ID(s) ) )
http://www.amxmodx.org/funcwiki.php?go=func&id=617 // Call a Function in the Engine
( This requires Fakemeta - Use this in a loop to get Weapons Entity IDs )
( Use EngFunc_FindEntityByString with "classname" and "weapon_whatever" )
Here is a list of weapon names:
Code:
weapon_knife
weapon_deagle
weapon_usp
weapon_glock
weapon_p228
weapon_elite
weapon_fiveseven
weapon_ak47
weapon_aug
weapon_g3sg1
weapon_m249
weapon_m4a1
weapon_m3
weapon_mac10
weapon_mp5navy
weapon_p90
weapon_scout
weapon_sg552
weapon_sg550
weapon_ump45
weapon_tmp
weapon_xm1014
weapon_awp
weapon_galil
weapon_famas
weapon_hegrenade
weapon_flashbang
weapon_smokegrenade
weapon_c4
Or just use this one:
http://www.amxmodx.org/funcwiki.php?go=func&id=164 // Changes a Weapons ID into its classname,
like into those shown in the code block above - probably easier to use this.
http://www.amxmodx.org/funcwiki.php?go=func&id=609 // Retrieves Keyvalues from Entities
( Use pev_owner on the Weapon Entity IDs retrieved with engfunc to get correct Players Weapon )
( Also uses Fakemeta )
If you are clever enough, you can put these functions together into
a simple function which can change the ammo of one of a players weapon.
__________________