Raised This Month: $ Target: $400
 0% 

can optimize this menu?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SylvertCs
BANNED
Join Date: Sep 2009
Location: San Nicolas-Buenos Aires
Old 01-24-2010 , 21:49   can optimize this menu?
Reply With Quote #1

PHP Code:
new const precio_velocidad[] = {1,3,6,9,13,15,19,25,30,36,45,51,58,64,73,89,110,120,131,150}
new const 
restar_velocidad[] = {45,80,120,160,200}
new 
re_velocidad[33]
new 
pr_velocidad[33]


show_menu_velocidad(id)
{
    
    static 
menu[999], len
    len 
0
    
    
// Title
    
len += formatex(menu[len], charsmax(menu) - len"\wSpeed\y(\r%d \yOf \r20\y)^n^n\wPoints Available:\y%d^n^n",g_banco2[id],g_puntos_humanos[id])
    
    
// 1. Subir Puntos de Velocidad
    
if(pr_velocidad[id] < 20)
    {
        if(
g_puntos_humanos[id] >= precio_velocidad[pr_velocidad[id]])
            
len += formatex(menu[len], charsmax(menu) - len"\r1. \wUp 1 Point\r(\yCosto %d\r)^n",precio_velocidad[pr_velocidad[id]])
        else
            
len += formatex(menu[len], charsmax(menu) - len"\r1. \dUp 1 Point\r(\yCosto %d\r)^n",precio_velocidad[pr_velocidad[id]]) 
    }
    else if(
pr_velocidad[id] == 20)
    {
        
len += formatex(menu[len], charsmax(menu) - len"\r1. \wYou arrived at top speed^n"
    }
    
// 2. Restar Puntos de Velocidad
    
if(re_velocidad[id] < 20)
    {
        if(
g_ammopacks[id] >= restar_velocidad[re_velocidad[id]])
            
len += formatex(menu[len], charsmax(menu) - len"\r2. \wSubtract 1 point\r(\y%d AmmoPacks\r)^n^n",restar_velocidad[re_velocidad[id]])
        else
            
len += formatex(menu[len], charsmax(menu) - len"\r2. \dSubtract 1 point\r(\y%d AmmoPacks\r)^n^n",restar_velocidad[re_velocidad[id]])
    }
    else if(
re_velocidad[id] == 20)
    {
        
len += formatex(menu[len], charsmax(menu) - len"\r2. \wYou can not subtract more points for speed^n^n")
    }
    
// 0. Exit
    
len += formatex(menu[len], charsmax(menu) - len"^n^n\r0.\w %L"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Menu Velocidad")
}
public 
menu_velocidad(idkey)
{
    switch (
key)
    {
        case 
0:
        {
            if(
pr_velocidad[id] < 20)
            {
                if(
g_puntos_humanos[id] >= precio_velocidad[pr_velocidad[id]])
                {
                    
g_banco2[id]++
                    
pr_velocidad[id]++
                    
show_menu_velocidad(id)
                }
                else
                {
                    
show_menu_velocidad(id)
                    
zp_colored_print(id,"^x04[ZP]^x01 Do not have enough points of Humans")
                }
            }
            else if(
pr_velocidad[id] == 20)
            {
                
show_menu_velocidad(id)
                
zp_colored_print(id,"^x04[ZP]^x01 You arrived at top speed")
            }
        }
        case 
1:
        {
            if(
re_damage[id] < 5)
            {
                if(
g_ammopacks[id] >= restar_velocidad[re_velocidad[id]])
                {
                    if(
g_banco2[id] <= 0)
                    {
                        
show_menu_velocidad(id)
                        
zp_colored_print(id"^x04[ZP]^x01 Speed has no points to subtract")
                    }
                    else if (
g_banco2[id] >= 1)
                    {
                        
update_ap(id,-restar_velocidad[re_velocidad[id]],0)
                        
g_banco2[id]--
                        
g_puntos_humanos[id]++
                        
re_velocidad[id]++
                        
pr_velocidad[id]--
                        
show_menu_velocidad(id)
                    }
                }
                else
                {
                    
show_menu_velocidad(id)
                    
zp_colored_print(id"^x04[ZP]^x01 Not have enough AmmoPacks")
                }
            }
            else if(
re_damage[id] == 5)
            {
                
show_menu_velocidad(id)
                
zp_colored_print(id"^x04[ZP]^x01 You arrived at top speed")
            }
        }
    }
    
    return 
PLUGIN_HANDLED;

Sorry about my English xD

Last edited by SylvertCs; 01-24-2010 at 22:04.
SylvertCs is offline
Send a message via MSN to SylvertCs
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 01-24-2010 , 23:06   Re: can optimize this menu?
Reply With Quote #2

Nueva systema de menu, por favor.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
eXacT
Veteran Member
Join Date: Apr 2009
Location: Buenos Aires
Old 01-25-2010 , 00:03   Re: can optimize this menu?
Reply With Quote #3

Quote:
Originally Posted by wrecked_ View Post
Nueva system6a de menu, por favor.

some menus can maked on older style menus, its best
__________________

"There is no knowledge, that is not power"
eXacT is offline
Send a message via MSN to eXacT Send a message via Skype™ to eXacT
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-25-2010 , 01:34   Re: can optimize this menu?
Reply With Quote #4

Your menu doesn't seem bad.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 07:17.


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