This plugin shows the total number of headshots by the player and if we spec someone it should show his total number of headshots. But am getting this error in console. Help!
PHP Code:
#include <amxmodx>
#include <engine>
new g_iHeadShots[33], g_iSync
public plugin_init()
{
register_plugin("HeadShot Counter", "1.0", "Flicker")
register_event("DeathMsg", "onDeathMsg", "a")
set_task(0.1, "showHeadShots", 21344, _, _, "b")
g_iSync = CreateHudSyncObj()
}
public onDeathMsg()
{
new id = read_data(1)
if(read_data(3) && is_user_connected(id))
g_iHeadShots[id]++
}
public showHeadShots(id)
{
new players[32], num
get_players(players, num, "ach")
if(!is_user_alive(id))
{
new target = entity_get_int(id, EV_INT_iuser2);
if(target == 0)
return PLUGIN_CONTINUE;
set_hudmessage(255, 255, 0, 0.6, -1.0, 0, 0.0, 0.3, 0.0, 0.0, 2);
for(new i; i < num; i++)
ShowSyncHudMsg(players[i], g_iSync, "Headshots : %i", g_iHeadShots[players[i]], target)
return PLUGIN_CONTINUE;
}
set_hudmessage(0, 255, 0, 0.02, 0.23, 0, 0.0, 0.3, 0.0, 0.0);
for(new i; i < num; i++)
ShowSyncHudMsg(players[i], g_iSync, "Headshots: %i", g_iHeadShots[players[i]])
return PLUGIN_CONTINUE;
}
public client_disconnect(id)
g_iHeadShots[id] = 0