L 01/08/2013 - 11:29:57: Plugin called message_begin with an invalid message id (0).
L 01/08/2013 - 11:29:57: [AMXX] Run time error 10 (plugin "zp50_class_human_seeker.amxx") (native "message_begin") - debug not enabled!
in this plugin
Spoiler
Code:
/*================================================================================
----------------------------------
-*- [ZP] Class: Human Seeker -*-
----------------------------------
This plugin is part of Zombie Plague Mod and is distributed under the
terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
================================================================================*/
#include <amxmodx>
#include <hamsandwich>
#include <zp50_core>
#include <zp50_class_nemesis>
#include <zp50_class_survivor>
#include <zp50_class_human>
// Classic Human Attributes
new const humanclass1_name[] = "Zombie Seeker"
new const humanclass1_info[] = "Show Zombies on Radar"
new const humanclass1_models[][] = { "h_man1" , "h_man2" , "h_man3" }
const humanclass1_health = 125
const Float:humanclass1_speed = 0.96
const Float:humanclass1_gravity = 1.0
new g_HumanClass_seeker
new g_msgHostageAdd
new g_msgHostageDel
new player_has_radar[33]
public plugin_precache()
{
register_plugin("[ZP] Class: Human Seeker", ZP_VERSION_STRING, "ZP Dev Team")
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
new index
g_HumanClass_seeker = zp_class_human_register(humanclass1_name, humanclass1_info, humanclass1_health, humanclass1_speed, humanclass1_gravity)
for (index = 0; index < sizeof humanclass1_models; index++)
zp_class_human_register_model(g_HumanClass_seeker, humanclass1_models[index])
g_msgHostageAdd = get_user_msgid("HostagePos")
g_msgHostageDel = get_user_msgid("HostageK")
set_task (2.0,"radar_scan",_,_,_,"b")
}
public zp_fw_core_spawn_post(id)
{
if(zp_class_survivor_get(id) || zp_core_is_zombie(id) || zp_class_nemesis_get(id))
return;
if(zp_class_human_get_current(id) == g_HumanClass_seeker)
{
player_has_radar[id] = true;
}
}
public zp_fw_core_cure_post(id)
{
if(zp_class_human_get_current(id) == g_HumanClass_seeker)
{
player_has_radar[id] = true;
}
}
public zp_fw_core_infect_post(id)
{
player_has_radar[id] = false;
}
public radar_scan()
{
new zombie_count = 0;
new zombie_list[32];
new ZombieCoords[3];
new id, i;
for (new id=1; id<=32; id++)
{
if (is_user_connected(id) && is_user_alive(id) && zp_core_is_zombie(id))
{
zombie_count++;
zombie_list[zombie_count]=id;
}
}
for (id=1; id<=32; id++)
{
if ((!is_user_alive(id)) || !(player_has_radar[id]) || zp_class_survivor_get(id)) continue;
for (i=1;i<=zombie_count;i++)
{
get_user_origin(zombie_list[i], ZombieCoords)
message_begin(MSG_ONE_UNRELIABLE, g_msgHostageAdd, {0,0,0}, id)
write_byte(id)
write_byte(i)
write_coord(ZombieCoords[0])
write_coord(ZombieCoords[1])
write_coord(ZombieCoords[2])
message_end()
message_begin(MSG_ONE_UNRELIABLE, g_msgHostageDel, {0,0,0}, id)
write_byte(i)
message_end()
}
}
}
public fw_PlayerKilled(victim, attacker, shouldgib)
{
player_has_radar[victim] = false;
}