Post by tousif on Jan 29, 2015 8:48:02 GMT
erros need to fix :
1. I need it under radar
2. name should be taken from pcvar
3. total damage in current session
4 . frags and deaths
5. total admins should be der when we in spec
plugin wokring but this errrors
1. I need it under radar
2. name should be taken from pcvar
3. total damage in current session
4 . frags and deaths
5. total admins should be der when we in spec
plugin wokring but this errrors
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <csx>
#include <engine>
const Float:HUD_SPECT_X = 0.6
const Float:HUD_SPECT_Y = 0.8
const Float:HUD_STATS_X = 0.01
const Float:HUD_STATS_Y = 0.28
const HUD_STATS_HUMAN_R = 0
const HUD_STATS_HUMAN_G = 200
const HUD_STATS_HUMAN_B = 250
const HUD_STATS_SPEC_R = 255
const HUD_STATS_SPEC_G = 255
const HUD_STATS_SPEC_B = 255
#define TASK_SHOWHUD 100
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)
const PEV_SPEC_TARGET = pev_iuser2
new g_MsgSync
new tag
new damage[33] = 0
new bool:g_bAdminNick
new bool:is_admin_connected[33]
new g_msg[512]
new g_ClassName[] = "admin_msg"
new g_iAdminCount
public plugin_init()
{
register_plugin(" HUD Information","1.0", "Gullu Bhai");
tag = register_cvar("hud_tag", "!mp3R!aL - sTr!KeRs Gam!nG");
register_think(g_ClassName,"ForwardThink");
g_MsgSync = CreateHudSyncObj()
new iEnt = create_entity("info_target")
entity_set_string(iEnt, EV_SZ_classname, g_ClassName)
entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
}
public client_putinserver(id)
{
if (!is_user_bot(id))
{
// Set the custom HUD display task
set_task(1.0, "ShowHUD", id+TASK_SHOWHUD, _, _, "b")
}
if(get_user_flags(id) & ADMIN_KICK)
{
is_admin_connected[id] = true
g_iAdminCount++
}
if(g_iAdminCount == 0)
{
}
}
public client_authorized(id) {
is_user_connected(id)
damage[id] = 0
}
public client_disconnect(id)
{
remove_task(id+TASK_SHOWHUD)
damage[id] = 0
if(is_admin_connected[id])
{
is_admin_connected[id] = false
g_iAdminCount--
}
}
public damage_event(id) {
new attacker = get_user_attacker(id)
if(is_user_alive(attacker)) {
static dmg
dmg = read_data(2)
damage[attacker] += dmg
}
}
public client_infochanged(id)
{
if(is_admin_connected[id])
{
static NewName[32], OldName[32]
get_user_info(id, "name", NewName, 31)
get_user_name(id, OldName, 31)
if(!equal(OldName, NewName))
{
g_bAdminNick = true
}
}
}
// Show HUD Task
public ShowHUD(taskid)
{
new player = ID_SHOWHUD
// Player dead?
if (!is_user_alive(player))
{
// Get spectating target
player = pev(player, PEV_SPEC_TARGET)
// Target not alive
if (!is_user_alive(player))
return;
}
// Format classname
static class_name[32], transkey[64]
new red, green, blue
if(is_user_alive(player))
{
new player_name[32]
get_user_name(player, player_name, charsmax(player_name))
new target, rank, szName[32]
static stats[8], body[8]
rank = get_user_stats(target, stats, body)
// Show name, health, class, and money
set_hudmessage(HUD_STATS_SPEC_R, HUD_STATS_SPEC_G, HUD_STATS_SPEC_B, HUD_SPECT_X, HUD_SPECT_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "%s^n[Kills: %d | Deaths: %d]^n[Rank: %i]^n[Total Damage: %d]^n[Admin Online: %d]", get_pcvar_num(tag), get_user_frags(target), get_user_deaths(target), rank, damage[player], g_iAdminCount )
}
else
{
new player_name[32]
get_user_name(player, player_name, charsmax(player_name))
new target, rank, szName[32]
static stats[8], body[8]
rank = get_user_stats(target, stats, body)
set_hudmessage(red, green, blue, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "%s^n[Kills: %d | Deaths: %d]^n[Rank: %i]^n[Total Damage: %d]", get_pcvar_num(tag), get_user_frags(player), get_user_deaths(player), rank, damage[player] )
}
}