Senior Member
|
03-10-2018
, 17:38
Re: Bullet Damage [VIP]
|
#3
|
I tried something like this:
PHP Code:
#include <amxmodx> #include <amxmisc> #include <engine>
#define MAX_PLAYERS 32
new g_iMaxPlayers
new bool:g_bShowDamage[33];
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]
public plugin_init() { register_plugin("Damager only visible", "1.2 RC2", "neygomon"); register_event("Damage", "eDamage", "b", "2!0", "3=0", "4!0"); register_clcmd("say /damager", "ClCmdToggle");
g_iMaxPlayers = get_maxplayers()
}
public client_putinserver(pClient) { new sInfo[4]; get_user_info(pClient, "_dmg", sInfo, charsmax(sInfo)); if(sInfo[0] && equal(sInfo, "on")) g_bShowDamage[pClient] = true; else g_bShowDamage[pClient] = false; }
public eDamage(pVictim) { static pAttacker; pAttacker = get_user_attacker(pVictim); if((get_user_flags(pAttacker) & ADMIN_LEVEL_H) || !is_user_connected(pAttacker)) return; static SyncHudMsg; if(!SyncHudMsg) SyncHudMsg = CreateHudSyncObj(); new id = get_user_attacker(pVictim) 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(random_num(0, 224), random_num(0, 224), random_num(0, 224), Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1) ShowSyncHudMsg(pAttacker, SyncHudMsg, "%i^n", read_data(2)); } }
stock bool:ent_sees_ent(iEnt, iEnt2) { static Float:fEntOrigin[3], Float:fEnt2Origin[3], Float:fResult[3]; entity_get_vector(iEnt, EV_VEC_origin, fEntOrigin); entity_get_vector(iEnt2, EV_VEC_origin, fEnt2Origin); return trace_line(iEnt, fEntOrigin, fEnt2Origin, fResult) == iEnt2; }
Not working at all.
I use this plugin so far and it's working, but only what i want is to disable it through walls:
PHP Code:
#include <amxmodx>
#define PLUGIN "Bullet Damage COLORed by Leo_[BH]" #define AUTHOR "ConnorMcLeod / Leo_[BH]" #define VERSION "0.0.3"
#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(random_num(0, 224), random_num(0, 224), random_num(0, 224), Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1) show_hudmessage(id, "%d", read_data(2)) } } }
|
|