hlmod.hu
https://hlmod.hu/

Bullet Damage
https://hlmod.hu/viewtopic.php?f=9&t=3329
Oldal: 1 / 1

Szerző:  CeDee [2012.02.05. 16:13 ]
Hozzászólás témája:  Bullet Damage

.

Szerző:  Metal [2012.02.05. 16:42 ]
Hozzászólás témája:  Re: Bullet Damage

pl így:
Kód:
#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))
                }
                if( (1 <= iVictim <= g_iMaxPlayers) && is_user_connected(iVictim) )
                {
                        new iPos = ++g_iPlayerPos[iVictim]
                        if( iPos == sizeof(g_flCoords) )
                        {
                                iPos = g_iPlayerPos[iVictim] = 0
                        }
                        set_hudmessage(100, 40, 80, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1)
                        show_hudmessage(iVictim, "%d", read_data(2))
                }
            
        }
}





CeDeee írta:
ebbe hogyan lehetne beletenni azt , hogy amikor minnket lőnek akkor is legyen sebzes kijelzes?
Kód:
  1. #include <amxmodx>

  2.  

  3. #define PLUGIN "Bullet Damage"

  4. #define AUTHOR "ConnorMcLeod"

  5. #define VERSION "0.0.1"

  6.  

  7. #define MAX_PLAYERS     32

  8.  

  9. new const Float:g_flCoords[][] =

  10. {

  11.         {0.50, 0.40},

  12.         {0.56, 0.44},

  13.         {0.60, 0.50},

  14.         {0.56, 0.56},

  15.         {0.50, 0.60},

  16.         {0.44, 0.56},

  17.         {0.40, 0.50},

  18.         {0.44, 0.44}

  19. }

  20.  

  21. new g_iPlayerPos[MAX_PLAYERS+1]

  22.  

  23. new g_iMaxPlayers

  24. new g_pCvarEnabled

  25.  

  26. public plugin_init()

  27. {

  28.         register_plugin(PLUGIN, VERSION, AUTHOR)

  29.  

  30.         g_pCvarEnabled = register_cvar("bullet_damage", "1")

  31.  

  32.         register_event("Damage", "Event_Damage", "b", "2>0", "3=0")

  33.  

  34.         g_iMaxPlayers = get_maxplayers()

  35. }

  36.  

  37. public Event_Damage( iVictim )

  38. {

  39.         if( get_pcvar_num(g_pCvarEnabled) && (read_data(4) || read_data(5) || read_data(6)) )

  40.         {

  41.                 new id = get_user_attacker(iVictim)

  42.                 if( (1 <= id <= g_iMaxPlayers) && is_user_connected(id) )

  43.                 {

  44.                         new iPos = ++g_iPlayerPos[id]

  45.                         if( iPos == sizeof(g_flCoords) )

  46.                         {

  47.                                 iPos = g_iPlayerPos[id] = 0

  48.                         }

  49.                         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)

  50.                         show_hudmessage(id, "%d", read_data(2))

  51.                 }

  52.         }

  53. }

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/