AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved CS:GO Weapon Inspect error (https://forums.alliedmods.net/showthread.php?t=334998)

yRemootz 11-01-2021 17:43

CS:GO Weapon Inspect error
 
Hey guys, since now I want say sorry for my bad english, I'm brazillian.

So, I got 1 plugin called "CS:GO Weapon Inspect" and I replaced the
register_clcmd("cl_inspect", "Inspect_Weapon");
register_concmd("inspect", "Inspect_Weapon");

to
register_impulse(100, "Inspect_Weapon");


but when i compile, it shows an error called:

error 017: undefined symbol "register_impulse"

I will put the PHP Code in the comments
Thanks!

yRemootz 11-01-2021 17:44

Re: [REQ] CS:GO Weapon Inspect error
 
Here's the PHP Code guys, someone help me!

PHP Code:

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

const XoWeapon             4;
const 
XoPlayer                 5;
const 
m_pPlayer         41;
const 
m_flNextPrimaryAttack    46;
const 
m_flTimeWeaponIdle    48;
const 
m_fInSpecialReload     55;
const 
m_flNextAttack         83;
const 
m_pActiveItem         373;

new const 
PLUGIN[]    = "CS:GO Inspect Weapon";
new const 
VERSION[]     = "5.1";
new const 
DATE[]     = "20 November 2017";

new const 
wpns_without_inspect = (<< CSW_C4) | (<< CSW_HEGRENADE) | (<< CSW_FLASHBANG) | (<< CSW_SMOKEGRENADE);
new const 
wpns_scoped = (<< CSW_AUG) | (<< CSW_AWP) | (<< CSW_G3SG1) | (<< CSW_SCOUT) | (<< CSW_SG550) | (<< CSW_SG552);

new 
g_deagle_overide[33];

new 
inspect_anim[] = 
{
    
0,    //null
    
7,    //p228
    
0,    //shield
    
5,    //scout
    
0,    //hegrenade
    
7,    //xm1014
    
0,    //c4
    
6,    //mac10
    
6,    //aug
    
0,    //smoke grenade
    
16,    //elites
    
6,    //fiveseven
    
6,    //ump45
    
5,    //sg550
    
6,    //galil
    
6,    //famas
    
16,    //usp
    
13,    //glock
    
6,    //awp
    
6,    //mp5
    
5,    //m249
    
7,    //m3
    
14,    //m4a1
    
6,    //tmp
    
5,    //g3sg1
    
0,    //flashbang
    
6,    //deagle
    
6,    //sg552
    
6,    //ak47
    
8,    //knife
    
6    //p90
}

new 
Float:idle_calltime[] = 
{
    
0.0,    //null
    
5.2,    //p228
    
0.0,    //shield
    
5.0,    //scout
    
0.0,    //hegrenade
    
4.4,    //xm1014
    
0.0,    //c4
    
5.1,    //mac10
    
3.4,    //aug
    
0.0,    //smoke grenade
    
4.5,    //elites
    
5.2,    //fiveseven
    
5.3,    //ump45
    
5.2,    //sg550
    
3.7,    //galil
    
3.4,    //famas
    
6.1,    //usp
    
5.2,    //glock
    
5.0,    //awp
    
5.3,    //mp5
    
5.5,    //m249
    
4.5,    //m3
    
4.8,    //m4a1
    
5.8,    //tmp
    
3.5,    //g3sg1
    
0.0,    //flashbang
    
4.6,    //deagle
    
3.7,    //sg552
    
4.4,    //ak47
    
4.9,    //knife
    
4.2    //p90
}

new 
V_MODELS[][] = 
{
    
"null",
    
"models/v_p228.mdl",
    
"models/v_shield.mdl",
    
"models/v_scout.mdl",
    
"models/v_hegrenade.mdl",
    
"models/v_xm1014.mdl",
    
"models/v_c4.mdl",
    
"models/v_mac10.mdl",
    
"models/v_aug.mdl",
    
"models/v_smokegrenade.mdl",
    
"models/v_elite.mdl",
    
"models/v_fiveseven.mdl",
    
"models/v_ump45.mdl",
    
"models/v_sg550.mdl",
    
"models/v_galil.mdl",
    
"models/v_famas.mdl",
    
"models/v_usp.mdl",
    
"models/v_glock18.mdl",
    
"models/v_awp.mdl",
    
"models/v_mp5.mdl",
    
"models/v_m249.mdl",
    
"models/v_m3.mdl",
    
"models/v_m4a1.mdl",
    
"models/v_tmp.mdl",
    
"models/v_g3sg1.mdl",
    
"models/v_flashbang.mdl",
    
"models/v_deagle.mdl",
    
"models/v_sg552.mdl",
    
"models/v_ak47.mdl",
    
"models/v_knife.mdl",
    
"models/v_p90.mdl"
}

new 
V_MODELS_ALT[][] = 
{
    
"null",
    
"models/alt/v_p228.mdl",
    
"models/alt/v_shield.mdl",
    
"models/alt/v_scout.mdl",
    
"models/alt/v_hegrenade.mdl",
    
"models/alt/v_xm1014.mdl",
    
"models/alt/v_c4.mdl",
    
"models/alt/v_mac10.mdl",
    
"models/alt/v_aug.mdl",
    
"models/alt/v_smokegrenade.mdl",
    
"models/alt/v_elite.mdl",
    
"models/alt/v_fiveseven.mdl",
    
"models/alt/v_ump45.mdl",
    
"models/alt/v_sg550.mdl",
    
"models/alt/v_galil.mdl",
    
"models/alt/v_famas.mdl",
    
"models/alt/v_usp.mdl",
    
"models/alt/v_glock18.mdl",
    
"models/alt/v_awp.mdl",
    
"models/alt/v_mp5.mdl",
    
"models/alt/v_m249.mdl",
    
"models/alt/v_m3.mdl",
    
"models/alt/v_m4a1.mdl",
    
"models/alt/v_tmp.mdl",
    
"models/alt/v_g3sg1.mdl",
    
"models/alt/v_flashbang.mdl",
    
"models/alt/v_deagle.mdl",
    
"models/alt/v_sg552.mdl",
    
"models/alt/v_ak47.mdl",
    
"models/alt/v_knife.mdl",
    
"models/alt/v_p90.mdl"
}

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

public 
plugin_init()
{
    
register_plugin(PLUGINVERSION"hellmonja");
    
    for(new 
0sizeof weapon_classnamesi++)
        
RegisterHam(Ham_Weapon_PrimaryAttackweapon_classnames[i], "Fw_Weapon_PrimaryAttack"1);

    
RegisterHam(Ham_Item_Deploy"weapon_deagle""Fw_Deagle_Disable");
    
RegisterHam(Ham_Weapon_Reload"weapon_deagle""Fw_Deagle_Disable");
    
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_aug""Fw_Weapon_SecondaryAttack");
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_awp""Fw_Weapon_SecondaryAttack");
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_g3sg1""Fw_Weapon_SecondaryAttack");
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_scout""Fw_Weapon_SecondaryAttack");
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_sg550""Fw_Weapon_SecondaryAttack");
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_sg552""Fw_Weapon_SecondaryAttack");
    
    
register_impulse(100"Inspect_Weapon"); // Here's the line of the error
    
register_concmd("ver_csgo_inspect""Code_Version");
}

public 
Code_Version(id)
{
    
console_print(id"==============================");
    
console_print(id"%s v%s"PLUGINVERSION);
    
console_print(id"%s"DATE);
    
console_print(id"==============================");
}

public 
Fw_Weapon_PrimaryAttack(weapon)
{
    static 
id;
    
id get_pdata_cbase(weaponm_pPlayerXoWeapon);
    
    if(!
is_user_alive(id))
        return
    
    new 
wpn_id get_user_weapon(id);
    static 
model[32];
    
pev(idpev_viewmodel2model31);
            
    if(
equali(modelV_MODELS[wpn_id]) || equali(modelV_MODELS_ALT[wpn_id]))
    {
        switch(
wpn_id)
        {
            case 
CSW_DEAGLE:
                
g_deagle_overide[id] = 1;
            case 
CSW_AWPCSW_SCOUTCSW_M3:
                
set_pdata_float(weaponm_flTimeWeaponIdle1.5XoWeapon);
            case 
CSW_KNIFE:
                
set_pdata_float(weaponm_flTimeWeaponIdle2.0XoWeapon);
            default:
                
set_pdata_float(weaponm_flTimeWeaponIdle0.5XoWeapon);
        }
    }
}

public 
Fw_Weapon_SecondaryAttack(weapon)
{
    static 
id;
    
id get_pdata_cbase(weaponm_pPlayerXoWeapon);
    new 
wpn_id get_user_weapon(id);
    
    if(
wpns_scoped & (<< wpn_id) && cs_get_user_zoom(id) <= 1)
    {
        
set_pev(idpev_weaponanim0);
    
        
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, {000}, id);
        
write_byte(0);
        
write_byte(pev(idpev_body));
        
message_end();
    }
}

