Raised This Month: $ Target: $400
 0% 

Get attacker name?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
buzzy147
Junior Member
Join Date: Jan 2010
Old 07-25-2010 , 21:33   Get attacker name?
Reply With Quote #1

..

Last edited by buzzy147; 10-08-2018 at 14:19. Reason: .
buzzy147 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 07-25-2010 , 21:43   Re: Get attacker name?
Reply With Quote #2

show the code please.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
buzzy147
Junior Member
Join Date: Jan 2010
Old 07-25-2010 , 22:26   Re: Get attacker name?
Reply With Quote #3

..

Last edited by buzzy147; 10-08-2018 at 14:19. Reason: .
buzzy147 is offline
Ryokin
Senior Member
Join Date: Jan 2010
Old 07-25-2010 , 22:29   Re: Get attacker name?
Reply With Quote #4

PHP Code:
    new name32 ]
    
get_user_nameattackername31 
__________________
NH4CL + NaOH -> NH3 + H2O + NaCL
Ryokin is offline
buzzy147
Junior Member
Join Date: Jan 2010
Old 07-25-2010 , 22:57   Re: Get attacker name?
Reply With Quote #5

..

Last edited by buzzy147; 10-08-2018 at 14:19. Reason: .
buzzy147 is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 07-25-2010 , 22:30   Re: Get attacker name?
Reply With Quote #6

[php]
public on_damage(id)
{
if(g_enabled)
static attacker
new name[32]
get_user_name(attacker, name, 31)
//blablablabla..
}
Mxnn is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-25-2010 , 23:09   Re: Get attacker name?
Reply With Quote #7

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>

#define PLUGIN "Advanced Bullet Damage"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

new g_type, g_enabled, g_recieved, bool:g_showrecieved, g_hudmsg1, g_hudmsg2

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")    
    register_event("HLTV", "on_new_round", "a", "1=0", "2=0")
    
    g_type = register_cvar("amx_bulletdamage","1")
    g_recieved = register_cvar("amx_bulletdamage_recieved","1")    
    
    g_hudmsg1 = CreateHudSyncObj()    
    g_hudmsg2 = CreateHudSyncObj()
}

public on_new_round()
{
    g_enabled = get_pcvar_num(g_type)
    if(get_pcvar_num(g_recieved)) g_showrecieved = true    
}

public on_damage(id)
{
    if(g_enabled)
    {
        static attacker; attacker = get_user_attacker(id)
        new name[32]
        get_user_name(attacker, name, 31)
        static damage; damage = read_data(2)    
        if(g_showrecieved)
        {            
            set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
            ShowSyncHudMsg(id, g_hudmsg2, "%i^n%s", damage, name)        
        }
        if(is_user_connected(attacker))
        {
            switch(g_enabled)
            {
                case 1: {
                    set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
                    ShowSyncHudMsg(attacker, g_hudmsg1, "%i^n", damage)                
                }
                case 2: {
                    if(fm_is_ent_visible(attacker,id))
                    {
                        set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
                        ShowSyncHudMsg(attacker, g_hudmsg1, "%i^n", damage)                
                    }
                }
            }
        }
    }
}
new name[32]
get_user_name(attacker, name, 31)


then in the show hudsyncobject

it's "%i^n%s", damage, name

Compiled with no errors, not 100 percent sure it'll work. If it does work, it'll only show the attacker, on the attackers screen, it WILL NOT show the victim. If you would like me to put that, I will.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
buzzy147
Junior Member
Join Date: Jan 2010
Old 07-26-2010 , 00:09   Re: Get attacker name?
Reply With Quote #8

..

Last edited by buzzy147; 10-08-2018 at 14:19. Reason: .
buzzy147 is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-26-2010 , 00:11   Re: Get attacker name?
Reply With Quote #9

Your welcome.

EDIT:

I think this will show the victim's name on the attacker's screen as well as the attacker's screen on the victim.

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>

#define PLUGIN "Advanced Bullet Damage"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

new g_type, g_enabled, g_recieved, bool:g_showrecieved, g_hudmsg1, g_hudmsg2

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")    
    register_event("HLTV", "on_new_round", "a", "1=0", "2=0")
    
    g_type = register_cvar("amx_bulletdamage","1")
    g_recieved = register_cvar("amx_bulletdamage_recieved","1")    
    
    g_hudmsg1 = CreateHudSyncObj()    
    g_hudmsg2 = CreateHudSyncObj()
}

public on_new_round()
{
    g_enabled = get_pcvar_num(g_type)
    if(get_pcvar_num(g_recieved)) g_showrecieved = true    
}

public on_damage(id)
{
    if(g_enabled)
    {
        static attacker; attacker = get_user_attacker(id)
        new name[32], name2[32]
        get_user_name(attacker, name, 31)
        static damage; damage = read_data(2)    
        if(g_showrecieved)

        {            
            set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
            ShowSyncHudMsg(id, g_hudmsg2, "%i^n%s", damage, name)   
       get_user_name(id, name2, 31)
        }
        if(is_user_connected(attacker))
        {
            switch(g_enabled)
            {
        
                case 1: {
                    set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
                    ShowSyncHudMsg(attacker, g_hudmsg1, "%i^n%s", damage, name2)                
                }
                case 2: {
                    if(fm_is_ent_visible(attacker,id))
                    {
                        set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
                        ShowSyncHudMsg(attacker, g_hudmsg1, "%i^n%s", damage, name2)                
                    }
                }
            }
        }
    }
}

Last edited by nikhilgupta345; 07-26-2010 at 00:21.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Ryokin
Senior Member
Join Date: Jan 2010
Old 07-26-2010 , 00:17   Re: Get attacker name?
Reply With Quote #10

your welcome too , lol
__________________
NH4CL + NaOH -> NH3 + H2O + NaCL
Ryokin is offline
Reply


Thread Tools
Display Modes

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 00:09.


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