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

set max ammunition endless?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 08-23-2016 , 14:59   set max ammunition endless?
Reply With Quote #1

Hello
There is a limit to carry the ammunition in weapons , how do I make players got more ammunition endless number?
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 08-25-2016 , 08:31   Re: set max ammunition endless?
Reply With Quote #2

Hook player reload, after reload, set max ammo again. This way you have unlimited ammo.

Or you could search for plugins that already does something like you're asking for.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 08-26-2016 , 09:17   Re: set max ammunition endless?
Reply With Quote #3

Napoleon_be
thx for rply

But I want to exceed the limit for a particular weapon ammunition
Ex: Weapon RPG in (HL1)

The limit is 5 for ammunition
I want to make the player holds more than this number
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 09-02-2016 , 09:02   Re: set max ammunition endless?
Reply With Quote #4

Bump
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-02-2016 , 09:40   Re: set max ammunition endless?
Reply With Quote #5

You're asking for unlimited number of ammo. For this, you can just do what i told you.

If you want to limit the ammo but with a higher limit, you should wait for someone else to reply because i have no idea how that would work.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 09-02-2016 , 11:48   Re: set max ammunition endless?
Reply With Quote #6

Quote:
Originally Posted by Napoleon_be
If you want to limit the ammo but with a higher limit
yes i want that exact
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 09-02-2016 , 16:23   Re: set max ammunition endless?
Reply With Quote #7

I think you will need to scan either the pdata of the player or the weapon and see if you can determine a value that represents the max ammunition reserve, then change that value to what you want. Will probably require trial and error, unless someone knows a better way.
__________________
Bad_Bud is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-02-2016 , 17:30   Re: set max ammunition endless?
Reply With Quote #8

I never scripted for half life, i don't know how to write it because i don't remember the exact natives/events, but here is a method which should work

You have to hook touch between player and weaponbox entity
When player touches weaponbox retrieve the amount of bpammo that it contains and the weapon's id
Delete the weaponbox entity
Set player's bpammo += the bpammo of the weaponbox

Note that this will only work for half life, since there you don't buy weapons, you just pick them up
__________________

Last edited by Depresie; 09-02-2016 at 17:32.
Depresie is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-03-2016 , 04:22   Re: set max ammunition endless?
Reply With Quote #9

You could play with GetItemInfo and change iMaxAmmo1. IIRC you can do that in amxx 1.8.3 with hamsandwich, else you would need orpheu/okapi.
__________________
HamletEagle is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 09-03-2016 , 14:34   Re: set max ammunition endless?
Reply With Quote #10

guys soory i do not know much in scripting(

this what i undestend of all :
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hl>
#include <hamsandwich>

new const 
m_iDefaultAmmo 44
m_iSecondaryAmmoType 39,
m_pPlayer 28;


public 
plugin_init() {

   
RegisterHam(Ham_Weapon_WeaponIdle"weapon_rpg""fw_UpdateAmmo"1

}

public 
fw_UpdateAmmo(weapon)
{
    if (!
pev_valid(weapon))
        return 
HAM_IGNORED
    
    
if(get_pdata_int(weaponm_iDefaultAmmo4))
    {
        new 
ent get_pdata_int(weaponm_iSecondaryAmmoType4);
        new 
id get_pdata_cbase(weaponm_pPlayer4);
        if(
hl_get_user_bpammo(idweapon) == && ent)
        {
            
hl_set_wbox_ammo(weapon100)//i want set ammo here 100 for exomple
        
}
    }
            
        
    
/*if(!pev_valid(ent))
        return HAM_IGNORED*/
        
    
return HAM_IGNORED

this pData of HL1:
http://aghl.ru/forum/viewtopic.php?f=39&t=30
and this stocks (hl.inc):
http://aghl.ru/forum/viewtopic.php?f=39&t=59
__________________

Last edited by abdobiskra; 09-03-2016 at 14:35.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
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 00:08.


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