06/05/2022, 10:42 PM
(Última modificación: 07/05/2022, 12:20 AM por Axon. Edited 1 time in total.)
Alguien puede editar este plugin de "bullet damage". En la cual los número se ven en el centro y quiero que se vea como un HUD:
Ejemplo de como quiero que se vea:
Tengo este plugin con las coordenadas y quiero que se vea como este:
Código PHP:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN "Damager HL"
#define VERSION "1.0"
#define AUTHOR "Half-Life"
new vict_dmg, kill_dmg, q3_snd
new const sound[] = {"AQS/hit.wav"}
public plugin_precache()
precache_sound(sound)
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_TakeDamage, "player", "on_damage_pre")
vict_dmg = register_cvar("amx_HL_show_victim", "1")
kill_dmg = register_cvar("amx_HL_show_agressor", "1")
q3_snd = register_cvar("amx_HL_q3_hit_sound", "1")
}
public on_damage_pre(victim, ent, agressor, Float:damage, bits)
{
if(Float:damage < 1.0 || !is_user_alive(victim)) return
new mode, real_damage, skip
if(victim && ent && agressor && victim != agressor)
mode = 1
else if(victim && !ent && !agressor)
mode = 2, skip = 1
else if(victim == agressor)
mode = 1, skip = 1
if(mode == 1)
{
new Float:dd = damage
new Float:value = float(get_user_armor(victim) * 2)
if(value < dd)
dd -= value
else if(value >= dd)
dd *= 0.2
real_damage = floatround(dd)
}
else if(mode == 2)
real_damage = floatround(damage)
else return
if(!is_user_bot(agressor) || !is_user_bot(victim))
{
new flags = pev(agressor, pev_flags)
if(!skip && flags & FL_CLIENT)
{
if(get_pcvar_num(kill_dmg))
client_print(agressor, print_center, "%d", real_damage)
if(get_pcvar_num(q3_snd))
client_cmd(agressor, "spk sound/AQS/hit.wav")
}
if(get_pcvar_num(vict_dmg))
client_print(victim, print_center, "-%d", real_damage)
}
}
Ejemplo de como quiero que se vea:
Tengo este plugin con las coordenadas y quiero que se vea como este:
Código PHP:
#include <amxmodx>
#define PLUGIN "Bullet Damage"
#define AUTHOR "Counter-Strike"
#define VERSION "1.0"
#define MAX_PLAYERS 32
new const Float:g_flCoords[][] =
{
{0.50, 0.40},
{0.56, 0.44},
{0.60, 0.50},
{0.56, 0.56},
{0.50, 0.60},
{0.44, 0.56},
{0.40, 0.50},
{0.44, 0.44}
}
new g_iPlayerPos[MAX_PLAYERS+1]
new g_iMaxPlayers
new g_pCvarEnabled
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_pCvarEnabled = register_cvar("bullet_damage", "1")
register_event("Damage", "Event_Damage", "b", "2>0", "3=0")
g_iMaxPlayers = get_maxplayers()
}
public Event_Damage( iVictim )
{
if( get_pcvar_num(g_pCvarEnabled) && (read_data(4) || read_data(5) || read_data(6)) )
{
new id = get_user_attacker(iVictim)
if( (1 <= id <= g_iMaxPlayers) && is_user_connected(id) )
{
new iPos = ++g_iPlayerPos[id]
if( iPos == sizeof(g_flCoords) )
{
iPos = g_iPlayerPos[id] = 0
}
set_hudmessage(218, 186, 22, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 1, 0.1, 2.5, 0.02, 0.02, -1)
show_hudmessage(id, "%d", read_data(2))
}
}
}