Added cs_get_weapon_ammo/cs_set_weapon_ammo

This commit is contained in:
Johnny Bergström 2004-03-22 09:10:11 +00:00
parent bbbe0cda78
commit 180fa52acb
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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);