Raised This Month: $ Target: $400
 0% 

How do i get user headshot ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 06-20-2009 , 15:07   How do i get user headshot ?
Reply With Quote #1

1. How do i get user headshot ?

2. How do i get user total damage ?

3. How do i get user bomb kill ?

4. How do i get user knife kill ?
__________________

Last edited by ƒa†es™; 06-20-2009 at 15:10.
ƒa†es™ is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 06-20-2009 , 15:28   Re: How do i get user headshot ?
Reply With Quote #2

1. get_tr(TR_iHitgroup) or get_user_attacker() or just DeathMsg if need only killing headshot, it's a param for deathmsg
2. ham_takedamage
3. ham_takedamage damage type param
4. DeathMsg and get_user_attacker()
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 06-20-2009 , 15:34   Re: How do i get user headshot ?
Reply With Quote #3

heh ? bomb kill : ham_takedamage damage type param ??

hmmm... r sure? this sound a little wrong :-?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 06-20-2009 , 15:39   Re: How do i get user headshot ?
Reply With Quote #4

@ One
http://forums.alliedmods.net/showpos...3&postcount=24
__________________
IneedHelp is offline
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 06-21-2009 , 01:16   Re: How do i get user headshot ?
Reply With Quote #5

Quote:
Originally Posted by IneedHelp View Post
Still don't get it.

Please show some code.
__________________
ƒa†es™ is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-21-2009 , 05:13   Re: How do i get user headshot ?
Reply With Quote #6

Code:
#include <amxmodx>   public plugin_init() {         register_event("Damage", "eventDamage", "b", "2!0", "3=0", "4!0");         register_event("DeathMsg", "eventDeathMsg", "a", "1>0"); }   public eventDamage(iCl) {         // iDmg now holds the amount of damage done         new iDmg = read_data(2); }   public eventDeathMsg() {         new iHeadShot, szWeap[6];         read_data(3, iHeadShot);         read_data(4, szWeap, 5);           if (iHeadShot)         {                 // Head Shot was made         }           if (equal(szWeap, "knife"))         {                 // Knife kill was made         } }
Sorry, but can't help you with bomb.
__________________
hleV is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-21-2009 , 11:29   Re: How do i get user headshot ?
Reply With Quote #7

Quote:
Originally Posted by hleV View Post
Code:
        read_data(3, iHeadShot);
Typo: passing 2 params in read_data makes it expect a float byref.

I added victim\killer just in case you need to access them.
Code:
public eventDeathMsg() {         //static iKiller; iKiller = read_data( 1 );         //static iVictim; iVictim = read_data( 2 );         static szWeap[5]; read_data( 4 , szWeap , 4 );         if ( read_data( 3 ) )         {                 // Head Shot was made         }           if ( ( szWeap[ 0 ] == 'k' ) && ( szWeap[ 3 ] == 'f' ) )         {                 // Knife kill was made         } }
__________________
Bugsy is offline
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 06-21-2009 , 11:41   Re: How do i get user headshot ?
Reply With Quote #8

Quote:
Originally Posted by Bugsy View Post
Typo: passing 2 params in read_data makes it expect a float byref.

I added victim\killer just in case you need to access them.

Code:
</p><p>public eventDeathMsg()</p><p>{</p><p> //static iKiller; iKiller = read_data( 1 );</p><p> //static iVictim; iVictim = read_data( 2 );</p><p> static szWeap[5]; read_data( 4 , szWeap , 4 );</p><p>&nbsp;</p><p> if ( read_data( 3 ) )</p><p> {</p><p> // Head Shot was made</p><p> }</p><p>&nbsp;</p><p> if ( ( szWeap[ 0 ] == 'k' ) && ( szWeap[ 3 ] == 'f' ) )</p><p> {</p><p> // Knife kill was made</p><p> }</p><p>}
Can i ask something ?

what is this :

// Head Shot was made

Do i have to do something ?
__________________
ƒa†es™ is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-21-2009 , 11:44   Re: How do i get user headshot ?
Reply With Quote #9

Quote:
Originally Posted by ƒa†es™ View Post
Can i ask something ?

what is this :

// Head Shot was made

Do i have to do something ?
That is a comment, it is letting you know that is the location where you put your code to react when a headshot was made.. as you asked for in your original post.

Here is bomb kill
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

new g_iMaxPlayers;

#define IsEntity(%1) (%1 > g_iMaxPlayers)

public plugin_init() 
{
    
register_plugin"Death by Bomb" "1.0" "bugsy" )
    
RegisterHamHam_Killed "player" "fw_HamKilled" );
    
    
g_iMaxPlayers get_maxplayers();
}

public 
fw_HamKillediVictim iKiller iShouldGib )
{
    static 
szKiller[21];
    
    if ( 
IsEntityiKiller ) )
    {
        
peviKiller pev_classname szKiller 20 );
        
        
//env_explosion
        
if ( ( szKiller] == 'e' ) && ( szKiller] == 'v' ) && ( szKiller] == 'x' ) && ( szKiller] == 's' ) )
        {
            
//iVictim was killed by C4 bomb
        
}
    }

__________________
Bugsy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-21-2009 , 11:47   Re: How do i get user headshot ?
Reply With Quote #10

Quote:
Originally Posted by ƒa†es™ View Post
Can i ask something ?

what is this :

// Head Shot was made

Do i have to do something ?
That is where you put your own code which will be called when a headshot was made .. as you requested in your original post.

Here is bomb kill. You can also use this for detecting knife-kill with some modification.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

new g_iMaxPlayers;

#define IsEntity(%1) (%1 > g_iMaxPlayers)

public plugin_init() 
{
    
register_plugin"Death by Bomb" "1.0" "bugsy" )
    
RegisterHamHam_Killed "player" "fw_HamKilled" );
    
    
g_iMaxPlayers get_maxplayers();
}

public 
fw_HamKillediVictim iKiller iShouldGib )
{
    static 
szKiller21 ];
    
    if ( 
IsEntityiKiller ) )
    {
        
peviKiller pev_classname szKiller 20 );
        
        
//env_explosion
        
if ( ( szKiller] == 'e' ) && ( szKiller] == 'v' ) && ( szKiller] == 'x' ) && ( szKiller] == 's' ) )
        {
            
//iVictim was killed by C4 bomb
        
}
    }

__________________

Last edited by Bugsy; 06-21-2009 at 11:50.
Bugsy 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 15:34.


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