Dear friends
Actually, i have any trouble to define 50 bullets per clip (when weapon picked up).
My problem is that when i set the ammo count, this is not for the current picked up weapon, but the previous used weapon.
My code :
Code:
public plugin_init()
{
register_plugin("PowerWeapons", "1.0", "Hebusletroll")
register_event("WeapPickup","weapon_pickup","be")
}
public weapon_pickup(id)
{
new clip,ammo
new weapon = get_user_weapon(id,clip,ammo)
cs_set_weapon_ammo(get_weaponid(id,weapon),50)
}
public get_weaponid(pid,wid)
{
new wpn[32],weapon_index = -1
get_weaponname(wid,wpn,31)
while ((weapon_index = find_ent_by_class(weapon_index, wpn)) != 0)
{
if (pid == entity_get_edict(weapon_index, EV_ENT_owner))
{
return weapon_index
}
}
return -1
}
My plugins (PowerWeapons), add (not replace !), many new weapons like :
Silver Kalachnikov,
Colt Carabine M4M203,
Magnum 44,
Molotov cocktail,
Canister,
Poisonned grenade,
Sawed off,
Rocket launcher,
Minigun.
All without DLL servers side supplement (like WTF, etc). and no client modification.
And more features.
Actually i'm blocked with this 50 bullets features.