#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Hud Weapon Speed"
#define VERSION "2.0"
#define AUTHOR "ReymonARG"
#define MAX_PLAYERS 32
new pcv_iloc
new user_speed[MAX_PLAYERS+1][16]
new RGB
new cvar_x
new cvar_y
new hudsync
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("CurWeapon", "update_hud", "be", "1=1")
register_event("AmmoX", "draw_hud", "be")
pcv_iloc = register_cvar("hws_status", "1")
RGB = register_cvar("hws_color", "255000000")
cvar_x = register_cvar("hws_setx", "-1.0")
cvar_y = register_cvar("hws_sety", "0.90")
hudsync = CreateHudSyncObj()
}
public update_hud(id)
{
remove_hud_msg(id)
if( get_pcvar_num(pcv_iloc) == 0 || is_user_bot(id) )
return
static weapon[16], clip, ammo
switch(get_user_weapon(id, clip, ammo))
{
case CSW_P228:
weapon = "255"
case CSW_SCOUT:
weapon = "260"
case CSW_HEGRENADE:
weapon = "250"
case CSW_XM1014:
weapon = "240"
case CSW_MAC10:
weapon = "250"
case CSW_AUG:
weapon = "240"
case CSW_SMOKEGRENADE:
weapon = "250"
case CSW_ELITE:
weapon = "250"
case CSW_FIVESEVEN:
weapon = "250"
case CSW_UMP45:
weapon = "250"
case CSW_SG550:
weapon = "235"
case CSW_GALIL:
weapon = "240"
case CSW_FAMAS:
weapon = "240"
case CSW_USP:
weapon = "250"
case CSW_MP5NAVY:
weapon = "250"
case CSW_M249:
weapon = "220"
case CSW_M3:
weapon = "230"
case CSW_M4A1:
weapon = "230"
case CSW_TMP:
weapon = "250"
case CSW_G3SG1:
weapon = "210"
case CSW_FLASHBANG:
weapon = "250"
case CSW_DEAGLE:
weapon = "250"
case CSW_SG552:
weapon = "235"
case CSW_AK47:
weapon = "221"
case CSW_KNIFE:
weapon = "250"
case CSW_P90:
weapon = "245"
case CSW_GLOCK18:
weapon = "250"
case CSW_AWP:
weapon = "210"
case CSW_C4:
weapon = "250"
default:
return
}
user_speed[id] = weapon
draw_hud(id)
return
}
public draw_hud(id)
{
new color[10]
new r
new g
new b
get_pcvar_string(RGB, color, 9)
new c = str_to_num(color)
r = c / 1000000
c %= 1000000
g = c / 1000
b = c % 1000
//felhivni a HUD MSG-t
set_hudmessage(r, g, b, get_pcvar_float(cvar_x), get_pcvar_float(cvar_y), 0, 0.0, 2.0, 0.0, 0.5, -1)
ShowSyncHudMsg(id, hudsync, "A fegyver max sebessege: %s", user_speed[id])
}
public remove_hud_msg(id)
{
ClearSyncHud(id, hudsync)
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1038{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/