Raised This Month: $32 Target: $400
 8% 

Best kİller


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tarkan00
Senior Member
Join Date: Jan 2017
Old 02-09-2017 , 12:37   Best kİller
Reply With Quote #1

hello guys,
I want show best killer with hud in the center .
1 player or
1.
2.
3.
as list .
so ,best killer in tour
tarkan00 is offline
TanKerr
Member
Join Date: Feb 2017
Location: Morocco
Old 02-09-2017 , 13:05   Re: Best kİller
Reply With Quote #2

Ehh! You Can Add Best Players to Here !
PHP Code:
#include <amxmodx>  
#include <amxmisc>  
#include <hamsandwich>  
#include <cstrike>   
#include <dhudmessage>

#define PLUGIN    "Bestplayer"  
#define AUTHOR    "TanKerr"  
#define VERSION    "1.0"  

new g_iKills[32], g_iHS[32], g_iDmg[32]  

public 
plugin_init()  
{  
    
register_plugin(PLUGINVERSIONAUTHOR)  
      
    
RegisterHam(Ham_TakeDamage"player""hamTakeDamage")  
    
register_event("DeathMsg""EventDeathMsg""a")  
    
register_logevent("RoundEnd"2"1=Round_End")  
}  
public 
client_disconnect(id)  
{  
    
g_iDmg[id] = 0;  
    
g_iKills[id] = 0;  
    
g_iHS[id] = 0;  
}  
public 
hamTakeDamage(victiminflictorattackerFloat:damageDamageBits)  
{  
    if( 
<= attacker <= 32)  
    {  
        if(
cs_get_user_team(victim) != cs_get_user_team(attacker))  
            
g_iDmg[attacker] += floatround(damage)  
        else  
            
g_iDmg[attacker] -= floatround(damage)  
    }  
}  
public 
EventDeathMsg()  
{  
    new 
killer read_data(1)  
    new 
victim read_data(2)  
    new 
is_hs read_data(3)  
      
    if(
killer != victim && killer && cs_get_user_team(killer) != cs_get_user_team(victim))  
    {  
        
g_iKills[killer]++;  
          
        if(
is_hs)  
            
g_iHS[killer]++;  
    }  
    else  
        
g_iKills[killer]--;  
}  
public 
RoundEnd()  
{  
    new 
iBestPlayer get_best_player()  
      
    new 
szName[32]  
    
get_user_name(iBestPlayerszNamecharsmax(szName)) 

    
set_dhudmessage(01600, -1.00.2526.03.00.11.5);
    
show_dhudmessage(0"Best player of the round is : ^3%s ^1Killing %i ^3!"szNameg_iKills[iBestPlayer]);

    for(new 
i31i++)  
    {  
        
g_iDmg[i] = 0;  
        
g_iHS[i] = 0;  
        
g_iKills[i] = 0;  
    }  
}  
get_best_player()  
{  
    new 
players[32], num;  
    
get_players(playersnum);  
    
SortCustom1D(playersnum"sort_bestplayer")  
      
    return 
players[0]  
}  
public 
sort_bestplayer(id1id2)  
{  
    if(
g_iKills[id1] > g_iKills[id2])  
        return -
1;  
    else if(
g_iKills[id1] < g_iKills[id2])  
        return 
1;  
    else  
    {  
        if(
g_iDmg[id1] > g_iDmg[id2])  
            return -
1;  
        else if(
g_iDmg[id1] < g_iDmg[id2])  
            return 
1;  
        else  
            return 
0;  
    }  
      
    return 
0;  

__________________
TanKerr is offline
tarkan00
Senior Member
Join Date: Jan 2017
Old 02-09-2017 , 13:39   Re: Best kİller
Reply With Quote #3

Quote:
Originally Posted by TanKerr View Post
Ehh! You Can Add Best Players to Here !
PHP Code:
#include <amxmodx>  
#include <amxmisc>  
#include <hamsandwich>  
#include <cstrike>   
#include <dhudmessage>

#define PLUGIN    "Bestplayer"  
#define AUTHOR    "TanKerr"  
#define VERSION    "1.0"  

new g_iKills[32], g_iHS[32], g_iDmg[32]  

public 
plugin_init()  
{  
    
register_plugin(PLUGINVERSIONAUTHOR)  
      
    
RegisterHam(Ham_TakeDamage"player""hamTakeDamage")  
    
register_event("DeathMsg""EventDeathMsg""a")  
    
register_logevent("RoundEnd"2"1=Round_End")  
}  
public 
client_disconnect(id)  
{  
    
g_iDmg[id] = 0;  
    
g_iKills[id] = 0;  
    
g_iHS[id] = 0;  
}  
public 
hamTakeDamage(victiminflictorattackerFloat:damageDamageBits)  
{  
    if( 
<= attacker <= 32)  
    {  
        if(
cs_get_user_team(victim) != cs_get_user_team(attacker))  
            
g_iDmg[attacker] += floatround(damage)  
        else  
            
g_iDmg[attacker] -= floatround(damage)  
    }  
}  
public 
EventDeathMsg()  
{  
    new 
killer read_data(1)  
    new 
victim read_data(2)  
    new 
is_hs read_data(3)  
      
    if(
killer != victim && killer && cs_get_user_team(killer) != cs_get_user_team(victim))  
    {  
        
g_iKills[killer]++;  
          
        if(
is_hs)  
            
g_iHS[killer]++;  
    }  
    else  
        
g_iKills[killer]--;  
}  
public 
RoundEnd()  
{  
    new 
iBestPlayer get_best_player()  
      
    new 
szName[32]  
    
get_user_name(iBestPlayerszNamecharsmax(szName)) 

    
set_dhudmessage(01600, -1.00.2526.03.00.11.5);
    
show_dhudmessage(0"Best player of the round is : ^3%s ^1Killing %i ^3!"szNameg_iKills[iBestPlayer]);

    for(new 
i31i++)  
    {  
        
g_iDmg[i] = 0;  
        
g_iHS[i] = 0;  
        
g_iKills[i] = 0;  
    }  
}  
get_best_player()  
{  
    new 
players[32], num;  
    
get_players(playersnum);  
    
SortCustom1D(playersnum"sort_bestplayer")  
      
    return 
players[0]  
}  
public 
sort_bestplayer(id1id2)  
{  
    if(
g_iKills[id1] > g_iKills[id2])  
        return -
1;  
    else if(
g_iKills[id1] < g_iKills[id2])  
        return 
1;  
    else  
    {  
        if(
g_iDmg[id1] > g_iDmg[id2])  
            return -
1;  
        else if(
g_iDmg[id1] < g_iDmg[id2])  
            return 
1;  
        else  
            return 
0;  
    }  
      
    return 
0;  

thank you my man , than you very much I love as your helpful people ...
can you as list this plugin;
1.Player
2.Player
3.Player
first 3 player . Same plugin with will be but list.player is not see all the hud. time is not enough. can you do some fast?

and How Can I to read the best player in score table?
example :
Quote:
if(score table best player) && get_user_team(id) == 1/2)) {
xxxxx
}