public 
Fw_Deagle_Disable(weapon)
{
    static 
id;
    
id get_pdata_cbase(weaponm_pPlayerXoWeapon);
    
remove_task(id)
}

public 
Deagle_Overide(id)
    
g_deagle_overide[id] = 1;
    
public 
Inspect_Weapon(id)
{
    if(!
is_user_alive(id) || !is_user_connected(id))
        return 
PLUGIN_HANDLED
        
    
if(cs_get_user_shield(id))
        return 
PLUGIN_HANDLED
        
    
if(cs_get_user_zoom(id) > 1)
        return 
PLUGIN_HANDLED
    
    
new wpn_id get_user_weapon(id);
    
    if(
wpns_without_inspect & (<< wpn_id))
        return 
PLUGIN_HANDLED

    
static weaponweapon get_pdata_cbase(idm_pActiveItem);
    static 
Float:flNextAttackflNextAttack get_pdata_float(idm_flNextAttackXoPlayer);
    static 
Float:flNextPrimaryAttackflNextPrimaryAttack get_pdata_float(weaponm_flNextPrimaryAttackXoWeapon);

    if(
flNextAttack <= && flNextPrimaryAttack <= 0)
    {    
        static 
model[32]; pev(idpev_viewmodel2model31);
        
        if(
equali(modelV_MODELS[wpn_id]) || equali(modelV_MODELS_ALT[wpn_id]))
        {    
            new 
anim inspect_anim[wpn_id];
            new 
current_anim pev(get_pdata_cbase(weaponm_pPlayerXoWeapon), pev_weaponanim);

            switch (
wpn_id)
            {
                case 
CSW_USP: if(!cs_get_weapon_silen(weapon)) anim 17;
                case 
CSW_M4A1:if(!cs_get_weapon_silen(weapon)) anim 15;
                case 
CSW_KNIFEanim random_num(810);
                
                case 
CSW_DEAGLE:
                    if(
wpn_id == CSW_DEAGLE && g_deagle_overide[id] == 1)
                    {
                        
play_inspect(idanim);
                        
remove_task(id);
                        
g_deagle_overide[id] = 0;
                        
set_task(idle_calltime[CSW_DEAGLE], "Deagle_Overide"id);
                        return 
PLUGIN_HANDLED
                    
}
            }
            
            if(
wpn_id == CSW_KNIFE && (current_anim == || current_anim == || current_anim == 10 ))
                return 
PLUGIN_HANDLED
            
            
if(!get_pdata_int(weaponm_fInSpecialReload4) && current_anim != anim)
            {
                
play_inspect(idanim);
                
set_pdata_float(weaponm_flTimeWeaponIdleidle_calltime[wpn_id], XoWeapon);
                
            }
        }
    }
    
    return 
PLUGIN_HANDLED
}

