Help please - cstrike to fakemeta
Hello, tell me please. Want to change a plug fakemet `y, but it does not work ( problem with cartridges ).
cstrike:
PHP Code:
#include < amxmodx > #include < amxmisc > #include < fakemeta_util > #include < cstrike >
public plugin_init( ) { register_plugin( "", "", "" ) register_message( get_user_msgid( "CurWeapon" ), "CurWeapon" ) }
public CurWeapon( msg_id, msg_dest, iPlayer ) { new wpn = get_msg_arg_int( 2 )
if( !( 0 < wpn <= 30 ) ) return PLUGIN_CONTINUE;
static client_oldwpn[ 33 ]
client_oldwpn[ iPlayer ] = wpn
if( wpn == CSW_C4 || wpn == CSW_HEGRENADE || wpn == CSW_FLASHBANG || wpn == CSW_SMOKEGRENADE || wpn == CSW_KNIFE ) return PLUGIN_CONTINUE;
new wpn_name[ 17 ] get_weaponname( wpn, wpn_name, 16 )
new wpn_id = fm_find_ent_by_owner( -1, wpn_name, iPlayer ) if( !wpn_id ) return PLUGIN_CONTINUE;
new clip = get_msg_arg_int( 3 ) new maxammo = 4
if( wpn == CSW_USP || wpn == CSW_M4A1 || wpn == CSW_TMP ) { if( wpn != CSW_TMP ) cs_set_weapon_silen( wpn_id, 1, 0 ) maxammo = 8
if( iPlayer < 33 ) { if( ( is_user_admin( iPlayer ) ) ) { cs_set_weapon_ammo( wpn_id, 12 ) if( clip != 12 )return PLUGIN_HANDLED; set_msg_arg_int( 3, ARG_BYTE, 12 ) return PLUGIN_CONTINUE; } } }
cs_set_user_bpammo( iPlayer, wpn, maxammo - clip ) if( clip > maxammo ) { set_msg_arg_int( 3, ARG_BYTE, maxammo ) cs_set_weapon_ammo( wpn_id, maxammo ) }
return PLUGIN_CONTINUE; }
fakemeta ( does not work ):
PHP Code:
#include < amxmodx > #include < amxmisc > #include < fakemeta_util > #include < fm_cstrike >
public plugin_init( ) { register_plugin( "", "", "" ) register_message( get_user_msgid( "CurWeapon" ), "CurWeapon" ) }
public CurWeapon( msg_id, msg_dest, iPlayer ) { new wpn = get_msg_arg_int( 2 )
if( !( 0 < wpn <= 30 ) ) return PLUGIN_CONTINUE;
static client_oldwpn[ 33 ]
client_oldwpn[ iPlayer ] = wpn
if( wpn == CSW_C4 || wpn == CSW_HEGRENADE || wpn == CSW_FLASHBANG || wpn == CSW_SMOKEGRENADE || wpn == CSW_KNIFE ) return PLUGIN_CONTINUE;
new wpn_name[ 17 ] get_weaponname( wpn, wpn_name, 16 )
new wpn_id = fm_find_ent_by_owner( -1, wpn_name, iPlayer ) if( !wpn_id ) return PLUGIN_CONTINUE;
new clip = get_msg_arg_int( 3 ) new maxammo = 4
if( wpn == CSW_USP || wpn == CSW_M4A1 || wpn == CSW_TMP ) { if( wpn != CSW_TMP ) fm_cs_set_weapon_silen( wpn_id, 1, 0 ) maxammo = 8
if( iPlayer < 33 ) { if( ( is_user_admin( iPlayer ) ) ) { fm_cs_set_weapon_ammo( wpn_id, 12 ) if( clip != 12 )return PLUGIN_HANDLED; set_msg_arg_int( 3, ARG_BYTE, 12 ) return PLUGIN_CONTINUE; } } }
fm_cs_set_user_bpammo( iPlayer, wpn, maxammo - clip ) if( clip > maxammo ) { set_msg_arg_int( 3, ARG_BYTE, maxammo ) fm_cs_set_weapon_ammo( wpn_id, maxammo ) }
return PLUGIN_CONTINUE; }
Many thanks in advance. Sorry for my English.
|