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(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /showhud", "cmdShowHud")
g_MaxPlayers = get_maxplayers()
}
public cmdShowHud(id) {
new ids[5], num
get_top_knives(ids, num)
new Name[32], Msg[256], tempid
add(Msg, charsmax(Msg), "TOP KNIFE")
for(new i; i < num; i++) {
tempid = ids[i]
get_user_name(tempid, Name, charsmax(Name))
format(Msg, charsmax(Msg), "%s^n%d.- %s Knives: %d", Msg, i+1, Name, g_PlayerKnives[tempid])
}
set_hudmessage(255, 255, 255, -1.0, 0.10, 0, 6.0, 6.0)
show_hudmessage(id, Msg)
return PLUGIN_HANDLED
}
public client_death(attacker, victim, wpconst) {
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 tempid, id, BitCheckId
num = 0
BitCheckId = 0
while(num != 5) {
tempid = 0
for(id = 1; id <= g_MaxPlayers; id++) {
if(!is_user_connected(id) || IsBite(BitCheckId, id) || g_PlayerKnives[id] < g_PlayerKnives[tempid])
continue;
tempid = id
}
if(!tempid)
break;
Cell[num++] = tempid;
MarkBite(BitCheckId, tempid)
}
}
Help please! Thank you