Hi everybody, well I use a plugin that give a special hat to player but in new round the entity dont remove and appear this error:
L 12/22/2015 - 00:02:52: [ENGINE] Entity 0 can not be removed
L 12/22/2015 - 00:02:52: [AMXX] Displaying debug trace (plugin "zp50_extra_hatpumpkin.amxx", version "1.0")
L 12/22/2015 - 00:02:52: [AMXX] Run time error 10: native error (native "remove_entity")
L 12/22/2015 - 00:02:52: [AMXX] [0] zp50_extra_hatpumpkin_optimizado.sma::NewRoun d (line 11
this is the code:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#include <zp50_core>
#include <zp50_items>
#include <zp50_class_nemesis>
#include <zp50_class_survivor>
#define PLUGIN "[ZP50] Extra Item: Pumpkin Hat"
#define VERSION "1.0"
#define AUTHOR "tortuguin"
new const g_model[] = {"models/zombie_plague/pumpkin_hat.mdl"};
new const g_model2[] = {"models/zombie_plague/ghost_back.mdl"};
new const g_model3[] = {"models/zombie_plague/devil_pelvis.mdl"};
new g_pump[33];
new g_back[33];
new g_pelvis[33];
new item_hatpumpkin
new g_MaxPlayers
const COST = 5
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
item_hatpumpkin = zp_items_register ("Pumpkin Hat", COST)
register_event("HLTV", "NewRound", "a", "1=0", "2=0")
g_MaxPlayers = get_maxplayers()
}
public plugin_precache()
{
precache_model(g_model);
precache_model(g_model2);
precache_model(g_model3);
}
public zp_fw_items_select_pre(id, itemid, ignorecost)
{
if (itemid == item_hatpumpkin)
{
if (zp_class_nemesis_get(id) || zp_core_is_zombie(id) || zp_class_survivor_get(id))
return ZP_ITEM_DONT_SHOW;
return ZP_ITEM_AVAILABLE;
}
return ZP_ITEM_AVAILABLE;
}
public zp_fw_items_select_post(id, itemid, ignorecost)
{
if (itemid == item_hatpumpkin)
{
give_hat(id)
}
}
public give_hat(id)
{
g_pump[id] = create_entity( "info_target" );
entity_set_model(g_pump[id], g_model);
set_pev(g_pump[id], pev_movetype, MOVETYPE_FOLLOW);
set_pev(g_pump[id], pev_owner, id);
set_pev(g_pump[id], pev_aiment, id);
set_pev(g_pump[id], pev_body, 9);
set_rendering(g_pump[id], kRenderFxGlowShell, random_num(0, 255), random_num(0, 255), random_num(0, 255), kRenderNormal, 7);
g_back[id] = create_entity( "info_target" );
entity_set_model(g_back[id], g_model2);
set_pev(g_back[id], pev_movetype, MOVETYPE_FOLLOW);
set_pev(g_back[id], pev_owner, id);
set_pev(g_back[id], pev_aiment, id);
set_pev(g_back[id], pev_body, 1);
set_pev(g_back[id], pev_animtime, get_gametime())
set_pev(g_back[id], pev_framerate, 1.0)
set_pev(g_back[id], pev_sequence, 1)
g_pelvis[id] = create_entity( "info_target" );
entity_set_model(g_pelvis[id], g_model3);
set_pev(g_pelvis[id], pev_movetype, MOVETYPE_FOLLOW);
set_pev(g_pelvis[id], pev_owner, id);
set_pev(g_pelvis[id], pev_aiment, id);
set_pev(g_pelvis[id], pev_body, 0);
set_pev(g_pelvis[id], pev_animtime, get_gametime())
set_pev(g_pelvis[id], pev_framerate, 1.0)
set_pev(g_pelvis[id], pev_sequence, 0)
}
public zp_fw_core_infect_post(id, attacker)
{
if(g_pump[id])
{
remove_entity(g_pump[id]);
g_pump[id] = 0;
remove_entity(g_back[id]);
g_back[id] = 0;
remove_entity(g_pelvis[id]);
g_pelvis[id] = 0;
}
}
public NewRound()
{
for ( new id; id <= g_MaxPlayers; id++)
{
remove_entity(g_pump[id]);
g_pump[id] = 0;
remove_entity(g_back[id]);
g_back[id] = 0;
remove_entity(g_pelvis[id]);
g_pelvis[id] = 0;
}
}
I use amxx 1.8.3 amxx-dev-git4958, can someone tell how to fix this? ... thx in advance