Raised This Month: $ Target: $400
 0% 

What happened with Show Target Plugin?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yl2401
Member
Join Date: Nov 2011
Old 07-10-2013 , 12:16   What happened with Show Target Plugin?
Reply With Quote #1

What happened? Thank You!

Error Message:
Quote:
L 07/09/2013 - 15:49:46: [CSTRIKE] Player out of range (0)
L 07/09/2013 - 15:49:46: [AMXX] Run time error 10 (plugin "show_target.amxx") (native "cs_get_user_team") - debug not enabled!
L 07/09/2013 - 15:49:46: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
My Sma:
PHP Code:
#include <amxmodx>
#include <cstrike>

#define PLUGIN_NAME    "Show Target Info"
#define PLUGIN_VERSION    "1.0"
#define PLUGIN_AUTHOR    "yl2401"

new show[4], dc[4]

public 
plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
}

public 
client_connect(id)
{
    
dc[id] = 0
    show
[id] = 1
    ShowHUD
(id)
}

public 
client_disconnect(id)
{
    
show[id] = 0
    dc
[id] = 1
}

public 
ShowHUD(id)
{
    if( 
show[id] && is_user_connected(id) && is_user_alive(id) && !is_user_bot(id) )
    {
        new 
entaimname[32]
        
get_user_aiming(identaim)
        
get_user_name(entnamecharsmax(name))
        if( 
cs_get_user_team(id) == cs_get_user_team(ent) )
        {
            if( 
cs_get_user_team(ent) == CS_TEAM_T )
            {
                
set_hudmessage(25500, -1.00.5311.00.00.10.23)
                
show_hudmessage(id"[Friend]%s - HP: %d / AP: %d"nameget_user_health(ent), get_user_armor(ent))
            }
            else if( 
cs_get_user_team(ent) == CS_TEAM_CT )
            {
                
set_hudmessage(00255, -1.00.5311.00.00.10.23)
                
show_hudmessage(id"[Friend]%s - HP: %d / AP: %d"nameget_user_health(ent), get_user_armor(ent))
            }
            else if( 
cs_get_user_team(ent) == CS_TEAM_SPECTATOR )
            {
                
set_hudmessage(100100100, -1.00.5311.00.00.10.23)
                
show_hudmessage(id"[Friend]%s - HP: %d / AP: %d"nameget_user_health(ent), get_user_armor(ent))
            }
        }
        else
        {
            if( 
cs_get_user_team(ent) == CS_TEAM_T )
            {
                
set_hudmessage(25500, -1.00.5311.00.00.10.23)
                
show_hudmessage(id"[Enemy]%s - HP: %d / AP: %d"nameget_user_health(ent), get_user_armor(ent))
            }
            else if( 
cs_get_user_team(ent) == CS_TEAM_CT )
            {
                
set_hudmessage(00255, -1.00.5311.00.00.10.23)
                
show_hudmessage(id"[Enemy]%s - HP: %d / AP: %d"nameget_user_health(ent), get_user_armor(ent))
            }
            else if( 
cs_get_user_team(ent) == CS_TEAM_SPECTATOR )
            {
                
set_hudmessage(100100100, -1.00.5311.00.00.10.23)
                
show_hudmessage(id"[SPEC]%s - HP: %d / AP: %d"nameget_user_health(ent), get_user_armor(ent))
            }
        }
    }
    else if(
dc[id]) { }
    else
        
set_task(0.1"ShowHUD"id)

yl2401 is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 07-10-2013 , 12:40   Re: What happened with Show Target Plugin?
Reply With Quote #2

After you use get_user_aiming, you need to check if ent is connected player.
This plugin is badly coded. If you just need "show target info" then it already exists in miscstats or you can get my version here.
__________________
Impossible is Nothing

Last edited by Sylwester; 07-10-2013 at 12:40.
Sylwester is offline
yl2401
Member
Join Date: Nov 2011
Old 07-12-2013 , 01:28   Re: What happened with Show Target Plugin?
Reply With Quote #3

Quote:
Originally Posted by Sylwester View Post
After you use get_user_aiming, you need to check if ent is connected player.
This plugin is badly coded. If you just need "show target info" then it already exists in miscstats or you can get my version here.
Oh, Thank You.
yl2401 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode