AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQ] Full bpammo ONLY when buying new weapon! (https://forums.alliedmods.net/showthread.php?t=233192)

JohnRambo 01-11-2014 04:53

[REQ] Full bpammo ONLY when buying new weapon!
 
Greetings, dear community. Can somebody help me? I need a plugin, that gives full bpammo ONLY when the player buys a new weapon. As implemented in the CS Sourse. Not each time he spawns!

JohnRambo 01-11-2014 04:56

Re: [REQ] Full bpammo ONLY when buying new weapon!
 
Quote:

Originally Posted by ConnorMcLeod (Post 1331120)
PHP Code:

/*    Formatright © 2010, ConnorMcLeod

    Full BpAmmo On Spawn is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Full BpAmmo On Spawn; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.1"

#define ammo_338magnum 1
#define ammo_9mm 10

#define XTRA_OFS_PLAYER    5
#define m_rgAmmo_Slot0    376

new const g_iMaxBpAmmo[] = {
    
0,
    
30,
    
90,
    
200,
    
90,
    
32,
    
100,
    
100,
    
35,
    
52,
    
120
}

public 
plugin_init()
{
    
register_plugin("Full BpAmmo On Spawn"VERSION"ConnorMcLeod")

    
RegisterHam(Ham_Spawn"player""Ham_CBasePlayer_Spawn_Post"1)
}

public 
Ham_CBasePlayer_Spawn_Postid )
{
    if( 
is_user_alive(id) )
    {
        for(new 
iAmmoIndex=ammo_338magnumiAmmoIndex<=ammo_9mmiAmmoIndex++)
        {
            
set_pdata_int(idm_rgAmmo_Slot0 iAmmoIndexg_iMaxBpAmmo[iAmmoIndex], XTRA_OFS_PLAYER)
        }
    }



Here is ConnorMcLeod's great plugin for exapmle, but it gives full bpammo every round.

ANTICHRISTUS 01-11-2014 05:03

Re: [REQ] Full bpammo ONLY when buying new weapon!
 
logically, to ask in the correct thread is better. ask in Connor's one and maybe you'll get help.

JohnRambo 01-11-2014 06:31

Re: [REQ] Full bpammo ONLY when buying new weapon!
 
Here is the original thread. I did not want to unbury it because, it's another regular plugin request thread. Anyway, sorry if did something wrong.


All times are GMT -4. The time now is 09:48.

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