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

[Help] Show Hudmessage to Spectator


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 04-07-2015 , 04:26   [Help] Show Hudmessage to Spectator
Reply With Quote #1

I want to show bullet dmg to Spectators too.
This is what i have done so far.

Spoiler


Can someone give me an hand? I cant make it work so the Spectator sees the dmg done/taked.
Syturi0 is offline
Old 04-07-2015, 04:35
zmd94
This message has been deleted by zmd94. Reason: Incorrect. ;)
Kiske
Veteran Member
Join Date: May 2009
Old 04-07-2015 , 16:00   Re: [Help] Show Hudmessage to Spectator
Reply With Quote #2

Try this

PHP Code:
////////////////////////////////////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////////////////////////////////////////////////// 

#include <amxmodx> 
#include <amxmisc> 
#include <fakemeta>   

////////////////////////////////////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////////////////////////////////////////////////// 

new const     PLUGIN []        =    "Mostrar Dano"
                    
VERSION []    =    "1.2"
                    
AUTHOR []    =    "Syturio" 

////////////////////////////////////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////////////////////////////////////////////////// 

new g_hudmsg1g_hudmsg2
new g_MaxUsers;

////////////////////////////////////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////////////////////////////////////////////////// 

public plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR

    
register_event("Damage""on_damage""b""2!0""3=0""4!0"

    
g_hudmsg1 CreateHudSyncObj() 
    
g_hudmsg2 CreateHudSyncObj() 
    
    
g_MaxUsers get_maxplayers();


////////////////////////////////////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////////////////////////////////////////////////// 

public on_damage(id

    static 
attackerattacker get_user_attacker(id
    static 
damagedamage read_data(2
    static 
iSpec;
    static 
i;
    
    for(
1<= g_MaxUsers; ++i) {
        if(
is_user_connected(i)) {
            if(!
is_user_alive(i)) {
                
iSpec pev(ipev_iuser2);

                if(
iSpec == id) {
                   
set_hudmessage(255000.5350.4920.15.50.10.1, -1
                   
ShowSyncHudMsg(ig_hudmsg2"%i"damage)
                } else if(
iSpec == attacker) {
                    
set_hudmessage(01002000.4500.4920.15.50.10.1, -1
                    
ShowSyncHudMsg(ig_hudmsg1"%i"damage)
                }
            }
        }
    }

    
// Lever dano (Vermelho) 
    
set_hudmessage(255000.5350.4920.15.50.10.1, -1
    
ShowSyncHudMsg(idg_hudmsg2"%i"damage

    
// Dar dano (Azul) 
    
set_hudmessage(01002000.4500.4920.15.50.10.1, -1
    
ShowSyncHudMsg(attackerg_hudmsg1"%i"damage


////////////////////////////////////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////////////////////////////////////////////////// 
__________________


Last edited by Kiske; 04-07-2015 at 16:04.
Kiske is offline
Send a message via Skype™ to Kiske
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 04-07-2015 , 21:33   Re: [Help] Show Hudmessage to Spectator
Reply With Quote #3

Quote:
Originally Posted by Kiske View Post
Try this

Spoiler
Works like a charm! Thank you buddy

Last edited by Syturi0; 04-07-2015 at 21:33.
Syturi0 is offline
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 13:30.


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