Raised This Month: $ Target: $400
 0% 

How it will separate


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asd2010
Member
Join Date: Dec 2009
Old 03-26-2011 , 21:31   How it will separate
Reply With Quote #1

Hello. Sorry for my bad English, use translator

I have this code

PHP Code:
new const szPack[][] =
{
    
"\w1 \ySnow \r- \w1 \yFlame",
    
"\w1 \ySnow \r- \w1 \yFrozen \r- \w2 \yFlame",
    
"\w1 \yStark \r- \w2 \yFlame",
    
"\w2 \yStark \r- \w1 \yBubble",
    
"\w1 \yStark \r- \w1 \yFrozen \r- \w1 \yBubble",
    
"\w2 \yStark \r- \w2 \yFrozen \r- \w1 \yBubble"

But I wanted to do (separate) if you can say, for example as follows

PHP Code:
new const szPackNumber[][] =
{
    
11,
    
112,
    
12
    2
1
    1
11,
    
221

PHP Code:
new const szPackNames[][] =
 {
// [...]
 

But I do not know as I do if I put the: \r-

menu:

PHP Code:
BUY_MENU(id)
{    
    new 
menu[512], len
    len 
0
    
    
// Title
    
len += formatex(menu[len], charsmax(menu) - len"\y%L^n^n"id"MENU_BUY_TITLE")
   
    for(new 
sizeof(szPack) ; i++)
    {
       
        if(
is_user_alive(id))
            
len += formatex(menu[len], charsmax(menu) - len"\d%d. \r[ %s \r]^n"i+1szPack[i])
        else
            
len += formatex(menu[len], charsmax(menu) - len"\r%d. \r[ %s \r] ^n"i+1szPack[i])
           
    }    
    
    
// 0. Exit
    
len += formatex(menu[len], charsmax(menu) - len"\r0.\w %L"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Buy Menu")

Grettings
asd2010 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-26-2011 , 22:23   Re: How it will separate
Reply With Quote #2

Code:
#include <amxmodx> enum Items {     Item_Stark,     Item_Snow,     Item_Frozen,     Item_Flame,     Item_Bubble }; new const g_szItemNames[Items][] = {     "Stark",     "Snow",     "Frozen",     "Flame",     "Bubble", }; new const g_iPackItemCounts[][Items] = {     {0, 1, 0, 1, 0}, // 1 snow, 1 flame     {0, 1, 1, 1, 0}, // 1 snow, 1 frozen, 1 flame     {1, 0, 0, 0, 2}, // 1 stark, 2 flame     {2, 0, 0, 0, 1}, // 2 stark, 1 bubble     {1, 0, 1, 0, 1}, // 1 stark, 1 frozen, 1 bubble     {2, 0, 2, 0, 1}  // 2 stark, 2 frozen, 1 bubble }; const TOTAL_PACKS = sizeof(g_iPackItemCounts); new g_szPackMenuItems[TOTAL_PACKS][64]; public plugin_init() {     new len;     new Items:item;     new num;         for(new pack_index = 0; pack_index < TOTAL_PACKS; pack_index++)     {         len = 0;         g_szPackMenuItems[pack_index][0] = EOS;                 for(item = Items:0; item < Items; item++)         {             if((num = g_iPackItemCounts[pack_index][item]) > 0)             {                 len += formatex(g_szPackMenuItems[pack_index][len], charsmax(g_szPackMenuItems[]) - len, "%s\w%d \y%s", len ? " \r- " : "", num, g_szItemNames[item]);             }         }     } } BUY_MENU(id) {     new menu[512], len     len = 0         // Title     len += formatex(menu[len], charsmax(menu) - len, "\y%L^n^n", id, "MENU_BUY_TITLE")         for(new i = 0 ; i < TOTAL_PACKS ; i++)     {                 if(is_user_alive(id))             len += formatex(menu[len], charsmax(menu) - len, "\d%d. \r[ %s \r]^n", i+1, g_szPackMenuItems[i])         else             len += formatex(menu[len], charsmax(menu) - len, "\r%d. \r[ %s \r] ^n", i+1, g_szPackMenuItems[i])             }             // 0. Exit     len += formatex(menu[len], charsmax(menu) - len, "\r0.\w %L", id, "MENU_EXIT")         show_menu(id, KEYSMENU, menu, -1, "Buy Menu") }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



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 14:34.


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