Raised This Month: $ Target: $400
 0% 

[ES] Player Menu


  
 
 
Thread Tools Display Modes
Author Message
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 04-15-2009 , 22:54   [ES] Player Menu
#1

Estube viendo por ahi el nuevo menu de amxx (creo que igual es viejo) y como se muestra sale la forma de ver la lista de players.

De que forma, puedo hacer que se vean los ammopacks del usuario con la native zp_get_user_ammo_packs y mostrarlas al centro??? (usando \R)

PHP Code:
 #include <amxmodx>
 #include <fun>

 
public plugin_init()
 {
    
//Register a way to get to your menu...
    
register_clcmd"my_player_menu","AwesomeMenu");
 }
 public 
AwesomeMenu(id)
 {
    
//Create a variable to hold the menu
    
new menu menu_create("\rLook at this Player Menu!:""menu_handler");

    
//We will need to create some variables so we can loop through all the players
    
new players[32], pnumtempid;

    
//Some variables to hold information about the players
    
new szName[32], szTempid[10];

    
//Fill players with available players
    
get_players(playerspnum);

    
//Start looping through all players
    
for( new ii<pnumi++ )
    {
        
//Save a tempid so we do not re-index
        
tempid players[i];

        
//Get the players name and id as strings
        
get_user_name(tempidszName31);
        
num_to_str(tempidszTempid9);

        
//Add the item for this player
        
menu_additem(menuszNameszTempid0);

    }

    
//We now have all players in the menu, lets display the menu
    
menu_display(idmenu0);
 }
 public 
menu_handler(idmenuitem)
 {
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    
//Get the id of the player that was selected
    
new tempid str_to_num(data);

    
//If the player is alive
    
if( is_user_alive(tempid) )
        
//Set their health to 100
        
set_user_health(tempid100);

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 } 
Thanks
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-16-2009 , 09:40   Re: [ES] Player Menu
#2

Tendrias que preguntar en el foro Scripting Help
Suerte
__________________
alan_el_more is offline
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 04-16-2009 , 15:02   Re: [ES] Player Menu
#3

Usa format para crear los items con el name de los players y sacandoles los ammo packs a los players dentro del loop (zp_get_user_ammo_packs)
__________________
IneedHelp is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 04-16-2009 , 20:35   Re: [ES] Player Menu
#4

Quote:
Originally Posted by IneedHelp View Post
Usa format para crear los items con el name de los players y sacandoles los ammo packs a los players dentro del loop (zp_get_user_ammo_packs)
Un ejemplito?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 04-16-2009 , 20:45   Re: [ES] Player Menu
#5

PHP Code:
new item[64]
new 
ammopacks zp_get_user_ammo_packs(tempid)
format(item,63,"%s (Ammo Packs %d)"szName,ammopacks)

menu_additem(menuitemszTempid); 
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 04-16-2009 , 21:22   Re: [ES] Player Menu
#6

Quote:
Originally Posted by meTaLiCroSS View Post
Un ejemplito?
http://forums.alliedmods.net/forumdisplay.php?f=83
__________________
IneedHelp is offline
 



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 06:01.


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