AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   To happen of MSG to Menu. (https://forums.alliedmods.net/showthread.php?t=237257)

twiister 03-20-2014 22:02

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

Example:

http://i.imgur.com/feRp1iq.png

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

Baws 03-20-2014 22:04

Re: To happen of MSG to Menu.
 
WHAT?!

minato 03-21-2014 01:11

Re: To happen of MSG to Menu.
 
menu_create + menu_additem and menu_display ?

twiister 03-21-2014 09:09

Re: To happen of MSG to Menu.
 
I'm sorry.

The plugin published does this function:

http://i.imgur.com/fiwDtml.png

he want a menu shows top Knives by menu: (Example)

http://i.imgur.com/feRp1iq.png

YamiKaitou 03-21-2014 09:19

Re: To happen of MSG to Menu.
 
Since you created 2 threads for this (which you are not supposed to do), do you want someone to fix it for you or guide you in the right direction so you can fix it yourself?


All times are GMT -4. The time now is 05:54.

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