someone optimize code for me
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <csx>
#define TASK_PRESENTS 1337
#define TASK_SHOWHUD 2674
#define ID_PRESENTS (TaskIndex - TASK_PRESENTS)
#define ID_SHOWHUD (TaskIndex - TASK_SHOWHUD)
// Variabile
new MesajSync;
// Cvaruri
new cvar_hudenable
public plugin_init()
{
register_plugin("Hud Info", "1.1", "")
// Register Cvars
cvar_hudenable = register_cvar("credits_hudstats", "1")
// Register Messages
MesajSync = CreateHudSyncObj()
register_message(get_user_msgid("SayText"), "message")
register_logevent("round_start", 2, "1=Round_Start")
}
public client_putinserver(id)
{
set_task(1.0, "MesajHUD", id+TASK_SHOWHUD, .flags = "b")
}
public MesajHUD(TaskIndex)
{
static id
id = ID_SHOWHUD;
if (!is_user_alive(id))
{
id = pev(id, pev_iuser2)
if(!is_user_alive(id)) return;
}
if (get_pcvar_num(cvar_hudenable))
{
if(id != ID_SHOWHUD)
{
new name[32];
get_user_name(id, name, 31)
new stats[ 8 ], body[ 8 ];
new rank_pos = get_user_stats( id, stats, body )
new rank_max = get_statsnum( )
set_hudmessage(0, 100, 250, -1.0, 0.78, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "[ Spectating %s | Rank: %d/%d ]", name, rank_pos, rank_max)
}
}
}
__________________