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

Refill "storage ammo" (not clip) when killing enemy


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nss
Junior Member
Join Date: Feb 2011
Old 03-22-2014 , 13:50   Refill "storage ammo" (not clip) when killing enemy
Reply With Quote #1

Hi, i ask for a plugin that fill "storage ammo" (not clip) when killing enemy (apply for bots and human)
like this : when you kill enemy ,the remaining ammo in your gun are should not be changed , but the ammo in your storage will be filled 50% (this is variable which we can change) ,
for example
for ak is 90/2 = 45, awp is " 30/2 =15 " etc...

(i want to use it for csdm)

I searched but i haven't found ,these fills clip when killing,not fill storage ammo
https://forums.alliedmods.net/showth...62459?p=762459
https://forums.alliedmods.net/showth...953#post920953
https://forums.alliedmods.net/showthread.php?t=67331

Any help will be much appreciated
Thanks

Last edited by nss; 03-22-2014 at 15:06.
nss is offline
Old 03-22-2014, 14:16
wickedd
This message has been deleted by wickedd. Reason: read my next post
nss
Junior Member
Join Date: Feb 2011
Old 03-22-2014 , 14:27   Re: Refill "storage ammo" when killing enemy
Reply With Quote #2

Quote:
Originally Posted by wickedd View Post
Search the forum, there's one written by ConnorMcLeod.
you mean this ,right ? https://forums.alliedmods.net/showpo...70&postcount=7
Thanks for the help , but it fill the clip , not the "storage ammo" ,so i don't know how to edit it
i can edit if i found a plugin that refill the "storage ammo" when killing , not the "clip ammo"

Last edited by nss; 03-22-2014 at 14:33.
nss is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 03-22-2014 , 14:36   Re: Refill "storage ammo" (not clip) when killing enemy
Reply With Quote #3

No, I'm not talking about that one. After reading the thread, the one I was talking about refills the clip ammo. So, it's not what you want. I will post a link if I find one that does what you want.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
nss
Junior Member
Join Date: Feb 2011
Old 03-22-2014 , 15:04   Re: Refill "storage ammo" (not clip) when killing enemy
Reply With Quote #4

Quote:
Originally Posted by wickedd View Post
No, I'm not talking about that one. After reading the thread, the one I was talking about refills the clip ammo. So, it's not what you want. I will post a link if I find one that does what you want.
Nice to hear that
Thanks again ,wickedd
nss is offline
nss
Junior Member
Join Date: Feb 2011
Old 04-20-2014 , 21:10   Re: Refill "storage ammo" (not clip) when killing enemy
Reply With Quote #5

hi, any helps ? thanks
nss is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 04-21-2014 , 02:21   Re: Refill "storage ammo" (not clip) when killing enemy
Reply With Quote #6

Quote:
Originally Posted by nss View Post
hi, any helps ? thanks
If I get any time later I may code one for you.

If I end up making it ill Pm you.
__________________
Blizzard_87 is offline
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 04-21-2014 , 05:03   Re: Refill "storage ammo" (not clip) when killing enemy
Reply With Quote #7

Hi buddy, not tested, but I hope it helps ^^

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new const g_max_ammo[] =
{
    
052090132100901120100100909090100120301202003290120290359090 ,10000
}
new 
giveammo

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("DeathMsg""EventDeathMsg""a")
    
giveammo register_cvar("amx_percentgiveammo""0.25")
}

public 
EventDeathMsg()
{
    new 
killer read_data(1)
    if(!
is_user_alive(killer))
        return

    new 
victim read_data(2)
    if(!
is_user_connected(victim) || victim == killer)
        return

    new 
clipammoweapon get_user_weapon(killerclipammo)
    
    if(
weapon == CSW_KNIFE || weapon == CSW_C4)
        return

    new 
give cs_get_user_bpammo(killer) + floatround(get_pcvar_float(giveammo) * g_max_ammo[weapon]) // give 25% of max ammo
    
if(give g_max_ammo[weapon])    //if we are giving more than max, just give max ammo
        
give g_max_ammo[weapon]

    
cs_set_user_bpammo(killerweapongive)


Last edited by NikKOo31; 04-21-2014 at 07:55.
NikKOo31 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 04-21-2014 , 06:58   Re: Refill "storage ammo" (not clip) when killing enemy
Reply With Quote #8

Quote:
Originally Posted by NikKOo31 View Post
Hi buddy, not tested, but I hope it helps ^^

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new const g_max_ammo[] =
{
    
052090132100901120100100909090100120301202003290120290359090 ,10000
}
new 
giveammo

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("DeathMsg""EventDeathMsg""a")
    
giveammo register_cvar("amx_percentgiveammo""0.25")
}

public 
EventDeathMsg()
{
    new 
killer read_data(1)
    if(!
is_user_alive(killer))
        return

    new 
victim read_data(2)
    if(!
is_user_connected(victim) || victim == killer)
        return

    new 
clipammoweapon get_user_weapon(killerclipammo)
    
    if(
weapon == CSW_KNIFE || weapon == CSW_C4)
        return

    new 
give floatround(get_pcvar_float(giveammo) * g_max_ammo[weapon]) // give 25% of max ammo
    
if(give g_max_ammo[weapon])    //if we are giving more than max, just give max ammo
        
give g_max_ammo[weapon]

    
cs_set_user_bpammo(killerweapongive)

your code only sets players bpammo to the % of the maximum not Adding that % to current bpammo.
__________________
Blizzard_87 is offline
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 04-21-2014 , 07:56   Re: Refill "storage ammo" (not clip) when killing enemy
Reply With Quote #9

Yup, my bad. Thanks @Blizzard_87 ^^

I edited the code
NikKOo31 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:56.


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