Raised This Month: $ Target: $400
 0% 

[REQ] Want a plugin to display player stats.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Akshat
Senior Member
Join Date: Feb 2013
Location: India, Jaipur.
Old 01-26-2015 , 12:18   [REQ] Want a plugin to display player stats.
Reply With Quote #1

I want a plugin to display player name, health , kills, deaths in a permanent HUD message
__________________
Learning Pawn [3% Complete!]
Akshat is offline
Send a message via Skype™ to Akshat
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 01-26-2015 , 12:41   Re: [REQ] Want a plugin to display player stats.
Reply With Quote #2

There are so many plugins that do this. Please search.
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
Akshat
Senior Member
Join Date: Feb 2013
Location: India, Jaipur.
Old 01-26-2015 , 13:20   Re: [REQ] Want a plugin to display player stats.
Reply With Quote #3

I tried to do it but couldn't find it, can you provide the link?
__________________
Learning Pawn [3% Complete!]

Last edited by Akshat; 01-26-2015 at 13:20.
Akshat is offline
Send a message via Skype™ to Akshat
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 01-26-2015 , 13:40   Re: [REQ] Want a plugin to display player stats.
Reply With Quote #4

Quote:
Originally Posted by Akshat View Post
I tried to do it but couldn't find it, can you provide the link?
It is hard to link to search results. For this one, I searched for *HUD* stat* In-Titles only, and only in the AMX Mod X section of the forums.
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
sirerick
Senior Member
Join Date: Jul 2012
Location: Venezuela
Old 01-26-2015 , 14:44   Re: [REQ] Want a plugin to display player stats.
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <fun>

#define PLUGIN "hud-stats"
#define VERSION "1.0"
#define AUTHOR "Erick"

new g_playername[33][32]
new 
Hudcomun

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
Hudcomun CreateHudSyncObj()
}

public 
client_putinserver(id)
{
    
set_task(1.0"ShowHUD"id+100__"b")
    
get_user_name(idg_playername[id], charsmax(g_playername[]))
}

public 
client_disconnect(id)
{
    
remove_task(id+100)
}

public 
ShowHUD(id)
{
    
id-=100
    
    
if(!is_user_alive(id)) return
    {
        
set_hudmessage(0501000.00.1811.01.01.01.0)
        
ShowSyncHudMsg(idHudcomun,"Name: %s ^nHealth: %d ^nKills: %d ^nDeaths: %d"g_playername[id], get_user_health(id), get_user_frags(id), get_user_deaths(id))
    }


Last edited by sirerick; 01-26-2015 at 14:58.
sirerick is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 01-26-2015 , 14:47   Re: [REQ] Want a plugin to display player stats.
Reply With Quote #6

PHP Code:
get_user_frags(id);
get_user_deaths(id); 
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
sirerick
Senior Member
Join Date: Jul 2012
Location: Venezuela
Old 01-26-2015 , 15:01   Re: [REQ] Want a plugin to display player stats.
Reply With Quote #7

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
PHP Code:
get_user_frags(id);
get_user_deaths(id); 
ty, edit.
sirerick is offline
Akshat
Senior Member
Join Date: Feb 2013
Location: India, Jaipur.
Old 01-27-2015 , 05:34   Re: [REQ] Want a plugin to display player stats.
Reply With Quote #8

Quote:
Originally Posted by sirerick View Post
PHP Code:
#include <amxmodx>
#include <fun>

#define PLUGIN "hud-stats"
#define VERSION "1.0"
#define AUTHOR "Erick"

new g_playername[33][32]
new 
Hudcomun

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
Hudcomun CreateHudSyncObj()
}

public 
client_putinserver(id)
{
    
set_task(1.0"ShowHUD"id+100__"b")
    
get_user_name(idg_playername[id], charsmax(g_playername[]))
}

public 
client_disconnect(id)
{
    
remove_task(id+100)
}

