Bullet Damage Crosshair

Ops

Пользователь
Регистрация
7 Май 2018
Сообщения
20
Симпатии
0
Предупреждения
30
Помогите дописать админ права к Bullet Damage Crosshair
Опишу подробно что я хочу. Например когда игрок заходит на сервер и стреляет по игроку показывать должно "*", а когда VIP игрок то "Урон". Но это должно быть по кругу а не в 1 сторону.
Если я что-то не так описал поправьте буду благодарен=)
PHP:
#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))
        }
    }
}
Вот какой пример. Я бы его поставил но тут нету Crosshair
PHP:
////////////////////////////////////
//   Amx_Killer                   //
//   by Xhonor for stefkone       //
//   Skype: xhonor_39             //
////////////////////////////////////
 
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <dhudmessage>
#include <fakemeta>
#include <cstrike>
 
#define PLUGIN "Amx_Killer"
#define VERSION "1.1"
#define AUTHOR "Xhonor/asd edit"
#pragma tabsize 0
 
#define ICON_SHOW             1
#define ICON_HIDE             0
 
new kill_num[33]
new gMsgID
 
public plugin_init()
{
   register_plugin( PLUGIN, VERSION, AUTHOR );
 
   register_event( "DeathMsg", "hook_death", "a", "1>0" ) 
   RegisterHam( Ham_TakeDamage,"player","damager",0 )
 
   RegisterHam(Ham_Killed, "player", "ham_PlayerKilled")
   RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawned_Post", 1);
    
   gMsgID = get_user_msgid("StatusIcon")   
}
 
public ham_PlayerSpawned_Post(id)
{
   if (is_user_alive(id))
   {
      ammo_hud(id, 0)
      kill_num[id] = 0
      ammo_hud(id, 1)
   }
}
 
public ham_PlayerKilled(victim, attacker)
{
   static selfkill;
 
   selfkill = (victim == attacker || !is_user_connected(attacker)) ? true : false;
 
   if(!selfkill)
   {
      ammo_hud(attacker, 0)
      kill_num[attacker] += 1
      ammo_hud(attacker, 1)
   }
}
 
ammo_hud(id, sw)
{
   if(is_user_bot(id) || !is_user_alive(id)) 
           return
 
   new s_sprite[33]
   format(s_sprite, 32, "number_%d", kill_num[id])
   if(sw && is_user_alive(id))
   {
      message_begin( MSG_ONE, gMsgID, {0,0,0}, id )
      write_byte( ICON_SHOW )
      write_string( s_sprite )
      write_byte( 30 )
      write_byte( 144 )
      write_byte( 255 )
      message_end()
   } else {
      message_begin( MSG_ONE, gMsgID, {0,0,0}, id )
      write_byte( ICON_HIDE )
      write_string( s_sprite )
      write_byte( 30 )
      write_byte( 144 )
      write_byte( 255 )
      message_end()
   }
 
   if(kill_num[id] <= 0 && is_user_alive(id))
   {
      message_begin( MSG_ONE, gMsgID, {0,0,0}, id )
      write_byte( ICON_HIDE )
      write_string( s_sprite )
      write_byte( 30 )
      write_byte( 144 )
      write_byte( 255 )
      message_end()
   }
}
    
public hook_death()
{
    new iKiller = read_data(1)
   new iVictim = read_data(2)
 
   if(is_user_alive(iKiller)) 
   {
       message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, iKiller)
        write_short(1<<10)
        write_short(1<<10)
        write_short(0x0000)
      write_byte( 30 )
      write_byte( 144 )
      write_byte( 255 )
        write_byte(75)
        message_end()
   }   
   new s_sprite[33]
   format(s_sprite, 32, "number_%d", kill_num[iVictim])
    
   message_begin( MSG_ONE, gMsgID, {0,0,0}, iVictim )
   write_byte( ICON_HIDE )
   write_string( s_sprite )
      write_byte( 30 )
      write_byte( 144 )
      write_byte( 255 )
   message_end()      
}
 
public damager(victim, inflictor, attacker, Float:damage)
{
   if(!is_user_connected(attacker))
      return
 
   if(victim == attacker || !victim)
      return
 
   if(is_user_alive(attacker))
   {
      if(damage > 0)
      {
         if(cs_get_user_team(attacker) == cs_get_user_team(victim))
            return
 
         if(get_user_flags(attacker) & ADMIN_LEVEL_H)
         {
            set_hudmessage(30, 144, 255, -0.49, -0.56, 0, 0.01, 0.01)
            show_dhudmessage(attacker, "")
            show_hudmessage(attacker, "")
            show_hudmessage(attacker, "%d", floatround(damage))
         }
         else
         {
            set_dhudmessage(30, 144, 255, -0.49, -0.48, 0, 0.01, 0.01)
            show_dhudmessage(attacker, "")
            show_hudmessage(attacker, "")
            show_dhudmessage(attacker, " * ")
         }
      }
   }
}
 
Последнее редактирование:
Сверху Снизу