View Single Post
Author Message
Sidix
Senior Member
Join Date: Feb 2011
Location: Limbo City
Old 02-19-2011 , 09:13   [ZP] Problema al restringir armas
#1

hola bueno tengo unos problemas al restringir las armas seguí el tutorial de exact para restringir armas para los niveles porque quiero que aparesca el menu así ejemplo:

Arma primaria [1-7]

1 IMI Galil [Disponible]

2 Famas [Disponible]

3 M4A1 Carbine [Req Level 5]

4 AK-47 Kalashnikov [Req Level 10]

...


pero edité de dos formas el code pero sale así

[IMG]http://img813.**************/img813/1740/sinttulo4q.png[/IMG]

[IMG]http://img202.**************/img202/9195/sinttulo3md.png[/IMG]


aqui dejo el code:

PHP Code:
// Buy Menu 1
public show_menu_buy1(taskid)
{
    
// Get player id
    
static id
    
(taskid g_maxplayers) ? (id ID_SPAWN) : (id taskid);
    
    
// Zombies or survivors get no guns
    
if (g_zombie[id] || g_survivor[id] || !is_user_alive(id))
        return;
    
    
// Bots pick their weapons randomly
    
if (is_user_bot(id))
    {
        
buy_primary_weapon(idrandom_num(0sizeof g_primary_items 1))
        
menu_buy2(idrandom_num(0sizeof g_secondary_items 1))
        return;
    }
    
    
// Automatic selection enabled for player and menu called on spawn event
    
if (WPN_AUTO_ON && taskid g_maxplayers)
    {
        
buy_primary_weapon(idWPN_AUTO_PRI)
        
menu_buy2(idWPN_AUTO_SEC)
        return;
    }
    
    static 
menu[999], lenweap
    len 
0
    
    
// Title
    
len += formatex(menu[len], sizeof menu len"\r%L \y[%d-%d]^n^n"id"MENU_BUY1_TITLE"WPN_STARTID+1min(WPN_STARTID+7WPN_MAXIDS))
    
    
// 1-7. Weapon List
    
for (weap WPN_STARTIDweap min(WPN_STARTID+7WPN_MAXIDS); weap++)
    {
        if(
g_level[id] >= g_levelprimary[weap])
        
len += formatex(menu[len], sizeof menu len"\r%d.\w %s \y[Level %d]^n"weap-WPN_STARTID+1WEAPONNAMES[get_weaponid(g_primary_items[weap])], g_levelprimary[weap])
        
        else
        
        
len += formatex(menu[len], sizeof menu len"\d%d. %s [Level %d]^n"weap-WPN_STARTID+1WEAPONNAMES[get_weaponid(g_primary_items[weap])], g_levelprimary[weap])
        
len += formatex(menu[len], sizeof menu len"\r%d.\y %s^n"weap-WPN_STARTID+1WEAPONNAMES[get_weaponid(g_primary_items[weap])])
        }
    
    
// 8. Auto Select
    
len += formatex(menu[len], sizeof menu len"^n\r8.\w %L \y[%L]"id"MENU_AUTOSELECT"id, (WPN_AUTO_ON) ? "MOTD_ENABLED" "MOTD_DISABLED")
    
    
// 9. Next/Back - 0. Exit
    
len += formatex(menu[len], sizeof menu len"^n^n\r9.\y %L/%L^n^n\r0.\y %L"id"MENU_NEXT"id"MENU_BACK"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Buy Menu 1")
}

// Buy Menu 2
show_menu_buy2(id)
{
    static 
menu[999], lenweap
    len 
0
    
    
// Title
    
len += formatex(menu[len], sizeof menu len"\r%L^n"id"MENU_BUY2_TITLE")
    
    
// 1-6. Weapon List
    
for (weap 0weap sizeof g_secondary_itemsweap++)
    {
        if(
g_level[id] >= g_levelsecondary[weap])
        
len += formatex(menu[len], sizeof menu len"^n\r%d.\w %s  \y[Level %d]"weap+1WEAPONNAMES[get_weaponid(g_secondary_items[weap])], g_levelsecondary[weap])
        
        else
        
        
len += formatex(menu[len], sizeof menu len"^n\d%d. %s [Level %d]"weap+1WEAPONNAMES[get_weaponid(g_secondary_items[weap])], g_levelsecondary[weap])
        
len += formatex(menu[len], sizeof menu len"^n\r%d.\y %s"weap+1WEAPONNAMES[get_weaponid(g_secondary_items[weap])])
        }
    
    
// 8. Auto Select
    
len += formatex(menu[len], sizeof menu len"^n^n\r8.\w %L \y[%L]"id"MENU_AUTOSELECT"id, (WPN_AUTO_ON) ? "MOTD_ENABLED" "MOTD_DISABLED")
    
    
// 0. Exit
    
len += formatex(menu[len], sizeof menu len"^n^n\r0.\y %L"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Buy Menu 2")

de = gracias !!!
__________________
[IMG]http://img839.**************/img839/1879/dmcdanteprofile.png[/IMG]
Sidix is offline