Raised This Month: $ Target: $400
 0% 

Ammo packs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edga85
BANNED
Join Date: Jan 2009
Old 10-12-2009 , 06:46   Ammo packs
Reply With Quote #1

What i need to write If:
Vip Zombie infects someone he gets 2 ammo packs or when he human and kills zombie he gets 3 ammo packs
And can be controled by cvar how many he gets ammo packs....
edga85 is offline
Send a message via Skype™ to edga85
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-12-2009 , 08:34   Re: Ammo packs
Reply With Quote #2

You could use give_item with the ammo_ items, although it is by far not recommended. If, however, the weapon the players have is a fixed one (a M4A1, for instance), then you would know in advance the amount of ammo a ammo pack has. If that is the case, you can do a call as simple as this one:

PHP Code:
new ammo cs_get_user_bpammo(idCSW_M4A1// His ammo right now
ammo min(90, (ammo + (get_cvar_num("how_many_packs") * 30))) // Truncate his ammo to the maximum allowed
cs_set_user_bpammo(idCSW_M4A1ammo// Set his new ammo 
Note the use of function min to truncate the amount of money the player has (he can't have more than 90 because it's M4A1's maximum bpammo).

The killing part should be taken care of by Ham_Killed.
Moreover, it is recommended to cache the CVAR in a global variable at new round or something alike (you can look at the forums for this).
vitorrd is offline
edga85
BANNED
Join Date: Jan 2009
Old 10-12-2009 , 08:43   Re: Ammo packs
Reply With Quote #3

Not Guns ammo
But Zombie plague Ammo packs
edga85 is offline
Send a message via Skype™ to edga85
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-12-2009 , 08:45   Re: Ammo packs
Reply With Quote #4

Oh, I'm sorry, then. I don't even know what those are.
The same method should hold, though.
vitorrd is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 10-12-2009 , 09:50   Re: Ammo packs
Reply With Quote #5

First of all what is Vip Zombie?
SnoW is offline
Send a message via MSN to SnoW
edga85
BANNED
Join Date: Jan 2009
Old 10-12-2009 , 10:47   Re: Ammo packs
Reply With Quote #6

Im collecting codes but not Created yet....
Vip plugin for zombie plague mod....

Last edited by edga85; 10-13-2009 at 15:38.
edga85 is offline
Send a message via Skype™ to edga85
Old 10-13-2009, 15:40
edga85
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
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 22:37.


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