Raised This Month: $ Target: $400
 0% 

Multiple HE Grenades


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kaaba
Member
Join Date: Nov 2009
Old 02-06-2010 , 16:24   Multiple HE Grenades
Reply With Quote #1

How do i make so i can have 2 he grenades available, either by 2 in my backbag, or when i throw first grenade, i will get another.
Kaaba is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-06-2010 , 16:32   Re: Multiple HE Grenades
Reply With Quote #2

PHP Code:
give_item"weapon_hegrenade" )
cs_set_user_bpammoidCSW_HEGRENADE// the 4 is the CSW_HEGRENADE 
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 02-06-2010 at 17:04.
wrecked_ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-06-2010 , 16:38   Re: Multiple HE Grenades
Reply With Quote #3

Why do you write 4, instead of CSW_HEGRENADE ?
__________________
Arkshine is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-06-2010 , 16:50   Re: Multiple HE Grenades
Reply With Quote #4

Makes my life easier, I just memorized some of the codes to the CSW weapons. That's one of the weapons I'm familiar with. I'll fix it though.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-06-2010 , 17:03   Re: Multiple HE Grenades
Reply With Quote #5

CSW_HEGRENADE is not a string, it's an integer defined in amxconst.inc.
__________________
Arkshine is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-06-2010 , 17:04   Re: Multiple HE Grenades
Reply With Quote #6

mb, fixed.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Kaaba
Member
Join Date: Nov 2009
Old 02-06-2010 , 17:42   Re: Multiple HE Grenades
Reply With Quote #7

Thank you for replys, do you know how can i add that

PHP Code:
new const g_nad_classnames[Grenades][] =
{
 
"CSW_HEGRENADE",
 
"CSW_HEGRENADE",
 
"CSW_FLASHBANG",
 
"CSW_SMOKEGRENADE"
};
new const 
g_nade_classnames[Grenades][] =
{
 
"weapon_hegrenade",
 
"weapon_hegrenade",
 
"weapon_flashbang",
 
"weapon_smokegrenade"
}; 
would work with this:

PHP Code:
percent 100 g_nade_level[client][i] / 4
if( percent && (percent == 100 || random_num(1100) <= percent) )
{
give_item(clientg_nade_classnames[i]);
cs_set_user_bpammo(clientg_nad_classnames[i], );
 
if( 
percent 100 )
{
ColorChat(clientGREEN"[%s]^x03 You received your^x04 %s^x03! (^x04%i%%^x03 chance)"MESSAGE_TAGg_nade_names[i], percent);
}
}; 
So I kind of want 2 different HE grenade chances
Kaaba is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 02-06-2010 , 22:22   Re: Multiple HE Grenades
Reply With Quote #8

For one, this should be -->
PHP Code:
new const g_nad_classnames[Grenades][] =
{
 
CSW_HEGRENADE,
 
CSW_HEGRENADE,
 
CSW_FLASHBANG,
 
CSW_SMOKEGRENADE
};
new const 
g_nade_classnames[Grenades][] =
{
 
"weapon_hegrenade",
 
"weapon_hegrenade",
 
"weapon_flashbang",
 
"weapon_smokegrenade"
}; 
And to do that I'm pretty sure you just add the above to the top of your plugin to make them global.
__________________
Hi.
Kreation is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 02-06-2010 , 22:23   Re: Multiple HE Grenades
Reply With Quote #9

Quote:
Originally Posted by Kreation View Post
For one, this should be -->
PHP Code:
new const g_nad_classnames[Grenades][] =
{
 
CSW_HEGRENADE,
 
CSW_HEGRENADE,
 
CSW_FLASHBANG,
 
CSW_SMOKEGRENADE
};
new const 
g_nade_classnames[Grenades][] =
{
 
"weapon_hegrenade",
 
"weapon_hegrenade",
 
"weapon_flashbang",
 
"weapon_smokegrenade"
}; 
And to do that I'm pretty sure you just add the above to the top of your plugin to make them global.
No. You must remove the second level from the first array. Like this:
PHP Code:
new const g_nad_classnames[Grenades] =
{
 
CSW_HEGRENADE,
 
CSW_HEGRENADE,
 
CSW_FLASHBANG,
 
CSW_SMOKEGRENADE
}; 
Seta00 is offline
Kaaba
Member
Join Date: Nov 2009
Old 02-07-2010 , 08:10   Re: Multiple HE Grenades
Reply With Quote #10

i still keep getting only one he grenade :S
Kaaba is offline
Reply


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 07:28.


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