AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Help / Support Error in Plugins (https://forums.alliedmods.net/showthread.php?t=315579)

OST_Aloe 04-14-2019 07:52

Error in Plugins
 
Hi, my English is bad, so I don’t understand everything.
I get errors when compiling the plugin.
Quote:

zp_zclass_assasin.sma(5) : error 041: invalid ellipsis, array size is not known
zp_zclass_assasin.sma(43) : error 017: undefined symbol "register_plugin"
zp_zclass_assasin.sma(44) : error 017: undefined symbol "register_forward"
zp_zclass_assasin.sma(45) : error 017: undefined symbol "register_clcmd"
zp_zclass_assasin.sma(51) : error 017: undefined symbol "zp_register_zombie_class"
zp_zclass_assasin.sma(58) : error 017: undefined symbol "zp_get_user_zombie_class"
zp_zclass_assasin.sma(60) : error 017: undefined symbol "get_user_health"
zp_zclass_assasin.sma(61) : error 017: undefined symbol "set_pev"
zp_zclass_assasin.sma(62) : warning 204: symbol is assigned a value that is never used: "ZM_HP"
zp_zclass_assasin.sma(63) : error 017: undefined symbol "zp_get_user_zombie_class"
zp_zclass_assasin.sma(67) : error 017: undefined symbol "zp_get_user_zombie"
zp_zclass_assasin.sma(71) : error 017: undefined symbol "zp_get_user_nemesis"
zp_zclass_assasin.sma(75) : error 017: undefined symbol "set_pev"
zp_zclass_assasin.sma(76) : error 017: undefined symbol "client_cmd"
zp_zclass_assasin.sma(76) : error 017: undefined symbol "e"
zp_zclass_assasin.sma(76) : error 017: undefined symbol "USE"
zp_zclass_assasin.sma(76) : fatal error 107: too many error messages on one line
Код:
new MODEL_NUM[8][0] =
{
{
122, ...
},
{
122, ...
},
{
122, ...
},
{
122, ...
},
{
122, ...
},
{
122, ...
},
{
122, ...
},
{
122, ...
}
};
new zclass_name[15] =
{
208, 144, 209, 129, 209, 129, 208, 176, 209, 129, 208, 184, 208, 189, 0
};
new zclass_info[21] =
{
208, 161, 208, 186, 209, 128, 209, 139, 209, 130, 208, 189, 208, 190, 209, 129, 209, 130, 209, 140, 0
};
new zclass_clawmodel[26] =
{
122, 111, 109, 98, 105, 101, 115, 47, 104, 97, 110, 100, 115, 95, 97, 115, 115, 97, 115, 105, 110, 46, 109, 100, 108, 0
};
new g_zclass_spy;
public plugin_init()
{
register_plugin("[ZP] Class : Assasin", "1.2.2", "NullWarez");
register_forward(104, "fm_PlayerPreThink", MODEL_NUM);
register_clcmd("zp_drop_gun", "drop_gun", -1, 1108, -1);
return 0;
}

public plugin_precache()
{
g_zclass_spy = zp_register_zombie_class(zclass_name, zclass_info, MODEL_NUM[random(8)], zclass_clawmodel, "zp_human_man_1", 300, 1060320051, 1080033280);
return 0;
}

public zp_user_infected_post(player, infector)
{
new var1;
if (g_zclass_spy == zp_get_user_zombie_class(infector) && zp_get_user_zombie(infector))
{
new ZM_HP = get_user_health(infector) - 1500;
set_pev(infector, 41, float(ZM_HP));
}
if (g_zclass_spy != zp_get_user_zombie_class(player))
{
return 0;
}
if (!zp_get_user_zombie(player))
{
return 0;
}
if (zp_get_user_nemesis(player))
{
return 0;
}
set_pev(player, 77, 4);
client_cmd(player, "bind \"e\" \"+USE;zp_drop_gun\"");
new usp_clip = give_item(player, "weapon_usp");
cs_set_weapon_ammo(usp_clip, 3);
set_task(1036831949, "AddHP", player, 1292, MODEL_NUM, 1296, MODEL_NUM);
return 0;
}

public fm_PlayerPreThink(id)
{
if (!is_user_alive(id))
{
return 0;
}
if (g_zclass_spy != zp_get_user_zombie_class(id))
{
return 0;
}
if (!zp_get_user_zombie(id))
{
return 0;
}
if (zp_get_user_nemesis(id))
{
return 0;
}
set_pev(id, 77, 4);
if (pev(id, 84) & 16384)
{
set_pev(id, 40, 0);
return 0;
}
set_pev(id, 40, 1132396544);
return 0;
}

public drop_gun(id)
{
if (!is_user_alive(id))
{
return 0;
}
if (!zp_get_user_zombie(id))
{
return 0;
}
if (!g_zclass_spy == zp_get_user_zombie_class(id))
{
return 0;
}
if (zp_get_user_nemesis(id))
{
return 0;
}
new body;
new t;
get_user_aiming(id, t, body, 9999);
if (!is_user_alive(t))
{
return 0;
}
if (zp_get_user_zombie(t))
{
return 0;
}
if (zp_get_user_survivor(t))
{
return 0;
}
new P1_origin[3];
new P2_origin[3];
get_user_origin(id, P1_origin, MODEL_NUM);
get_user_origin(t, P2_origin, MODEL_NUM);
new distance = get_distance(P1_origin, P2_origin);
if (distance >= 120)
{
return 0;
}
drop_current_weapon(t);
return 0;
}

drop_current_weapon(id)
{
static ammo;
static clip;
static weapon_id;
weapon_id = get_user_weapon(id, clip, ammo);
new var1;
if (1 << weapon_id & 1509749160 || 1 << weapon_id & 67308546)
{
static weapon_name[32];
get_weaponname(weapon_id, weapon_name, 31);
engclient_cmd(id, "drop", weapon_name, 1460);
}
return 0;
}

public AddHP(id)
{
if (!zp_get_user_zombie(id))
{
return 0;
}
if (!g_zclass_spy == zp_get_user_zombie_class(id))
{
return 0;
}
if (zp_get_user_nemesis(id))
{
return 0;
}
if (!is_user_alive(id))
{
return 0;
}
new HP = get_user_health(id);
new max_HP = zp_get_zombie_maxhealth(id);
if (max_HP > HP + 8)
{
set_user_health(id, HP + 8);
}
if (8 > max_HP - HP)
{
set_user_health(id, max_HP);
}
set_task(1065353216, "AddHP", id, 1292, MODEL_NUM, 1296, MODEL_NUM);
return 0;
}

Krtola 04-14-2019 09:43

Re: Error in Plugins
 
where did u find this code?

OST_Aloe 04-14-2019 15:33

Re: Error in Plugins
 
Quote:

Originally Posted by Krtola (Post 2647485)
where did u find this code?

Why are you so interested?

Krtola 04-14-2019 17:52

Re: Error in Plugins
 
No specific reason. I just want to see original version. It looks to me that you edit a lot and make a lot mistakes.

OST_Aloe 04-14-2019 18:29

Re: Error in Plugins
 
Quote:

Originally Posted by Krtola (Post 2647552)
I just want to see original version. It looks to me that you edit a lot and make a lot mistakes.

I did not change this code. Just decompiled the plugin as it did not work.
Can you check this plugin?

OST_Aloe 04-14-2019 18:34

Re: Error in Plugins
 
1 Attachment(s)
Here is the plug-in.

Krtola 04-14-2019 18:41

Re: Error in Plugins
 
Amxx decompiling method will always give you bad code.
All I can do is try to find sma of that class.
Code from first post= it looks to me like deimos class. That class skill is to drop weapon from human hand.

OST_Aloe 04-14-2019 19:08

Re: Error in Plugins
 
Quote:

Originally Posted by Krtola (Post 2647559)
Amxx decompiling method will always give you bad code.
All I can do is try to find sma of that class.
Code from first post= it looks to me like deimos class. That class skill is to drop weapon from human hand.

Here the code will probably be better
ttps://c-s.net.ua/forum/topic88833.html

OST_Aloe 04-15-2019 02:46

Re: Error in Plugins
 
Quote:

Originally Posted by Krtola (Post 2647552)
I just want to see original version. It looks to me that you edit a lot and make a lot mistakes.

Errors
Quote:

zp_zclass_assasin.sma(28) : error 017: undefined symbol "register_plugin"
zp_zclass_assasin.sma(29) : error 017: undefined symbol "register_forward"
zp_zclass_assasin.sma(29) : warning 215: expression has no effect
zp_zclass_assasin.sma(29) : warning 215: expression has no effect
zp_zclass_assasin.sma(29) : error 001: expected token: ";", but found ")"
zp_zclass_assasin.sma(29) : error 029: invalid expression, assumed zero
zp_zclass_assasin.sma(29) : fatal error 107: too many error messages on one line
Here's a better code
Code:

new MODEL_NUM[8][] =
{
    "zp_human_woman_1",
    "zp_human_man_1",
    "zp_human_woman_2",
    "zp_human_man_2",
    "zp_human_woman_3",
    "zp_human_man_3",
    "zp_human_woman_4",
    "zp_human_woman_5"
};
new zclass_name[15] =
{
    208, 144, 209, 129, 209, 129, 208, 176, 209, 129, 208, 184, 208, 189, 0
}
new zclass_info[21] =
{
    208, 161, 208, 186, 209, 128, 209, 139, 209, 130, 208, 189, 208, 190, 209, 129, 209, 130, 209, 140, 0
}
new zclass_clawmodel[26] =
{
    122, 111, 109, 98, 105, 101, 115, 47, 104, 97, 110, 100, 115, 95, 97, 115, 115, 97, 115, 105, 110, 46, 109, 100, 108, 0
}
new g_zclass_spy;
 
public plugin_init()
{
    register_plugin("[ZP] Class : Assasin", "1.2.2", "NullWarez");
    register_forward(FM_PlayerPreThink, "fm_PlayerPreThink", 0);
    register_clcmd("zp_drop_gun", "drop_gun", -1, "", -1);
    return 0;
}
 
public plugin_precache()
{
    g_zclass_spy = zp_register_zombie_class(zclass_name, zclass_info, MODEL_NUM[random(8)][0][0], zclass_clawmodel, "zp_human_man_1", 300, 0.70/*1060320051*/, 3.50/*1080033280*/);
    return 0;
}
 
public zp_user_infected_post(player, infector)
{
    !!! Removed Phi
    if (g_zclass_spy == zp_get_user_zombie_class(infector) && zp_get_user_zombie(infector))
    {
        new ZM_HP = get_user_health(infector) - 1500;
        set_pev(infector, pev_health, float(ZM_HP));
    }
    if (g_zclass_spy != zp_get_user_zombie_class(player))
    {
        return 0;
    }
    if (!zp_get_user_zombie(player))
    {
        return 0;
    }
    if (zp_get_user_nemesis(player))
    {
        return 0;
    }
    set_pev(player, pev_rendermode, 4);
    client_cmd(player, "bind \"e\" \"+USE;zp_drop_gun\"");
    new usp_clip = give_item(player, "weapon_usp");
    cs_set_weapon_ammo(usp_clip, 3);
    set_task(0.10, "AddHP", player, "", 0, "", 0);
    return 0;
}
 
public fm_PlayerPreThink(id)
{
    if (!is_user_alive(id))
    {
        return 0;
    }
    if (g_zclass_spy != zp_get_user_zombie_class(id))
    {
        return 0;
    }
    if (!zp_get_user_zombie(id))
    {
        return 0;
    }
    if (zp_get_user_nemesis(id))
    {
        return 0;
    }
    set_pev(id, pev_rendermode, 4);
    if (pev(id, pev_flags) & 16384)
    {
        set_pev(id, pev_renderamt, 0);
        return 0;
    }
    set_pev(id, pev_renderamt, 255.00/*1132396544*/);
    return 0;
}
 
public drop_gun(id)
{
    if (!is_user_alive(id))
    {
        return 0;
    }
    if (!zp_get_user_zombie(id))
    {
        return 0;
    }
    if (!g_zclass_spy == zp_get_user_zombie_class(id))
    {
        return 0;
    }
    if (zp_get_user_nemesis(id))
    {
        return 0;
    }
    new body = 0;
    new t = 0;
    get_user_aiming(id, t, body, 9999);
    if (!is_user_alive(t))
    {
        return 0;
    }
    if (zp_get_user_zombie(t))
    {
        return 0;
    }
    if (zp_get_user_survivor(t))
    {
        return 0;
    }
    new P1_origin[3];
    new P2_origin[3];
    get_user_origin(id, P1_origin, 0);
    get_user_origin(t, P2_origin, 0);
    new distance = get_distance(P1_origin, P2_origin);
    if (distance >= 120)
    {
        return 0;
    }
    drop_current_weapon(t);
    return 0;
}
 
drop_current_weapon(id)
{
    !!! Removed Phi
    if (1 << weapon_id & 8899675000000000.00/*1509749160*/ || 1 << weapon_id & 67308546)
    {
        static weapon_name[32];
        get_weaponname(weapon_id, "", 31);
        engclient_cmd(id, "drop", "", "");
    }
    return 0;
}
 
public AddHP(id)
{
    !!! Removed Phi
    if (!zp_get_user_zombie(id))
    {
        return 0;
    }
    if (!g_zclass_spy == zp_get_user_zombie_class(id))
    {
        return 0;
    }
    if (zp_get_user_nemesis(id))
    {
        return 0;
    }
    if (!is_user_alive(id))
    {
        return 0;
    }
    new HP = get_user_health(id);
    new max_HP = zp_get_zombie_maxhealth(id);
    if (max_HP > HP + 8)
    {
        set_user_health(id, HP + 8);
    }
    if (8 > max_HP - HP)
    {
        set_user_health(id, max_HP);
    }
    set_task(1.00, "AddHP", id, "", 0, "", 0);
    return 0;
}


Krtola 04-15-2019 06:21

Re: Error in Plugins
 
I do not know how to fix this. When this error is corrected, then new ones appear.
Maybe this plugin need some special inc file.

https://www.dodaj.rs/image/cpJtm


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

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