public 
ShowHUD(id)
{
    
id-=100
    
    
if(!is_user_alive(id)) return
    {
        
set_hudmessage(0501000.00.1811.01.01.01.0)
        
ShowSyncHudMsg(idHudcomun,"Name: %s ^nHealth: %d ^nKills: %d ^nDeaths: %d"g_playername[id], get_user_health(id), get_user_frags(id), get_user_deaths(id))
    }

Thanks a lot!, but I think set_task should be 0.1 seconds.
__________________
Learning Pawn [3% Complete!]

Last edited by Akshat; 01-27-2015 at 05:35.
Akshat is offline
Send a message via Skype™ to Akshat
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 01-27-2015 , 12:22   Re: [REQ] Want a plugin to display player stats.
Reply With Quote #9

A better one:
PHP Code:
#include <amxmodx>
#include <fun>

#define PLUGIN "hud-stats"
#define VERSION "1.0"
#define AUTHOR "Erick"

new g_playername[33][32], Hudcomun

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
set_task(1.0"ShowHUD"41231__"b")
    
Hudcomun CreateHudSyncObj()
}

public 
client_putinserver(id)
    
get_user_name(idg_playername[id], charsmax(g_playername[]))

public 
ShowHUD()
{
    new 
players[32], num
    get_players
(playersnum"ach")
    
set_hudmessage(0501000.00.1811.01.01.01.0)
    
    for(new 
inumi++)
        
ShowSyncHudMsg(players[i], Hudcomun,"Name: %s ^nHealth: %d ^nKills: %d ^nDeaths: %d"g_playername[players[i]], get_user_health(players[i]), get_user_frags(players[i]), get_user_deaths(players[i]))

__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
choloo
Senior Member
Join Date: Nov 2014
Location: Groznyj, Chechnya
Old 01-27-2015 , 14:20   Re: [REQ] Want a plugin to display player stats.
Reply With Quote #10

The best you are looking for, this not show Health (useless showing Hp because you can see
player's health on the left side), this will show you: Name/Kills/Eff %/Deaths/Rank
Players can also hide that hud with command: /hideme
Cvars:
sai_enabled "1"
sai_show_admin "1"
sai_on_join "1"
sai_positive_color "0 160 0"
sai_standard_color "255 255 0"
sai_negative_color "255 0 0"

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <csstats>
#include <hamsandwich>

#define PLUGIN      "Score Admin Info"
#define VERSION     "1.1"
#define AUTHOR      "vato loco [GE-S]"
#define PLUGIN_CVAR "score_admin_info"

#define MAX_PLAYERS       32 + 1
#define MAX_NAME_LENGTH   31 + 1
#define MAX_CVARS         6
#define MAX_CHACHE_CVARS  3
#define MSG_DELAY         90.0
#define ACCESS_HIDE       ADMIN_BAN

enum KILLS 0DEATHSCORE_TYPES }
enum RED 0GREENBLUEMSG_COLORS }
enum POSITIVE 0STANDARD ,NEGATIVEMSG_TYPES }

new 
g_Blank[] = ""
new g_ClassName[] = "sai_info"
new Float:g_fLastMsg
new Float:g_fMsgDelay MSG_DELAY
new bool:g_bShowScore[MAX_PLAYERS]
new 
bool:g_bIsAdmin[MAX_PLAYERS]
new 
bool:g_bIsAlive[MAX_PLAYERS]
new 
bool:g_bIsConnected[MAX_PLAYERS]
new 
bool:g_bIsBot[MAX_PLAYERS]
new 
g_iRank[MAX_PLAYERS]
new 
g_iPlayerName[MAX_PLAYERS][MAX_NAME_LENGTH]
new 
g_iScore[MAX_PLAYERS][SCORE_TYPES]
new 
g_pCvar[MAX_CVARS]
new 
g_CachepCvar[MAX_CHACHE_CVARS]
new 
g_iColor[MSG_TYPES][MSG_COLORS]
new 
g_SyncScoreInfo
new g_iMaxStats
new g_iMaxPlayers 

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar(PLUGIN_CVARVERSIONFCVAR_SERVER|FCVAR_SPONLY0.0)
    
    
register_think(g_ClassName,"ForwardThink")
    
    
register_event("HLTV""ev_RoundStart""a""1=0""2=0")
    
