AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HELP with reload (https://forums.alliedmods.net/showthread.php?t=213575)

risontek22 04-16-2013 11:52

HELP with reload
 
hi, i am working on some like this
PHP Code:

RegisterHam(Ham_Weapon_Reload,"player","Hrac_Reload")
public 
Hrac_Reload(id)
{
    if(
lq_player[id] == 1)
    {
        if(
user_has_weapon(id,CSW_DEAGLE))
        {
            
cs_set_user_bpammo(id,CSW_DEAGLE,1)
        }
        if(
user_has_weapon(id,CSW_AK47))
        {
            
cs_set_user_bpammo(id,CSW_AK47,1)
        }
        if(
user_has_weapon(id,CSW_M4A1))
        {
            
cs_set_user_bpammo(id,CSW_M4A1,1)
        }
        if(
user_has_weapon(id,CSW_AWP))
        {
            
cs_set_user_bpammo(id,CSW_AWP,1)
        }
        if(
user_has_weapon(id,CSW_M249))
        {
            
cs_set_user_bpammo(id,CSW_M249,1)
        }
    }


it is not working pls help :(

Bos93 04-16-2013 12:20

Re: HELP with reload
 
PHP Code:

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

new const WEAPONENTNAMES[ ][ ] =
{
    
"""weapon_p228""""weapon_scout""weapon_hegrenade""weapon_xm1014""weapon_c4""weapon_mac10",
    
"weapon_aug""weapon_smokegrenade""weapon_elite""weapon_fiveseven""weapon_ump45""weapon_sg550",
    
"weapon_galil""weapon_famas""weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249",
    
"weapon_m3""weapon_m4a1""weapon_tmp""weapon_g3sg1""weapon_flashbang""weapon_deagle""weapon_sg552",
    
"weapon_ak47""weapon_knife""weapon_p90"
}


#define IsValidPrivateData(%0) ( pev_valid( %0 ) == 2 )

const m_pPlayer 41;
const 
OFFSET_LINUX_WEAPONS 4;

public 
plugin_init(  )
{
    new 
iWeapon;

    for( 
iWeapon 1iWeapon sizeof WEAPONENTNAMESiWeapon++ )
    {
        if( 
WEAPONENTNAMESiWeapon ][ ] ) 
        {
            
RegisterHamHam_Weapon_ReloadWEAPONENTNAMESiWeapon ], "CBaseWeapon__Reload_Post", .Post true );
        }
    }
}

public 
CBaseWeapon__Reload_PostpEntity )
{
    if( !
IsValidPrivateDatapEntity ) )
    {
        return 
HAM_IGNORED;
    }

    new 
pPlayer get_pdata_cbasepEntity m_pPlayer OFFSET_LINUX_WEAPONS );

    switch( 
cs_get_weapon_idpEntity ) )
    {
        case 
CSW_DEAGLEcs_set_user_bpammopPlayer ,CSW_DEAGLE);
        case 
CSW_AK47cs_set_user_bpammopPlayer ,CSW_AK47);
        case 
CSW_M4A1cs_set_user_bpammopPlayer ,CSW_M4A1);
        case 
CSW_AWPcs_set_user_bpammopPlayer ,CSW_AWP);
        case 
CSW_M249cs_set_user_bpammopPlayer ,CSW_M249);
    }

    return 
HAM_IGNORED;



risontek22 04-17-2013 11:19

Re: HELP with reload
 
doesnt work :(

Podarok 04-17-2013 11:25

Re: HELP with reload
 
Quote:

Originally Posted by risontek22 (Post 1934398)
doesnt work :(

Contact layka_LUBII for help, he is a kind dog.

ConnorMcLeod 04-17-2013 13:22

Re: HELP with reload
 
Write again in a post to ask or contact layka_LUBII and i ask for a permanent ban against you.

EpicMonkey 04-17-2013 13:44

Re: HELP with reload
 
Quote:

Originally Posted by ConnorMcLeod (Post 1934501)
Write again in a post to ask or contact layka_LUBII and i ask for a permanent ban against you.

now that i like :3


All times are GMT -4. The time now is 10:50.

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