Raised This Month: $ Target: $400
 0% 

HELP with reload


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
risontek22
Member
Join Date: Mar 2013
Location: localhost
Old 04-16-2013 , 11:52   HELP with reload
Reply With Quote #1

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
risontek22 is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 04-16-2013 , 12:20   Re: HELP with reload
Reply With Quote #2

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;

__________________

Last edited by Bos93; 04-16-2013 at 12:21.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
risontek22
Member
Join Date: Mar 2013
Location: localhost
Old 04-17-2013 , 11:19   Re: HELP with reload
Reply With Quote #3

doesnt work
risontek22 is offline
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 04-17-2013 , 11:25   Re: HELP with reload
Reply With Quote #4

Quote:
Originally Posted by risontek22 View Post
doesnt work
Contact layka_LUBII for help, he is a kind dog.
Podarok is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-17-2013 , 13:22   Re: HELP with reload
Reply With Quote #5

Write again in a post to ask or contact layka_LUBII and i ask for a permanent ban against you.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 04-17-2013 , 13:44   Re: HELP with reload
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Write again in a post to ask or contact layka_LUBII and i ask for a permanent ban against you.
now that i like
EpicMonkey 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 10:50.


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