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

Top Five Knife


  
 
 
Thread Tools Display Modes
Author Message
matrix123
Veteran Member
Join Date: Feb 2011
Old 08-06-2012 , 22:07   Top Five Knife
#1

hola bueno queria saber como capto los 5 que mas mataron con faka en el match, osea seria un HUD que vaya diciendo quienes son los que mas mataron con faka..
ejemplo

Kills con faka:
matrix 5
gonza 4
martin 2
german 2
pepito 1

gracias
__________________
matrix123 is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 08-07-2012 , 06:14   Re: Top Five Knife
#2

Me entretuvo un rato
PHP Code:
#include <amxmodx>
#include <csx>

#define PLUGIN "Top Knives"
#define VERSION "1.0"
#define AUTHOR "[R]ak"

#define is_valid_player(%1)    ((1 <= %1 <= g_MaxPlayers) && is_user_alive(%1))

#define MarkBite(%0,%1)    (%0 |= (1 << (%1 & 31)))
#define IsBite(%0,%1)    (%0 & (1 << (%1 & 31)))

new g_PlayerKnives[33], g_MaxPlayers

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /showhud""cmdShowHud")
    
    
g_MaxPlayers get_maxplayers()
}

public 
cmdShowHud(id) {
    
    new 
ids[5], num
    
    get_top_knives
(idsnum)
    
    new 
Name[32], Msg[256], tempid
    
    add
(Msgcharsmax(Msg), "TOP KNIFE")
    
    for(new 
inumi++) {
        
        
tempid ids[i]
        
        
get_user_name(tempidNamecharsmax(Name))
        
        
format(Msgcharsmax(Msg), "%s^n%d.- %s Knives: %d"Msgi+1Nameg_PlayerKnives[tempid])
    }
    
    
set_hudmessage(255255255, -1.00.1006.06.0)
    
show_hudmessage(idMsg)
        
    return 
PLUGIN_HANDLED
}

public 
client_death(attackervictimwpconst) {
    
    if(!
is_valid_player(attacker) || wpconst != CSW_KNIFE)
        return
        
    
g_PlayerKnives[attacker]++
    
}

public 
client_disconnect(id)
    
g_PlayerKnives[id] = false

get_top_knives
(Cell[5], &num) {
    
    static 
tempididBitCheckId
    num 
0
    BitCheckId 
0
        
    
while(num != 5) {
    
        
tempid 0
        
        
for(id 1id <= g_MaxPlayersid++) {
            
            if(!
is_user_connected(id) || IsBite(BitCheckIdid) || g_PlayerKnives[id] < g_PlayerKnives[tempid])
                continue;
            
            
tempid id
        
}
    
        if(!
tempid)
            break;
    
        
Cell[num++] = tempid;
        
MarkBite(BitCheckIdtempid)
        
    }

__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 08-07-2012 at 23:44.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
DJHD!
Veteran Member
Join Date: Dec 2009
Location: Santiago, Chile
Old 08-07-2012 , 23:29   Re: Top Five Knife
#3

Jajaja excelente rak ;)
__________________
Quote:
Originally Posted by XINLEI View Post
Porque rocccos trata de ser el metalicross que nunca va a poder ser.
DJHD! is offline
Send a message via MSN to DJHD!
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 08-07-2012 , 23:33   Re: Top Five Knife
#4

me di cuenta.. me falto el client_disconnect.. igual nada del otro mundo xD
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
 



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:50.


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