register_event("ScoreInfo""ev_ScoreInfo""a")
    
    
RegisterHam(Ham_Spawn"player""client_alive"1)
    
RegisterHam(Ham_Killed"player""client_alive"1)
    
    
register_clcmd("say /myscore""client_showscore")
    
register_clcmd("say .myscore""client_showscore")
    
register_clcmd("say /ms""client_showscore")
    
register_clcmd("say .ms""client_showscore")
    
register_clcmd("say_team /myscore""client_showscore")
    
register_clcmd("say_team .myscore""client_showscore")
    
register_clcmd("say_team /ms""client_showscore")
    
register_clcmd("say_team .ms""client_showscore")
    
register_clcmd("say /hideme""client_hide"ACCESS_HIDE)
    
register_clcmd("say .hideme""client_hide"ACCESS_HIDE)
    
register_clcmd("say_team /hideme""client_hide"ACCESS_HIDE)
    
register_clcmd("say_team .hideme""client_hide"ACCESS_HIDE)
    
    
g_pCvar[0] = register_cvar("sai_enabled""1")
    
g_pCvar[1] = register_cvar("sai_show_admin""1")
    
g_pCvar[2] = register_cvar("sai_on_join""1")
    
g_pCvar[3] = register_cvar("sai_positive_color""0 160 0")
    
g_pCvar[4] = register_cvar("sai_standard_color""255 255 0")
    
g_pCvar[5] = register_cvar("sai_negative_color""255 0 0")
    
    
g_SyncScoreInfo CreateHudSyncObj()
    
g_iMaxPlayers get_maxplayers()
    
    new 
iEnt create_entity("info_target")
    
entity_set_string(iEntEV_SZ_classnameg_ClassName)
    
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 1.0)
}

public 
plugin_cfg()
{
    
set_task(0.5"ev_RoundStart")
}

public 
client_putinserver(id)
{
    
g_bIsConnected[id] = true
    g_bIsBot
[id] = bool:is_user_bot(id)
    if(!
g_bIsBot[id])
    {
        
g_bShowScore[id] = bool:g_CachepCvar[2]
        
g_bIsAdmin[id] = bool:is_user_admin(id)
    }
    
get_user_name(idg_iPlayerName[id], 31)
}

public 
client_disconnect(id)
{
    
g_bIsAlive[id] = false
    g_bIsConnected
[id] = false
    g_bShowScore
[id] = false
    g_bIsAdmin
[id] = false
    g_bIsBot
[id] = false
}

public 
client_infochanged(id)

    
get_user_info(id"name"g_iPlayerName[id], 31)
}

public 
client_showscore(id)
{
    
g_bShowScore[id] = !g_bShowScore[id]
    
client_print(idprint_centerg_bShowScore[id] ? "Show Score Enabled" "Show Score Disabled")
}

public 
client_hide(idlvlcid)
{
    if(!
cmd_access(idlvlcid1))
    {
        return 
PLUGIN_HANDLED
    
}
    
g_bIsAdmin[id] = !g_bIsAdmin[id]
    
client_print(idprint_centerg_bIsAdmin[id] ? "Hide Modus Disabled" "Hide Modus Enabled")
    
    return 
PLUGIN_CONTINUE
}

public 
client_alive(id)
{
    
g_bIsAlive[id] = bool:is_user_alive(id)
}

public 
ev_RoundStart()
{
    
g_CachepCvar[0] = get_pcvar_num(g_pCvar[0])
    
g_CachepCvar[1] = get_pcvar_num(g_pCvar[1])
    
g_CachepCvar[2] = get_pcvar_num(g_pCvar[2])
    
    
GetCvarColor(g_pCvar[3], g_iColor[POSITIVE][RED], g_iColor[POSITIVE][GREEN], g_iColor[POSITIVE][BLUE])
    
GetCvarColor(g_pCvar[4], g_iColor[STANDARD][RED], g_iColor[STANDARD][GREEN], g_iColor[STANDARD][BLUE])
    
GetCvarColor(g_pCvar[5], g_iColor[NEGATIVE][RED], g_iColor[NEGATIVE][GREEN], g_iColor[NEGATIVE][BLUE])
    
    new 
stats[8], bodyhits[8], id
    g_iMaxStats 
get_statsnum()
    
    for(
id 1id <= g_iMaxPlayersid++)
    {
        if(
g_bIsConnected[id])
        {
            
g_iRank[id] = get_user_stats(idstatsbodyhits)
        }
    }
}

