Raised This Month: $ Target: $400
 0% 

How to get user data on how much players he killed?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RAW_192
Senior Member
Join Date: Feb 2017
Old 02-18-2017 , 02:10   How to get user data on how much players he killed?
Reply With Quote #1

I want to create a plugin where user will get health per kill ,

How do i get user kills and add his health per kill?

Last edited by RAW_192; 02-18-2017 at 02:11.
RAW_192 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-18-2017 , 03:26   Re: How to get user data on how much players he killed?
Reply With Quote #2

Hook Deathmsg.
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-18-2017 , 05:07   Re: How to get user data on how much players he killed?
Reply With Quote #3

PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < engine >

const hp_value 30

public plugin_init( ) {

    
register_plugin"Extra HP""1.0""DoNii" );
    
RegisterHamHam_Killed"player""fw_HamKilledPost");
}

public 
fw_HamKilledPostvictimattackershouldgib ) {

    new 
Float:health entity_get_floatattackerEV_FL_health )
    
entity_set_floatattackerEV_FL_healthhealth hp_value )

__________________
edon1337 is offline
RAW_192
Senior Member
Join Date: Feb 2017
Old 02-18-2017 , 05:24   Re: How to get user data on how much players he killed?
Reply With Quote #4

Quote:
Originally Posted by edon1337 View Post
PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < engine >

const hp_value 30

public plugin_init( ) {

    
register_plugin"Extra HP""1.0""DoNii" );
    
RegisterHamHam_Killed"player""fw_HamKilledPost");
}

public 
fw_HamKilledPostvictimattackershouldgib ) {

    new 
Float:health entity_get_floatattackerEV_FL_health )
    
entity_set_floatattackerEV_FL_healthhealth hp_value )

Can you explain me a little ? what the commands are doing Please?
RAW_192 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-18-2017 , 05:51   Re: How to get user data on how much players he killed?
Reply With Quote #5

What commands? The plugin I posted adds +30 HP for every kill.
__________________

Last edited by edon1337; 02-18-2017 at 05:51.
edon1337 is offline
RAW_192
Senior Member
Join Date: Feb 2017
Old 02-18-2017 , 09:09   Re: How to get user data on how much players he killed?
Reply With Quote #6

Quote:
Originally Posted by edon1337 View Post
What commands? The plugin I posted adds +30 HP for every kill.
If i add this plugin all the players will get hp per kill right?

I want to add it such as when i call this plugin like /health then it starts working ..

Also how can i limit the max health given to a player?
RAW_192 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-18-2017 , 09:29   Re: How to get user data on how much players he killed?
Reply With Quote #7

Quote:
Originally Posted by RAW_192 View Post
If i add this plugin all the players will get hp per kill right?
Yes.

Quote:
Originally Posted by RAW_192 View Post
I want to add it such as when i call this plugin like /health then it starts working ..
Also how can i limit the max health given to a player?
PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < engine >

#define HP_LIMIT 150

const hp_value 30

new bool:g_Enabled33 ];

public 
plugin_init( ) {

    
register_plugin"Extra HP""1.0""DoNii" );

    
register_clcmd"say /health""enable_plugin" );

    
RegisterHamHam_Killed"player""fw_HamKilledPost");
}

public 
enable_plugin(id) {

    
g_Enabledid ] = true
}

public 
fw_HamKilledPostvictimattackershouldgib ) {

    if( 
g_Enabledattacker ] ) {

        new 
Float:health entity_get_floatattackerEV_FL_health )

        if( 
health HP_LIMIT ) {
            return 
HAM_IGNORED;
        } 
        
        
entity_set_floatattackerEV_FL_healthhealth hp_value )
    }  

    return 
HAM_IGNORED;

__________________

Last edited by edon1337; 02-18-2017 at 09:30.
edon1337 is offline
RAW_192
Senior Member
Join Date: Feb 2017
Old 02-18-2017 , 14:35   Re: How to get user data on how much players he killed?
Reply With Quote #8

Quote:
Originally Posted by edon1337 View Post
Yes.



PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < engine >

#define HP_LIMIT 150

const hp_value 30

new bool:g_Enabled33 ];

public 
plugin_init( ) {

    
register_plugin"Extra HP""1.0""DoNii" );

    
register_clcmd"say /health""enable_plugin" );

    
RegisterHamHam_Killed"player""fw_HamKilledPost");
}

public 
enable_plugin(id) {

    
g_Enabledid ] = true
}

public 
fw_HamKilledPostvictimattackershouldgib ) {

    if( 
g_Enabledattacker ] ) {

        new 
Float:health entity_get_floatattackerEV_FL_health )

        if( 
health HP_LIMIT ) {
            return 
HAM_IGNORED;
        } 
        
        
entity_set_floatattackerEV_FL_healthhealth hp_value )
    }  

    return 
HAM_IGNORED;


Thanks , i will test it and ask you if i face any issues ..
RAW_192 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-18-2017 , 14:51   Re: How to get user data on how much players he killed?
Reply With Quote #9

Quote:
Originally Posted by edon1337 View Post
Yes.



PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < engine >

#define HP_LIMIT 150.0

const Float:hp_value 30.0

new bool:g_Enabled33 ];

public 
plugin_init( ) {

    
register_plugin"Extra HP""1.0""DoNii" );

    
register_clcmd"say /health""enable_plugin" );

    
RegisterHamHam_Killed"player""fw_HamKilledPost");
}

public 
enable_plugin(id) {

    
g_Enabledid ] = true
}

public 
fw_HamKilledPostvictimattackershouldgib ) {

    if( 
g_Enabledattacker ] ) {

        new 
Float:health entity_get_floatattackerEV_FL_health )

        if( 
health HP_LIMIT ) {
            return 
HAM_IGNORED;
        } 
        
        
entity_set_floatattackerEV_FL_healthhealth hp_value )
    }  

    return 
HAM_IGNORED;

Attacker health can be more than the limit
Check again
PHP Code:
    if( g_Enabledattacker ] ) {

        new 
Float:health entity_get_floatattackerEV_FL_health ) + hp_value

        
if( health HP_LIMIT ) {
            
health HP_LIMIT
        

        
        
entity_set_floatattackerEV_FL_healthhealth)
    } 
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-18-2017 at 14:56.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-18-2017 , 17:27   Re: How to get user data on how much players he killed?
Reply With Quote #10

I already thought of that but I just had a thought blocking the function would be ok too.
PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < engine >

#define HP_LIMIT 150

const hp_value 30

new bool:g_Enabled33 ];

public 
plugin_init( ) {

    
register_plugin"Extra HP""1.0""DoNii" );

    
register_clcmd"say /health""enable_plugin" );

    
RegisterHamHam_Killed"player""fw_HamKilledPost");
}

public 
enable_plugin(id) {

    
g_Enabledid ] = true
}

public 
fw_HamKilledPostvictimattackershouldgib ) {

    if( 
g_Enabledattacker ] ) {

        new 
Float:health entity_get_floatattackerEV_FL_health )

        if( 
health HP_LIMIT ) {
        
        
entity_set_floatattackerEV_FL_healthfloatHP_LIMIT ) )
        return 
HAM_IGNORED;
        
        } 
        
        
entity_set_floatattackerEV_FL_healthhealth hp_value )
    }  

    return 
HAM_IGNORED;

__________________

Last edited by edon1337; 02-18-2017 at 17:28.
edon1337 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 21:01.


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