Raised This Month: $51 Target: $400
 12% 

Infinite Ammo with reload (help please)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ateszhun95
Senior Member
Join Date: Apr 2014
Location: Hungary
Old 06-17-2014 , 02:54   Infinite Ammo with reload (help please)
Reply With Quote #1

Hi

I have a problem

Im using in my zombie server (zr3.1) unlimited ammo with cvar, sv_infinite_ammo 2,
but unfortunately this cvar making the grenades unlimited too.

Can you help me, how can i 'block' infinite ammo for grenades?
__________________
ateszhun95 is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 06-17-2014 , 03:26   Re: Infinite Ammo with reload (help please)
Reply With Quote #2

The way I do this is I hook SDKHook_Reload then setup a timer to refill ammo at the end of reload sequence.

Some plugin just refill ammo of everyone every x seconds which works too.

Or you could hook grenade throw events and remove the grenade weapon from there. But it might get complex if you want players to have multiple nades of same type.

EDIT: Another way I want to try would be using Dhooks and hooking NetworkStateChanged_m_iAmmo and refill ammo when its called (with some safety to avoid inifinite recursion).

Last edited by h3bus; 06-17-2014 at 03:30.
h3bus is offline
ateszhun95
Senior Member
Join Date: Apr 2014
Location: Hungary
Old 06-24-2014 , 06:24   Re: Infinite Ammo with reload (help please)
Reply With Quote #3

Quote:
Originally Posted by h3bus View Post
The way I do this is I hook SDKHook_Reload then setup a timer to refill ammo at the end of reload sequence.

Some plugin just refill ammo of everyone every x seconds which works too.

Or you could hook grenade throw events and remove the grenade weapon from there. But it might get complex if you want players to have multiple nades of same type.

EDIT: Another way I want to try would be using Dhooks and hooking NetworkStateChanged_m_iAmmo and refill ammo when its called (with some safety to avoid inifinite recursion).
Thank you for the answer
But im not a good scripter so i dont understand what you written
Can you write a plugin? )
__________________
ateszhun95 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 06-24-2014 , 12:53   Re: Infinite Ammo with reload (help please)
Reply With Quote #4

infinite ammo with reload

Why you not just give huge amount of ammo, instead using plugin for this.
PHP Code:
ammo_338mag_max        999999 //" = "30" game replicated
ammo_357sig_max        999999 //" = "52" game replicated
ammo_357sig_min_max    999999//" = "12" game replicated
ammo_357sig_small_max    999999//" = "24" game replicated
ammo_45acp_max        999999 //" = "100" game replicated
ammo_50AE_max        999999 //" = "35" game replicated
ammo_556mm_box_max        999999 //" = "200" game replicated
ammo_556mm_max        999999 //" = "90" game replicated
ammo_556mm_small_max        999999 //" = "40" game replicated
ammo_57mm_max        999999 //" = "100" game replicated
ammo_762mm_max        999999 //" = "90" game replicated
ammo_9mm_max        999999 //" = "120" game replicated
ammo_buckshot_max        999999 //" = "32" game replicated
//ammo_grenade_limit_default" = "1" game replicated
//ammo_grenade_limit_flashbang" = "1" game replicated
//ammo_grenade_limit_total" = "3" game replicated 
Spoiler


ps, game can't show whole amount of ammo in screen, it will refill that value when "empty".
Bacardi is offline
Chesterfield
Senior Member
Join Date: Apr 2013
Old 06-25-2014 , 19:12   Re: Infinite Ammo with reload (help please)
Reply With Quote #5

Quote:
Originally Posted by Bacardi View Post
infinite ammo with reload

Why you not just give huge amount of ammo, instead using plugin for this.
PHP Code:
ammo_338mag_max        999999 //" = "30" game replicated
ammo_357sig_max        999999 //" = "52" game replicated
ammo_357sig_min_max    999999//" = "12" game replicated
ammo_357sig_small_max    999999//" = "24" game replicated
ammo_45acp_max        999999 //" = "100" game replicated
ammo_50AE_max        999999 //" = "35" game replicated
ammo_556mm_box_max        999999 //" = "200" game replicated
ammo_556mm_max        999999 //" = "90" game replicated
ammo_556mm_small_max        999999 //" = "40" game replicated
ammo_57mm_max        999999 //" = "100" game replicated
ammo_762mm_max        999999 //" = "90" game replicated
ammo_9mm_max        999999 //" = "120" game replicated
ammo_buckshot_max        999999 //" = "32" game replicated
//ammo_grenade_limit_default" = "1" game replicated
//ammo_grenade_limit_flashbang" = "1" game replicated
//ammo_grenade_limit_total" = "3" game replicated 
Spoiler


ps, game can't show whole amount of ammo in screen, it will refill that value when "empty".
Hello, i don't recommend this, i've tried it in my hosted server and the server got an ammount huge of lag when people were reloading.
Chesterfield 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 22:36.


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