Пользователь
- Сообщения
- 3
- Реакции
- 0
Здравствуйте может кто то помочь с плагином,типа Damager показует сколько хр отнял,а то наоборот просто показует звездочку,может кто то чем то помочь?
#include <amxmodx>
#include <hamsandwich>
public plugin_init()
RegisterHam(Ham_TakeDamage, "player", "CBasePlayer_TakeDamage");
public CBasePlayer_TakeDamage(pVictim, weapon, pAttacker, Float:damage, damage_type)
{
set_hudmessage(.green = 200, .x = 0.45, .holdtime = 0.1);
show_hudmessage(pVictim, "*");
if(is_user_connected(pAttacker))
{
set_hudmessage(.red = 200, .x = 0.55, .holdtime = 0.1);
show_hudmessage(pAttacker, "*");
}
}
#include <amxmodx>
new g_MsgSync
new g_MsgSync2
new isConnected[33 char]
public plugin_init()
{
register_plugin("Damager", "1.0", "Prayer")
register_event("Damage", "EVENT_Damage", "b", "2!0", "3=0", "4!0")
g_MsgSync = CreateHudSyncObj()
g_MsgSync2 = CreateHudSyncObj()
}
public client_putinserver(id)
{
isConnected{id} = true
}
public client_disconnect(id)
{
isConnected{id} = false
}
public EVENT_Damage(id)
{
if(isConnected{id})
{
static damage, pid
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_MsgSync2, "%d", damage)
pid = get_user_attacker(id)
if((pid > 0) && (pid < 33) && isConnected{pid})
{
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
ShowSyncHudMsg(pid, g_MsgSync, "%d", damage)
}
}
}
#include <amxmodx>
#define DMG_TYPE 1 // Тип урона. (1 = Цифры, 2 = Звёздочка)
#define FLAG_ACCESS (ADMIN_BAN|ADMIN_LEVEL_H) // Выдавать только указанным флагам.
public plugin_init()
{
register_plugin("Lite Damager", "0.1", "AcE")
register_event("Damage", "eDamage", "b", "2!0", "3=0", "4!0")
}
public eDamage(pVictim)
{
static pAttacker, SyncHudMsg
pAttacker = get_user_attacker(pVictim)
if (!is_user_connected(pAttacker)) return
#if defined FLAG_ACCESS
if (!(get_user_flags(pAttacker) & FLAG_ACCESS)) return
#endif
if (!SyncHudMsg) SyncHudMsg = CreateHudSyncObj()
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 1.5, 0.02, 0.02, -1)
#if DMG_TYPE == 1
ShowSyncHudMsg(pAttacker, SyncHudMsg, "%i^n", read_data(2))
#endif
#if DMG_TYPE == 2
ShowSyncHudMsg(pAttacker, SyncHudMsg, "*^n")
#endif
}
AcE == REVO ?я своим плагином тоже поделюсь
Здравствуйте как сделать что бы цифры.показывали и мертвым игрокам при наблюдение
#include amxmisc
#include reapi
#define MAX_PLAYERS 32
//#define WALLS_VISIBLE
#if !defined WALLS_VISIBLE
#include fakemeta_util
#endif
new g_MsgSync1, g_MsgSync2;
public plugin_init()
{
register_plugin("[ReAPI] Damager","1.1","phe");
RegisterHookChain(RG_CBasePlayer_TakeDamage, "CBasePlayer_TakeDamage", true);
g_MsgSync1 = CreateHudSyncObj();
g_MsgSync2 = CreateHudSyncObj();
}
public CBasePlayer_TakeDamage(victim, inflictor, attacker, Float:damage)
{
for(new i = 1; i < MAX_PLAYERS; ++i)
if(is_user_connected(attacker) && 1 <= attacker <= MAX_PLAYERS && get_member(victim, m_iTeam) != get_member(attacker, m_iTeam))
{
new g_Damage = floatround(damage, floatround_floor);
if(g_Damage > 0)
{
set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1);
ShowSyncHudMsg(victim, g_MsgSync1, "%d", g_Damage);
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1);
#if defined WALLS_VISIBLE
ShowSyncHudMsg(attacker, g_MsgSync2, "%d", g_Damage);
#else
if(fm_is_ent_visible(attacker, victim))
ShowSyncHudMsg(attacker, g_MsgSync2, "%d", g_Damage);
#endif
}
}
}