AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help please - cstrike to fakemeta (https://forums.alliedmods.net/showthread.php?t=172225)

patrig 11-17-2011 11:36

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_messageget_user_msgid"CurWeapon" ), "CurWeapon" )
}

public 
CurWeaponmsg_idmsg_destiPlayer )
{
    new 
wpn get_msg_arg_int)

    if( !( 
wpn <= 30 ) )
        return 
PLUGIN_CONTINUE;

    static 
client_oldwpn33 ]        

    
client_oldwpniPlayer ] = wpn

    
if( wpn == CSW_C4 || wpn == CSW_HEGRENADE || wpn == CSW_FLASHBANG || wpn == CSW_SMOKEGRENADE ||    wpn == CSW_KNIFE )
        return 
PLUGIN_CONTINUE;

    new 
wpn_name17 ]
    
get_weaponnamewpnwpn_name16 )

    new 
wpn_id fm_find_ent_by_owner( -1wpn_nameiPlayer )
    if( !
wpn_id ) return PLUGIN_CONTINUE;

    new 
clip get_msg_arg_int)
    new 
maxammo 4

    
if( wpn == CSW_USP || wpn == CSW_M4A1 || wpn == CSW_TMP )
    {
        if( 
wpn != CSW_TMP cs_set_weapon_silenwpn_id1)
        
maxammo 8

        
if( iPlayer 33 )
        {
            if( ( 
is_user_adminiPlayer ) ) )
            {
                
cs_set_weapon_ammowpn_id12 )
                if( 
clip != 12 )return PLUGIN_HANDLED;
                
set_msg_arg_int3ARG_BYTE12 )
                return 
PLUGIN_CONTINUE;
            }
        }
    }

    
cs_set_user_bpammoiPlayerwpnmaxammo clip )
    if( 
clip maxammo )
    {
        
set_msg_arg_int3ARG_BYTEmaxammo )
        
cs_set_weapon_ammowpn_idmaxammo )
    }

    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_messageget_user_msgid"CurWeapon" ), "CurWeapon" )
}

public 
CurWeaponmsg_idmsg_destiPlayer )
{
    new 
wpn get_msg_arg_int)

    if( !( 
wpn <= 30 ) )
        return 
PLUGIN_CONTINUE;

    static 
client_oldwpn33 ]        

    
client_oldwpniPlayer ] = wpn

    
if( wpn == CSW_C4 || wpn == CSW_HEGRENADE || wpn == CSW_FLASHBANG || wpn == CSW_SMOKEGRENADE ||    wpn == CSW_KNIFE )
        return 
PLUGIN_CONTINUE;

    new 
wpn_name17 ]
    
get_weaponnamewpnwpn_name16 )

    new 
wpn_id fm_find_ent_by_owner( -1wpn_nameiPlayer )
    if( !
wpn_id ) return PLUGIN_CONTINUE;

    new 
clip get_msg_arg_int)
    new 
maxammo 4

    
if( wpn == CSW_USP || wpn == CSW_M4A1 || wpn == CSW_TMP )
    {
        if( 
wpn != CSW_TMP fm_cs_set_weapon_silenwpn_id1)
        
maxammo 8

        
if( iPlayer 33 )
        {
            if( ( 
is_user_adminiPlayer ) ) )
            {
                
fm_cs_set_weapon_ammowpn_id12 )
                if( 
clip != 12 )return PLUGIN_HANDLED;
                
set_msg_arg_int3ARG_BYTE12 )
                return 
PLUGIN_CONTINUE;
            }
        }
    }

    
fm_cs_set_user_bpammoiPlayerwpnmaxammo clip )
    if( 
clip maxammo )
    {
        
set_msg_arg_int3ARG_BYTEmaxammo )
        
fm_cs_set_weapon_ammowpn_idmaxammo )
    }

    return 
PLUGIN_CONTINUE;


Many thanks in advance. Sorry for my English.

Arkshine 11-17-2011 11:43

Re: Help please - cstrike to fakemeta
 
It's fine to use cstrike and is more efficient then fakemeta.

ConnorMcLeod 11-17-2011 11:50

Re: Help please - cstrike to fakemeta
 
And also it's better to use engine rather than fm_*** converted natives.

patrig 11-17-2011 11:51

Re: Help please - cstrike to fakemeta
 
Well... thanks for the answer.

ConnorMcLeod 11-17-2011 11:52

Re: Help please - cstrike to fakemeta
 
Well.. you should read this : http://forums.alliedmods.net/showthread.php?t=88792


All times are GMT -4. The time now is 08:27.

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