Will you make me a bullet damage for zombie plague server where when you shoot to show you damage and give you a sample and hud [+1 AP] when you do ammo pack.
PHP Code:
#include <amxmodx>
#include <engine>
new g_hudmsg1, g_hudmsg2;
public plugin_init() {
register_plugin("Bullet Damage with Spec", "1.3", "Sn!ff3r, modded by mforce")
register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
g_hudmsg1 = CreateHudSyncObj()
g_hudmsg2 = CreateHudSyncObj()
}
public on_damage(id) {
static attacker; attacker = get_user_attacker(id)
if(is_user_connected(attacker)) {
static damage; damage = read_data(2)
set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
ShowSyncHudMsg(id, g_hudmsg2, "%i^n", damage)
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
ShowSyncHudMsg(attacker, g_hudmsg1, "%i^n", damage)
static iPlayers[32], iNum;
get_players(iPlayers, iNum, "bch")
for(new i = 0, Spectator = iPlayers[0]; i < iNum; Spectator = iPlayers[i++]) {
if(entity_get_int(Spectator, EV_INT_iuser2) == attacker) {
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
ShowSyncHudMsg(Spectator, g_hudmsg1, "%i^n", damage)
}
if(entity_get_int(Spectator, EV_INT_iuser2) == id) {
set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
ShowSyncHudMsg(Spectator, g_hudmsg2, "%i^n", damage)
}
}
}
}