Hi buddy, not tested, but I hope it helps ^^
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new const g_max_ammo[] =
{
0, 52, 0, 90, 1, 32, 1 , 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 2, 90, 35, 90, 90 ,100, 0, 0
}
new giveammo
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "EventDeathMsg", "a")
giveammo = register_cvar("amx_percentgiveammo", "0.25")
}
public EventDeathMsg()
{
new killer = read_data(1)
if(!is_user_alive(killer))
return
new victim = read_data(2)
if(!is_user_connected(victim) || victim == killer)
return
new clip, ammo, weapon = get_user_weapon(killer, clip, ammo)
if(weapon == CSW_KNIFE || weapon == CSW_C4)
return
new give = cs_get_user_bpammo(killer) + floatround(get_pcvar_float(giveammo) * g_max_ammo[weapon]) // give 25% of max ammo
if(give > g_max_ammo[weapon]) //if we are giving more than max, just give max ammo
give = g_max_ammo[weapon]
cs_set_user_bpammo(killer, weapon, give)
}