Bullet damage - showing damage also to the person watching the attacker.

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
239
Реакции
10
Hello.

Does anyone know what to change in this code so that the damage dealt in the HUD is also shown to the person who is watching the player?

Код:
#include <amxmodx>

#define PLUGIN "Bullet Damage"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

#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(0, 40, 80, 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))
        }
    }
}
 

Ayk

Сообщения
763
Реакции
476
Помог
19 раз(а)
В данном разделе размещаются темы, в которых требуется помощь с доработкой или объяснением материала.
В теме должны быть опубликованы попытки (diff кода или последовательность действий) самостоятельного поиска решения.
Если у вас нет наработок и попыток самому вникнуть в проблему, тогда вам в раздел "Покупка"
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу