Raised This Month: $ Target: $400
 0% 

Weapon Pickup / Set AK47 & M4A1 to 50 bullets clip.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
hebusletroll
Senior Member
Join Date: Apr 2006
Old 04-17-2006 , 15:15   Weapon Pickup / Set AK47 & M4A1 to 50 bullets clip.
Reply With Quote #1

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.
hebusletroll is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode