Hello, I have some weird player errors in Zombie Plague.
PHP Code:
L 01/05/2013 - 10:36:21: [ZP] Invalid Player (4)
L 01/05/2013 - 10:36:21: [AMXX] Displaying debug trace (plugin "zp50_item_infection_bomb.amxx")
L 01/05/2013 - 10:36:21: [AMXX] Run time error 10: native error (native "zp_core_infect")
L 01/05/2013 - 10:36:21: [AMXX] [0] zp50_item_infection_bomb.sma::infection_explode (line 323)
L 01/05/2013 - 10:36:21: [AMXX] [1] zp50_item_infection_bomb.sma::fw_ThinkGrenade (line 264)
And here are functions :
PHP Code:
// Ham Grenade Think Forward
public fw_ThinkGrenade(entity)
{
// Invalid entity
if (!pev_valid(entity)) return HAM_IGNORED;
// Get damage time of grenade
static Float:dmgtime
pev(entity, pev_dmgtime, dmgtime)
// Check if it's time to go off
if (dmgtime > get_gametime())
return HAM_IGNORED;
// Check if it's one of our custom nades
switch (pev(entity, PEV_NADE_TYPE))
{
case NADE_TYPE_INFECTION: // Infection Bomb
{
infection_explode(entity) // 264 line
return HAM_SUPERCEDE;
}
}
return HAM_IGNORED;
}
PHP Code:
// Infection Bomb Explosion
infection_explode(ent)
{
// Round ended
if (zp_gamemodes_get_current() == ZP_NO_GAME_MODE)
{
// Get rid of the grenade
engfunc(EngFunc_RemoveEntity, ent)
return;
}
// Get origin
static Float:origin[3]
pev(ent, pev_origin, origin)
// Make the explosion
create_blast(origin)
// Infection nade explode sound
static sound[SOUND_MAX_LENGTH]
ArrayGetString(g_sound_grenade_infect_explode, random_num(0, ArraySize(g_sound_grenade_infect_explode) - 1), sound, charsmax(sound))
emit_sound(ent, CHAN_WEAPON, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
// Get attacker
new attacker = pev(ent, pev_owner)
// Infection bomb owner disconnected or not zombie anymore?
if (!is_user_connected(attacker) || !zp_core_is_zombie(attacker))
{
// Get rid of the grenade
engfunc(EngFunc_RemoveEntity, ent)
return;
}
// Collisions
new victim = -1
while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, origin, NADE_EXPLOSION_RADIUS)) != 0)
{
// Only effect alive humans
if (!is_user_alive(victim) || zp_core_is_zombie(victim))
continue;
// Last human is killed
if (zp_core_get_human_count() == 1)
{
ExecuteHamB(Ham_Killed, victim, attacker, 0)
continue;
}
// Turn into zombie
zp_core_infect(victim, attacker) // 332 line
// Victim's sound
ArrayGetString(g_sound_grenade_infect_player, random_num(0, ArraySize(g_sound_grenade_infect_player) - 1), sound, charsmax(sound))
emit_sound(victim, CHAN_VOICE, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
// Get rid of the grenade
engfunc(EngFunc_RemoveEntity, ent)
}
Anyone know how to fix that?