Raised This Month: $ Target: $400
 0% 

How to order items by price?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
colossus
Member
Join Date: Sep 2013
Old 09-14-2013 , 16:06   How to order items by price?
Reply With Quote #1

An example:


PHP Code:
show_menu_extras(id)
{
    if (!
is_user_alive(id))
        return;
    
    static 
menuidmenu[128], teambuffer[32]

    
formatex(menucharsmax(menu), "Items Menu")
    
menuid menu_create(menu"menu_extras")

    for (new 
0g_extraitem_ii++)
    {
        
formatex(menucharsmax(menu), "%s \r[Cost: %d]"bufferArrayGetCell(g_extraitem_costi))
        
buffer[0] = i
        buffer
[1] = 0
        menu_additem
(menuidmenubuffer)
    }

    if (
menu_items(menuid) <= 0)
    {
        
client_print(idprint_chat"No items in menu")
        
menu_destroy(menuid)
        return;
    }
    
    
// Back - Next - Exit
    
menu_setprop(menuidMPROP_BACKNAME"Back page")
    
menu_setprop(menuidMPROP_NEXTNAME"Next page")
    
menu_setprop(menuidMPROP_EXITNAME"Exit menu")
        
    
// If remembered page is greater than number of pages, clamp down the value
    
MENU_PAGE_EXTRAS min(MENU_PAGE_EXTRASmenu_pages(menuid)-1)
    
    
// Fix for AMXX custom menus
    
if (pev_valid(id) == PDATA_SAFE)
        
set_pdata_int(idOFFSET_CSMENUCODE0OFFSET_LINUX)
    
    
menu_display(idmenuidMENU_PAGE_EXTRAS)

This plugin what the zombie_plague40 kick and I need to know how to sort the items by price ...

PS: These items are added with a native ...

Example:

zp_register_extra_item ("Super Gun", 30, ZP_TEAM_HUMAN)
colossus 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 18:52.


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