|
Junior Member
Join Date: Apr 2019
Location: Russia
|

04-15-2019
, 02:46
Re: Error in Plugins
|
#5
|
Quote:
Originally Posted by Krtola
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(2 : 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;
}
Last edited by OST_Aloe; 04-15-2019 at 02:47.
|
|