Люди, помогите, не пойму где то ли строчка не правильно расположена то ли ещё что-то
ошибка в логах [AMXX] [1013] cso_hero.sma::make_hero (line 55)
Код:
Код:
#include < amxmodx >
#include < fakemeta >
#include < dhudmessage >
#include < hamsandwich >
#include < zombieplague >
native zp_override_user_model(id, const newmodel[], modelindex = 0)
native give_svdex(id)
native give_infinity(id)
//#pragma semicolon 1
#define PLUGIN "[ CSO ] Hero"
#define VERSION "1.0"
#define AUTHOR "Opo4uMapy"
#define TASK_HERO 123321
////////////////////**** CVARS ****////////////////////
#define BLOCK_HERO_DROP // Block drop ?
#define HERO_AFTER_ROUND
const Float:speed_hero = 400.0;
const Float:health_hero = 300.0;
const Float:armor_hero = 100.0;
const player_min = 2;
////////////////////**** CVARS END ****////////////////////
new g_hero[33];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_Item_PreFrame, "player", "PreFrame_Post", 1);
#if defined BLOCK_HERO_DROP
register_clcmd("drop", "clcmd_drop");
#endif
}
public make_hero()
{
remove_task(TASK_HERO);
new id;
static iPlayersNum;
iPlayersNum = Alive();
id = Random_Alive(random_num(1, iPlayersNum));
if(!is_user_alive(id))
{
make_hero()
return
}
g_hero[id] = true;
new name[32];
get_user_name(id, name, 31);
give_svdex(id)
give_infinity(id)
set_pev(id, pev_health, pev(id, pev_health) + health_hero);
set_pev(id, pev_armorvalue, pev(id, pev_armortype) + armor_hero);
set_pev(id, pev_maxspeed, speed_hero);
set_pev(id, pev_body, 7)
set_dhudmessage(0, 255, 0, 0.05, 0.45, 1, 0.0, 5.0, 1.0, 1.0);
show_dhudmessage(0, "%s стал Героем", name);
}
public zp_round_started()
{
if(zp_get_human_count() < player_min)
return
if(!zp_is_nemesis_round() && !zp_is_survivor_round())
set_task(1.0,"make_hero", TASK_HERO);
}
Random_Alive(n)
{
static Alive, id; Alive = 0;
for(id = 1; id <= get_maxplayers(); id++)
{
if(is_user_alive(id) && !zp_get_user_zombie(id))
Alive++;
if (Alive == n) return id;
}
return -1;
}
Alive()
{
static Alive = 0, id;
for(id = 1; id <= get_maxplayers(); id++)
{
if(is_user_alive(id) && !zp_get_user_zombie(id))
Alive++;
}
return Alive;
}
#if defined BLOCK_HERO_DROP
public clcmd_drop(id)
{
if(g_hero[id])
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}
#endif
public zp_user_infected_post(id, infector, nemesis) g_hero[id] = false;
public PreFrame_Post(id)
{
if(!is_user_alive(id)) return
if(g_hero[id])
set_pev(id, pev_maxspeed, speed_hero);
}
public zp_round_ended() { arrayset(g_hero, false, 33); remove_task(TASK_HERO);}
public plugin_natives() register_native("zp_get_user_hero", "native_get_user_hero", 1);
public native_get_user_hero(id) return g_hero[id];