I've got the following error:
Code:
L 11/21/2015 - 11:25:12: Start of error session.
L 11/21/2015 - 11:25:12: Info (map "cs_assault") (file "addons/amxmodx/logs/error_20151121.log")
L 11/21/2015 - 11:25:12: [ZP] Invalid Player (-1)
L 11/21/2015 - 11:25:12: [AMXX] Run time error 10 (plugin "zp_bot_addon_give_random_extras.amxx") (native "zp_force_buy_extra_item") - debug not enabled!
L 11/21/2015 - 11:25:12: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
I do not know what the problem is, how to fix?
Code:
#include < amxmodx >
#include < zombieplague >
new const VERSION[] = "1.0";
new g_max_players , g_has_extra[33] , cvar_give_extras_delay;
public plugin_init()
{
register_plugin("[ZP] Bot Addon: Give Random Extras", VERSION, "CrazY");
cvar_give_extras_delay = register_cvar("zp_give_extras_delay", "20.0");
g_max_players = get_maxplayers()
}
public zp_round_started()
set_task(get_pcvar_float(cvar_give_extras_delay), "GiveRandomExtraBot", 053, .flags="b");
public zp_round_ended()
{
if (task_exists(053)) remove_task(053);
g_has_extra[0] = false;
}
public GiveRandomExtraBot()
{
static iBotName[33], iBotsNum; iBotsNum = fnGetBot();
new BotID = fnGetRandomBot(random_num(1, iBotsNum));
get_user_name(BotID, iBotName, 32);
set_hudmessage(random(255), random(255), random(255), -1.0, 0.7, 1, 6.0, 1.1, 0.5, 0.5);
show_hudmessage(0, "O bot %s ganhou uma M249 Para Machinegun", iBotName);
zp_force_buy_extra_item(BotID, zp_get_extra_item_id("M249 Para Machinegun"), 1);
g_has_extra[BotID] = true;
}
stock fnGetBot()
{
new iBot, id;
for (id = 1; id <= g_max_players; id++)
{
if (is_user_bot(id) && is_user_connected(id)) iBot++;
}
return iBot;
}
stock fnGetRandomBot(target_index)
{
new iBot, id;
for (id = 1; id <= g_max_players; id++)
{
if (is_user_bot(id) && is_user_connected(id) && !zp_get_user_zombie(id) && !zp_get_user_survivor(id) && !g_has_extra[id]) iBot++;
if (iBot == target_index)
return id;
}
return -1;
}
__________________