Raised This Month: $ Target: $400
 0% 

HOw to set clip and default clip for weapon ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 11-22-2011 , 18:12   HOw to set clip and default clip for weapon ?
Reply With Quote #1

HOw to set clip and default clip for weapon ? . I still don't know that. I only know how to set bpammo, but not clip

Last edited by dias; 11-22-2011 at 18:12.
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 11-22-2011 , 18:54   Re: HOw to set clip and default clip for weapon ?
Reply With Quote #2

cs_set_weapon_ammo().
Devil259 is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-22-2011 , 19:26   Re: HOw to set clip and default clip for weapon ?
Reply With Quote #3

Note that cs_set_weapon_ammo needs the entity index which can be obtained from:

Code:
stock PlayerWeaponEnt( iPlayer, iWeaponID )
{
	if ( is_user_alive( iPlayer ) && iWeaponID != 2 && iWeaponID > 0 && iWeaponID < CSW_VEST )
	{
		new szWeapName[32];
		get_weaponname( iWeaponID, szWeapName, charsmax(szWeapName) );
		new iEntity;
		while ( ( iEntity = engfunc( EngFunc_FindEntityByString, iEntity, "classname", szWeapName ) ) && pev( iEntity, pev_owner ) != iPlayer ) {}
		return iEntity;
	}

	return 0;
}

Last edited by Emp`; 11-22-2011 at 19:26.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 11-23-2011 , 04:45   Re: HOw to set clip and default clip for weapon ?
Reply With Quote #4

can we use fm_find_ent_by_owner ?
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 11-23-2011 , 07:10   Re: HOw to set clip and default clip for weapon ?
Reply With Quote #5

I think.
Devil259 is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 11-23-2011 , 07:15   Re: HOw to set clip and default clip for weapon ?
Reply With Quote #6

I've tried like #2 said but after you reload it will back to normal default clip.
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 11-23-2011 , 07:19   Re: HOw to set clip and default clip for weapon ?
Reply With Quote #7

You can do something like that : http://forums.alliedmods.net/showpos...78&postcount=8

or

Quote:
new weapon_id = find_ent_by_owner(-1, "weapon_ak47", id);
if(weapon_id)
{
cs_set_weapon_ammo(weapon_id, 50);
}
Devil259 is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-23-2011 , 11:40   Re: HOw to set clip and default clip for weapon ?
Reply With Quote #8

If you want to permanently set the max clip of a weapon, look at this plugin: https://forums.alliedmods.net/showthread.php?t=82093
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Reply



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 08:30.


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