Here it is:
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <fakemeta_util>
#define PLUGIN "Infinite Ammo"
#define VERSION "1.0"
#define AUTHOR "CodeMaster"
new max_ammo[30] = {13,0,10,0,7,0,30,30,0,30,20,25,30,35,25,12,20,10,30,100,8,30,30,20,0,7,30,30,0,50}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_PlayerPreThink,"hook_prethink")
}
public hook_prethink(id) {
if(is_user_alive(id)) {
new weapon_id = get_user_weapon(id)
if(weapon_id != CSW_C4 && weapon_id != CSW_KNIFE && weapon_id != CSW_HEGRENADE && weapon_id != CSW_FLASHBANG && weapon_id != CSW_SMOKEGRENADE) {
new weapon = fm_get_user_weapon_entity(id)
cs_set_weapon_ammo(weapon,max_ammo[weapon_id - 1])
}
}
return FMRES_HANDLED
}
I've did it from my own curiosity about how would it work, but it took me some time. Its tested and it works fine. If you are curios how does it work feel free to ask.
BTW: It needs fakemeta_util by VEN. You can find it here
http://forums.alliedmods.net/showthread.php?t=28284
+karma if you respect my time ;)
Cheers ;)
Nidza
__________________