hlmod.hu
https://hlmod.hu/

dhud bullet damage
https://hlmod.hu/viewtopic.php?f=9&t=3899
Oldal: 1 / 2

Szerző:  fuck604 [2012.03.31. 18:00 ]
Hozzászólás témája:  dhud bullet damage

üdv valaki dobna egy dhudos bullet damaget próbáltam átírni de nem ismerem dhudot és warningos lett valami tag mismatch-ot dobott

Szerző:  CocaIne.^ [2012.03.31. 18:03 ]
Hozzászólás témája:  Re: dhud bullet damage

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( (<= id <= g_iMaxPlayers) && is_user_connected(id) )
        {
            new iPos = ++g_iPlayerPos[id]
            if( iPos == sizeof(g_flCoords) )
            {
                iPos = g_iPlayerPos[id] = 0
            
}
            set_dhudmessage(0, 40, 80, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1)
            show_dhudmessage(id, "%d", read_data(2))
        }
    }
}

Szerző:  fuck604 [2012.03.31. 18:22 ]
Hozzászólás témája:  Re: dhud bullet damage

köszi

Szerző:  n0th1ng [2012.03.31. 19:27 ]
Hozzászólás témája:  Re: dhud bullet damage

CocaIne.^ írta:
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( (<= id <= g_iMaxPlayers) && is_user_connected(id) )
        {
            new iPos = ++g_iPlayerPos[id]
            if( iPos == sizeof(g_flCoords) )
            {
                iPos = g_iPlayerPos[id] = 0
            
}
            set_dhudmessage(0, 40, 80, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1)
            show_dhudmessage(id, "%d", read_data(2))
        }
    }


#include <dhudmessage>

Ez nem kéne a kódba?

Szerző:  CocaIne.^ [2012.03.31. 19:32 ]
Hozzászólás témája:  Re: dhud bullet damage

n0th1ng írta:
CocaIne.^ írta:
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( (<= id <= g_iMaxPlayers) && is_user_connected(id) )
        {
            new iPos = ++g_iPlayerPos[id]
            if( iPos == sizeof(g_flCoords) )
            {
                iPos = g_iPlayerPos[id] = 0
            
}
            set_dhudmessage(0, 40, 80, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1)
            show_dhudmessage(id, "%d", read_data(2))
        }
    }


#include <dhudmessage>

Ez nem kéne a kódba?

[s]Ott van[/s]
dee, sorry elejére írtam és nem másoltam, igazad van, kell

Szerző:  n0th1ng [2012.03.31. 20:11 ]
Hozzászólás témája:  Re: dhud bullet damage

Kód:
#include <amxmodx>
#include <dhudmessage>

#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_dhudmessage(0, 40, 80, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1)
            show_dhudmessage(id, "%d", read_data(2))
        }
    }
}


Akkor ez a jó kód.

Szerző:  fuck604 [2012.03.31. 23:00 ]
Hozzászólás témája:  Re: dhud bullet damage

xDD szerintetek magamtól nem raktam volna bele? :)

Szerző:  n0th1ng [2012.03.31. 23:01 ]
Hozzászólás témája:  Re: dhud bullet damage

fuck604 írta:
xDD szerintetek magamtól nem raktam volna bele? :)


Nem.
De ha esetleg kell valakinek akkor ott a jó kód.

Szerző:  ToxicDreams [2012.04.03. 16:11 ]
Hozzászólás témája:  Re: dhud bullet damage

Amúgy ez sem jó mert warning és tag mismatch...

Kód:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

files/5081198/5081198.sma(50) : warning 213: tag mismatch
Header size:            636 bytes
Code size:             3676 bytes
Data size:              628 bytes
Stack/heap size:      16384 bytes; estimated max. usage=197 cells (788 bytes)
Total requirements:   21324 bytes

1 Warning.
Done.

Szerző:  GhostRyder [2012.04.03. 16:54 ]
Hozzászólás témája:  Re: dhud bullet damage

Tessék így probáld :D

Kód:
#include <amxmodx>
#include <dhudmessage>

#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_dhudmessage( 0, 40, 80, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 2, 0.0, 2.0, 0.1, 0.1)
         show_dhudmessage(id, "%d", read_data(2))   
      }
   }
}

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