public 
ev_ScoreInfo()
{
    
g_iScore[read_data(1)][KILLS] = read_data(2)
    
g_iScore[read_data(1)][DEATH] = read_data(3)
}

public 
ForwardThink(iEnt)  
{
    if(
g_CachepCvar[0])
    {
        static 
idtargetspecmode
        
        
for(id 1id <= g_iMaxPlayersid++) 
        {
            if(
g_bIsConnected[id])
            {
                
specmode entity_get_int(idEV_INT_iuser1
                
                if(
g_bIsAlive[id])
                {
                    if(
g_bShowScore[id])
                    {
                        
ShowPlayerInfo(idg_iScore[id][KILLS], g_iScore[id][DEATH], 0.86g_Blankg_Blankg_iRank[id])
                    }
                }
                else if(
specmode == || specmode == 4
                {
                    
target entity_get_int(idEV_INT_iuser2
                    if(
target && target != id)
                    {
                        
ShowPlayerInfo(idg_iScore[target][KILLS], g_iScore[target][DEATH], 0.81g_CachepCvar[1] ? g_bIsAdmin[target] ? "| Status: Admin |" g_Blank g_Blankg_iPlayerName[target], g_iRank[target])
                    }
                }
            }
        }
    }
    
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 0.1)


ShowPlayerInfo(idiFragsiDeathFloat:yPossAdmin[], sName[], iRank)  
{
    if(!
g_bIsBot[id])
    {
        static 
Float:fEffFloat:fGameTimergb
        fGameTime 
get_gametime()
        
fEff = (100.0 float(iFrags) / float(iFrags iDeath))
        
        if(
iFrags iDeath)
        { 
            
g_iColor[POSITIVE][RED]
            
g_iColor[POSITIVE][GREEN]
            
g_iColor[POSITIVE][BLUE]
        }
        else if(
iFrags == iDeath)
        {
            
g_iColor[STANDARD][RED]
            
g_iColor[STANDARD][GREEN
            
g_iColor[STANDARD][BLUE]
        }
        else if(
iFrags iDeath)
        {
            
g_iColor[NEGATIVE][RED]
            
g_iColor[NEGATIVE][GREEN]
            
g_iColor[NEGATIVE][BLUE]
        }
        if(
g_fLastMsg g_fMsgDelay <= fGameTime)
        {
            
client_print(idprint_chatg_bShowScore[id] ? "[AMXX] Type In Chat /myscore To Disable Your Score In Hud." "[AMXX] Type In Chat /myscore To Enable Your Score In Hud.")
            
g_fLastMsg fGameTime
        
}
        
set_hudmessage(rgb, -1.0yPos__0.2__, -1)
        
ShowSyncHudMsg(idg_SyncScoreInfo"%s^n| Kills: %d | Eff: %0.2f%% | Death: %d |^n%s Rank: %d of %d"sAdminiFragsfEffiDeathsNameiRankg_iMaxStats)
    }
}

GetCvarColor(cvar, &r, &g, &b)  
{
    static 
colors[16], piece[5]
    
get_pcvar_string(cvarcolors15)
    
    
strbreak(colorspiece4colors15)
    
str_to_num(piece)
    
    
strbreak(colorspiece4colors15)
    
str_to_num(piece)
    
str_to_num(colors)

[img]http://s10.************/j2lvlrtdx/image.jpg[/img][img]http://s2.************/ul3bu0d1h/image.jpg[/img][img]http://s7.************/6lpil23h3/image.jpg[/img]
choloo is offline
Reply



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 12:04.


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