View Single Post
Author Message
Akshat
Senior Member
Join Date: Feb 2013
Location: India, Jaipur.
Old 01-26-2015 , 08:04   [HELP] Entity out of range
Reply With Quote #1

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
(playersnum"ach")
    
    if(!
is_user_alive(id))
    {
        new 
target entity_get_int(idEV_INT_iuser2);
        if(
target == 0)
            return 
PLUGIN_CONTINUE;
        
set_hudmessage(25525500.6, -1.000.00.30.00.02);
        for(new 
inumi++)
        
ShowSyncHudMsg(players[i], g_iSync"Headshots : %i"g_iHeadShots[players[i]], target)
        
        return 
PLUGIN_CONTINUE;
    }
    
set_hudmessage(025500.020.2300.00.30.00.0);
    for(new 
inumi++)
        
ShowSyncHudMsg(players[i], g_iSync"Headshots: %i"g_iHeadShots[players[i]])
    
    return 
PLUGIN_CONTINUE;


public 
client_disconnect(id)
    
g_iHeadShots[id] = 
Attached Images
File Type: jpg Screenshot_1.jpg (29.4 KB, 140 views)
__________________
Learning Pawn [3% Complete!]

Last edited by Akshat; 01-26-2015 at 08:06.
Akshat is offline
Send a message via Skype™ to Akshat