View Single Post
Author Message
twiister
Senior Member
Join Date: Mar 2013
Location: Argentina
Old 03-20-2014 , 22:02   To happen of MSG to Menu.
Reply With Quote #1

Good as he says the title, I need help with this code. Me Aparese as 'msg' But I want that aparesca as menu:

Example:



Code:

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)
        
    }

Help please! Thank you
twiister is offline