AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Unlimited Reloads (For paintball) (https://forums.alliedmods.net/showthread.php?t=206006)

MercedeSx7 01-17-2013 11:13

Unlimited Reloads (For paintball)
 
Hi guys i have problem with ham reload.. :(

PHP Code:

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

new const PLUGIN[] = "Unlimited Reloads (For paintball)";
new const 
VERSION[] = "1.0";
new const 
AUTHOR[] = "MercedeS";

public 
plugin_init()
{
register_plugin(PLUGINVERSIONAUTHOR);

RegisterHam(Ham_Weapon_Reload"paintball_reload");
}

public 
paintball_reload(weapon_entity)
{
new 
id pev(weapon_entitypev_owner);
new 
weapon get_user_weapon(id);

switch(
weapon)
{
case 
CSW_MP5NAVY:
{
cs_set_user_bpammo(idCSW_MP5NAVY120);
}
case 
CSW_GLOCK18:
{
cs_set_user_bpammo(idCSW_GLOCK18120);
}
case 
CSW_USP
{
cs_set_user_bpammo(idCSW_USP100);
}
}


CAn someone try too fix?

ConnorMcLeod 01-17-2013 12:17

Re: Unlimited Reloads (For paintball)
 
Use this :

PHP Code:

#include <amxmodx>
#include <fakemeta>

#define VERSION "0.0.1"

enum
{
    
AmmoX_AmmoID 1,
    
AmmoX_Ammount
}

enum
{
    
ammo_none,
    
ammo_338magnum 1// 30
    
ammo_762nato// 90
    
ammo_556natobox// 200
    
ammo_556nato// 90
    
ammo_buckshot// 32
    
ammo_45acp// 100            // mac10 ump45 usp 
    
ammo_57mm// 100
    
ammo_50ae// 35
    
ammo_357sig// 52
    
ammo_9mm// 120            // elite glock18 mp5navy tmp
    
ammo_flashbang// 2
    
ammo_hegrenade// 1
    
ammo_smokegrenade// 1
    
ammo_c4 // 1
}

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

new const 
m_rgpPlayerItems[32] = {376,377,...}

const 
INFINITE_RELOAD_BITSUM 1<<ammo_9mm 1<<ammo_45acp

public plugin_init()
{
    
register_plugin("Paintball Infinite BpAmmo"VERSION"ConnorMcLeod")
    
register_message(get_user_msgid("AmmoX"), "Message_AmmoX")
}

public 
Message_AmmoX(iMsgIdiMsgDestid)
{
    new 
iAmmoID get_msg_arg_int(AmmoX_AmmoID)

    if( 
is_user_alive(id) && iAmmoID )
    {
        new 
iMaxBpAmmo g_iMaxBpAmmo[iAmmoID]
        if( 
get_msg_arg_int(AmmoX_Ammount) < iMaxBpAmmo && INFINITE_RELOAD_BITSUM && 1<<iAmmoID )
        {
            
set_msg_arg_int(AmmoX_AmmountARG_BYTEiMaxBpAmmo)
            
set_pdata_int(idm_rgpPlayerItems[iAmmoIDiMaxBpAmmoXO_PLAYER)
        }
    }



YamiKaitou 01-18-2013 01:14

Re: Unlimited Reloads (For paintball)
 
Don't blank out your posts


All times are GMT -4. The time now is 13:38.

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