Raised This Month: $ Target: $400
 0% 

Triggering function at round-end and giving multiple HE grenades


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 08-12-2014 , 04:49   Triggering function at round-end and giving multiple HE grenades
Reply With Quote #1

Hello! A friend of mine asked me for a VIP menu and I accepted doing it. But I need two elements that I'm not familiar with: I need to trigger a fuction at round-end and I need to give a player four HE grenades. How could I do that? Thanks in advance!
__________________
~ Swiftly and with style ~
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
PreDominance
Member
Join Date: Jul 2014
Old 08-12-2014 , 05:27   Re: Triggering function at round-end and giving multiple HE grenades
Reply With Quote #2

Round end function.
For multiple nades...create a global array, say.. new numGivenNades[33];, and I'm not sure if you increment this with something like SendWeaponAnim() or if there's an actual greande_throw. There's a give command in the fun module that you can use here.
PreDominance is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 08-12-2014 , 06:17   Re: Triggering function at round-end and giving multiple HE grenades
Reply With Quote #3

Just
PHP Code:
give_item(id"weapon_hegrenade")
cs_set_user_bpammo(idCSW_HEGRENADE4
You can hook logevent for round end and loop trough players there.
__________________

Last edited by Flick3rR; 08-12-2014 at 07:29.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 08-12-2014 , 06:50   Re: Triggering function at round-end and giving multiple HE grenades
Reply With Quote #4

Quote:
Originally Posted by Flick3rR View Post
Just
PHP Code:
give_item("weapon_hegrenade")
cs_set_user_bpammo(idCSW_HEGRENADE4
You can hook logevent for round end and loop trough players there.
Oh. Well, I never thought that that would work. Thank you, you made it a lot easier.
__________________
~ Swiftly and with style ~
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 08-12-2014 , 08:45   Re: Triggering function at round-end and giving multiple HE grenades
Reply With Quote #5

Quote:
Originally Posted by EpicKiller View Post
Oh. Well, I never thought that that would work. Thank you, you made it a lot easier.
Note that this is different from giving a player 4 additional grenades. It enforces that the player has exactly 4 grenades instead. So if you want to add 4 (so the player can have 8 after two rounds for example) you need to do this:

PHP Code:
cs_set_user_bpammo(idCSW_HEGRENADEcs_get_user_bpammo(idCSW_HEGRENADE)) 
__________________
In Flames we trust!
Nextra is offline
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 08-12-2014 , 14:50   Re: Triggering function at round-end and giving multiple HE grenades
Reply With Quote #6

Quote:
Originally Posted by Nextra View Post
Note that this is different from giving a player 4 additional grenades. It enforces that the player has exactly 4 grenades instead. So if you want to add 4 (so the player can have 8 after two rounds for example) you need to do this:

PHP Code:
cs_set_user_bpammo(idCSW_HEGRENADEcs_get_user_bpammo(idCSW_HEGRENADE)) 
That truly didn't cross my mind. Thank you, that's a really nice improvement to the plugin.
__________________
~ Swiftly and with style ~
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-13-2014 , 04:15   Re: Triggering function at round-end and giving multiple HE grenades
Reply With Quote #7

Quote:
Originally Posted by EpicKiller View Post
That truly didn't cross my mind. Thank you, that's a really nice improvement to the plugin.
It's not an improvement for what Flicker posted, it's just something different.
Flicker's code set your he grenades to 4, no matter what ammount you have.
Nextra's code add to your actual ammount of he grenades 4. So you will have x+4
__________________
HamletEagle is offline
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 13:12.


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