Last edited by tarkan00; 02-09-2017 at 13:57.
tarkan00 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-09-2017 , 16:35   Re: Best kİller
Reply With Quote #4

Quote:
Originally Posted by TanKerr View Post
Ehh! You Can Add Best Players to Here !
PHP Code:
#include <amxmodx>  
#include <amxmisc>  
#include <hamsandwich>  
#include <cstrike>   
#include <dhudmessage>

#define PLUGIN    "Bestplayer"  
#define AUTHOR    "TanKerr"  
#define VERSION    "1.0"  

new g_iKills[32], g_iHS[32], g_iDmg[32]  

public 
plugin_init()  
{  
    
register_plugin(PLUGINVERSIONAUTHOR)  
      
    
RegisterHam(Ham_TakeDamage"player""hamTakeDamage")  
    
register_event("DeathMsg""EventDeathMsg""a")  
    
register_logevent("RoundEnd"2"1=Round_End")  
}  
public 
client_disconnect(id)  
{  
    
g_iDmg[id] = 0;  
    
g_iKills[id] = 0;  
    
g_iHS[id] = 0;  
}  
public 
hamTakeDamage(victiminflictorattackerFloat:damageDamageBits)  
{  
    if( 
<= attacker <= 32)  
    {  
        if(
cs_get_user_team(victim) != cs_get_user_team(attacker))  
            
g_iDmg[attacker] += floatround(damage)  
        else  
            
g_iDmg[attacker] -= floatround(damage)  
    }  
}  
public 
EventDeathMsg()  
{  
    new 
killer read_data(1)  
    new 
victim read_data(2)  
    new 
is_hs read_data(3)  
      
    if(
killer != victim && killer && cs_get_user_team(killer) != cs_get_user_team(victim))  
    {  
        
g_iKills[killer]++;  
          
        if(
is_hs)  
            
g_iHS[killer]++;  
    }  
    else  
        
g_iKills[killer]--;  
}  
public 
RoundEnd()  
{  
    new 
iBestPlayer get_best_player()  
      
    new 
szName[32]  
    
get_user_name(iBestPlayerszNamecharsmax(szName)) 

    
set_dhudmessage(01600, -1.00.2526.03.00.11.5);
    
show_dhudmessage(0"Best player of the round is : ^3%s ^1Killing %i ^3!"szNameg_iKills[iBestPlayer]);

    for(new 
i31i++)  
    {  
        
g_iDmg[i] = 0;  
        
g_iHS[i] = 0;  
        
g_iKills[i] = 0;  
    }  
}  
get_best_player()  
{  
    new 
players[32], num;  
    
get_players(playersnum);  
    
SortCustom1D(playersnum"sort_bestplayer")  
      
    return 
players[0]  
}  
public 
sort_bestplayer(id1id2)  
{  
    if(
g_iKills[id1] > g_iKills[id2])  
        return -
1;  
    else if(
g_iKills[id1] < g_iKills[id2])  
        return 
1;  
    else  
    {  
        if(
g_iDmg[id1] > g_iDmg[id2])  
            return -
1;  
        else if(
g_iDmg[id1] < g_iDmg[id2])  
            return 
1;  
        else  
            return 
0;  
    }  
      
    return 
0;  

I smell piracy.
__________________
edon1337 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-09-2017 , 21:35   Re: Best kİller
Reply With Quote #5

Quote:
Originally Posted by edon1337 View Post
I smell piracy.
I smell index out of bounds errors when a player is on slot 32.
__________________
Bugsy is offline
sb123
Senior Member
Join Date: Jan 2007
Old 02-10-2017 , 04:55   Re: Best kİller
Reply With Quote #6

Try this plugin
Attached Files
File Type: sma Get Plugin or Get Source (Best_Killer.sma - 341 views - 3.5 KB)
__________________
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-10-2017 , 05:55   Re: Best kİller
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
I smell index out of bounds errors when a player is on slot 32.
Yeah, also
Quote:
#define AUTHOR "TanKerr"
__________________
edon1337 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 02-10-2017 , 06:47   Re: Best kİller
Reply With Quote #8

PHP Code:
show_dhudmessage(0"Best player of the round is : ^3%s ^1Killing %i ^3!"szNameg_iKills[iBestPlayer); 
I doesn't knew that we can add chat color's format to dhudmessage.

PHP Code:
    if(killer != victim && killer && cs_get_user_team(killer) != cs_get_user_team(victim))   
    {   
        
g_iKills[killer]++;   
           
        if(
is_hs)   
            
g_iHS[killer]++;   
    }   
    else   
        
g_iKills[killer]--; 
That else will be the oppost of

PHP Code:
if(killer != victim && killer
And

PHP Code:
public sort_bestplayer(id1id2)   
{   
    if(
g_iKills[id1] > g_iKills[id2])   
        return -
1;   
    else if(
g_iKills[id1] < g_iKills[id2])   
        return 
1;   
    else   
    {   
        if(
g_iDmg[id1] > g_iDmg[id2])   
            return -
1;   
        else if(
g_iDmg[id1] < g_iDmg[id2])   
            return 
1;   
        else   
            return 
0;   
    }   
       
    return 
0;   

You've added the same format two times.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 02-10-2017 at 06:54.
EFFx is offline
tarkan00
Senior Member
Join Date: Jan 2017
Old 02-10-2017 , 10:15   Re: Best kİller
Reply With Quote #9

up please
tarkan00 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 04:19.


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