From 180fa52acbd28519461d97172c2fff3c79d00bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Bergstr=C3=B6m?= Date: Mon, 22 Mar 2004 09:10:11 +0000 Subject: [PATCH] Added cs_get_weapon_ammo/cs_set_weapon_ammo --- dlls/cstrike/cstrike.cpp | 2 +- plugins/include/cstrike.inc | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/cstrike/cstrike.cpp b/dlls/cstrike/cstrike.cpp index 1b90f8f9..713c88c5 100755 --- a/dlls/cstrike/cstrike.cpp +++ b/dlls/cstrike/cstrike.cpp @@ -1206,7 +1206,7 @@ static cell AMX_NATIVE_CALL cs_get_weapon_ammo(AMX *amx, cell *params) // cs_get return 0; } - return *(int *)pWeapon->pvPrivateData + OFFSET_CLIPAMMO; + return *((int *)pWeapon->pvPrivateData + OFFSET_CLIPAMMO); } static cell AMX_NATIVE_CALL cs_set_weapon_ammo(AMX *amx, cell *params) // cs_set_weapon_ammo(index, newammo); = 2 params diff --git a/plugins/include/cstrike.inc b/plugins/include/cstrike.inc index 3e3aada2..7f4a6d6d 100755 --- a/plugins/include/cstrike.inc +++ b/plugins/include/cstrike.inc @@ -115,3 +115,9 @@ native cs_get_weapon_silen(index); /* If silence = 1, weapon will be silenced, 0 and silencer will be removed. Only USP and M4A1 can be silenced. */ native cs_set_weapon_silen(index, silence = 1); + +/* Returns amount of ammo in weapon's clip. */ +native cs_get_weapon_ammo(index); + +/* Set amount of ammo in weapon's clip. */ +native cs_set_weapon_ammo(index, newammo); \ No newline at end of file