Raised This Month: $51 Target: $400
 12% 

dhud


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 03-04-2016 , 08:13   dhud
Reply With Quote #1

Hello, can someone make this bullet damage with dhud ?

PHP Code:
#include <amxmodx>

#define MAX_PLAYERS    32

new const Float:g_flCoords[][] = 
{
    {
0.500.40},
    {
0.560.44},
    {
0.600.50},
    {
0.560.56},
    {
0.500.60},
    {
0.440.56},
    {
0.400.50},
    {
0.440.44}
}

new 
g_iPlayerPos[MAX_PLAYERS+1]
new 
g_iMaxPlayers
new g_pCvarEnabled

public plugin_init()
{
    
register_plugin("Bullet Damage""0.0.1""ConnorMcLeod")

    
g_pCvarEnabled register_cvar("bullet_damage""1")

    
register_event("Damage""Damage""b""2>0""3=0")

    
g_iMaxPlayers get_maxplayers()
}

public 
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_hudmessage(random(256), random(256), random(256), Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 00.12.50.020.02);
            
show_hudmessage(id"%d"read_data(2))
        }
    }

GlobalPlague is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 03-07-2016 , 10:23   Re: dhud
Reply With Quote #2

Make sure you have dhudmessage.inc inside your include folder or else my code will not get compiled!

Use this code --
Code:
#include <amxmodx>
#include <dhudmessage>
 
#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("Bullet Damage", "0.0.1", "ConnorMcLeod")
    g_pCvarEnabled = register_cvar("bullet_damage", "1")
    register_event("Damage", "Damage", "b", "2>0", "3=0")
    g_iMaxPlayers = get_maxplayers()
}
 
public 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(random(256), random(256), random(256), Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02);
            show_dhudmessage(id, "%d", read_data(2))
        }
    }
}

Last edited by Abhinash; 03-07-2016 at 10:26. Reason: Mistyped !
Abhinash is offline
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 03-07-2016 , 17:38   Re: dhud
Reply With Quote #3

where is dhud stock ?
__________________



AssasinSniperNightmare ModArmageddon ModApolacyps Mod
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode