View Single Post
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-28-2012 , 12:08   Re: Plugin Last & Plugin Shop.
#27

Je pense que c'est mieux comme ça :

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

#define VERSION "0.0.1"
#define PLUGIN "Deagle 1 Clip"

#define m_pActiveItem 373

public plugin_init()
{
    
register_plugin.plugin_name=PLUGIN,.version=VERSION,.author="ConnorMcLeod"
    
register_message.iMsgId=get_user_msgid(.name="CurWeapon"),.szFunction="Message_CurWeapon"
}

public 
Message_CurWeaponiMsgIdiMsgDestid )
{
    static 
iClip
    
if(    get_msg_arg_int(.argn=1)
    &&    
get_msg_arg_int(.argn=2) == CSW_DEAGLE
    
&&    ( iClip get_msg_arg_int(.argn=3) ) > )
    {
        new 
deagle=get_pdata_cbase(.id=id,.offset=m_pActiveItem)
        
set_msg_arg_int.argn=3,.argtype=ARG_BYTE,.iValue=1
        cs_set_weapon_ammo
.index=deagle,.newammo=1
        cs_set_user_bpammo
.index=id,.weapon=CSW_DEAGLE,.amount=cs_get_user_bpammo(.index=id,.weapon=CSW_DEAGLE)+iClip-1
    
}

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 02-28-2012 at 12:12.
ConnorMcLeod is offline