play_inspect(idanim)
{
    
set_pev(idpev_weaponanimanim);
    
    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, {000}, id);
    
write_byte(anim);
    
write_byte(pev(idpev_body));
    
message_end();    



Supremache 11-01-2021 17:56

Re: [REQ] CS:GO Weapon Inspect error
 
Quote:

Originally Posted by yRemootz (Post 2762220)
Hey guys, since now I want say sorry for my bad english, I'm brazillian.

So, I got 1 plugin called "CS:GO Weapon Inspect" and I replaced the
register_clcmd("cl_inspect", "Inspect_Weapon");
register_concmd("inspect", "Inspect_Weapon");

to
register_impulse(100, "Inspect_Weapon");


but when i compile, it shows an error called:

error 017: undefined symbol "register_impulse"

I will put the PHP Code in the comments
Thanks!

You need to update AMX MODX to use this native!

yRemootz 11-01-2021 17:58

Re: [REQ] CS:GO Weapon Inspect error
 
Quote:

Originally Posted by Supremache (Post 2762223)
You need to update AMX MODX to use this native!

The compiler is 1.10 and my server have the last Amx Mod X update

Supremache 11-01-2021 18:03

Re: [REQ] CS:GO Weapon Inspect error
 
Quote:

Originally Posted by yRemootz (Post 2762224)
The compiler is 1.10 and my server have the last Amx Mod X update

1. Be sure you updated include & modules.

2. if you updated it on your server you can use this way by calling native register_impulse(impulse, const function[]); without calling include file

yRemootz 11-01-2021 18:06

Re: [REQ] CS:GO Weapon Inspect error
 
Quote:

Originally Posted by Supremache (Post 2762225)
1. Be sure you updated include & modules.

2. if you updated it on your server you can use this way by calling native register_impulse(impulse, const function[]); without calling include file

I'm new in the Plugin's world, I really don't know what do you mean about, const function[]); (I don't know what I need put)

iceeedr 11-01-2021 18:12

Re: [REQ] CS:GO Weapon Inspect error
 
register_impulse is from engine.inc so #include <engine>

yRemootz 11-01-2021 18:16

Re: [REQ] CS:GO Weapon Inspect error
 
Quote:

Originally Posted by iceeedr (Post 2762227)
register_impulse is from engine.inc so #include <engine>

Well, It's work now, thanks for you help


All times are GMT -4. The time now is 05:11.

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