May I ask a question here? (I'm sorry for I have no Steam ID, so I'm afraid that I can't send the post to that 'help' forum)
it's this: I'm aiming the player, and I want to get the player's HP, but the plugin has appeared a wrong...It's only working at I'm attacking the target in beam weapons:-/
it's this: I'm aiming the player, and I want to get the player's HP, but the plugin has appeared a wrong...It's only working at I'm attacking the target in beam weapons:-/
Code:
/* AMX MOD X 1.8.1*/
#include <amxmodx>
#include <fakemeta>
new g_Aim_HudId, cvar_x, cvar_y
public plugin_init()
{
register_forward(FM_TraceLine, "fwTraceLinePost", 1)
g_Aim_HudId = CreateHudSyncObj(8)
cvar_x = register_cvar("amx_aim_x", "-1.0")
cvar_y = register_cvar("amx_aim_y", "0.6")
}
public fwTraceLinePost(Float:fStart[3], Float:fEnd[3], iConditions, id, iPtr)
{
if(!is_user_alive(id))
return
new iEnemy = get_tr2(iPtr, TR_pHit)
if(!is_user_alive(iEnemy))
return
new Float:fHealth
pev(iEnemy, pev_health, fHealth)
set_hudmessage(250, 0, 0, get_pcvar_float(cvar_x), get_pcvar_float(cvar_y), 0, 0.1, 0.1)
ShowSyncHudMsg(id, g_Aim_HudId, "%d", floatround(fHealth))
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg936\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
*/
Last edited: