AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Multiple HE Grenades (https://forums.alliedmods.net/showthread.php?t=117973)

Kaaba 02-06-2010 16:24

Multiple HE Grenades
 
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.

wrecked_ 02-06-2010 16:32

Re: Multiple HE Grenades
 
PHP Code:

give_item"weapon_hegrenade" )
cs_set_user_bpammoidCSW_HEGRENADE// the 4 is the CSW_HEGRENADE 


Arkshine 02-06-2010 16:38

Re: Multiple HE Grenades
 
Why do you write 4, instead of CSW_HEGRENADE ?

wrecked_ 02-06-2010 16:50

Re: Multiple HE Grenades
 
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.

Arkshine 02-06-2010 17:03

Re: Multiple HE Grenades
 
CSW_HEGRENADE is not a string, it's an integer defined in amxconst.inc.

wrecked_ 02-06-2010 17:04

Re: Multiple HE Grenades
 
mb, fixed.

Kaaba 02-06-2010 17:42

Re: Multiple HE Grenades
 
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

Kreation 02-06-2010 22:22

Re: Multiple HE Grenades
 
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.

Seta00 02-06-2010 22:23

Re: Multiple HE Grenades
 
Quote:

Originally Posted by Kreation (Post 1081076)
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
}; 


Kaaba 02-07-2010 08:10

Re: Multiple HE Grenades
 
i still keep getting only one he grenade :S


All times are GMT -4. The time now is 07:28.

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