Raised This Month: $ Target: $400
 0% 

[ES][ZP] No recuerda la arma secundaria


  
 
 
Thread Tools Display Modes
Author Message
eXacT
Veteran Member
Join Date: Apr 2009
Location: Buenos Aires
Old 12-29-2009 , 20:25   [ES][ZP] No recuerda la arma secundaria
#1

Bueno, poray a muchos les de risa o algo asi, es qe me canse de convivir con este drama, bue la cosa viene asi es qe cuando hice los niveles, surgio de la nada el problema de qe recuerda el arma primari, pero no la secundaria (tocando el 8 para q recuerde la selccion), y en cada ronda me recuerda el arma primaria, pero la secundaria me la da para elejir de nuevo xD!, si alguno me ayuda a solucionar este drama, se lo agradesco mucho,
les dejo el code del bloqueo de los menu.


Buy Menu 1
PHP Code:
// Buy Primary Weapon
buy_primary_weapon(idselection)
{
    new 
required_lvl g_levelprimary[selection]
    
    if (
g_level[id] >= required_lvl)
    {
        
// Drop previous weapons
        
drop_weapons(id1)
        
drop_weapons(id2)
        
        
// Strip off from weapons
        
fm_strip_user_weapons(id)
        
fm_give_item(id"weapon_knife")
        
        
// Get weapon index
        
static weaponid
        weaponid 
get_weaponid(g_primary_items[selection])
    
        
// Give the new weapon
        
fm_give_item(idg_primary_items[selection])
        
fm_set_user_bpammo(idweaponidMAXBPAMMO[weaponid])
    
        
// Weapons bought
        
g_canbuy[id] = false
    
        
// Give additional items
        
static i
        
for (0sizeof g_additional_itemsi++)
            
fm_give_item(idg_additional_items[i])
            
        
// Show pistols menu
        
show_menu_buy2(id)
    }
    else
    {
        
client_print(idprint_center"No Tenes Nivel Suficiente Para usar esta Arma (Nivel Requerido %d)"g_levelprimary[selection])
        
show_menu_buy1(id)
    }

Buy menu 2

PHP Code:
// Buy Menu 2
public menu_buy2(idkey)
{    
    
// Zombies or survivors get no guns
    
if (g_zombie[id] || g_survivor[id] || !is_user_alive(id))
        return 
PLUGIN_HANDLED;
    
    
// Special keys / weapon list exceeded
    
if (key >= sizeof g_secondary_items)
    {
        
// Toggle autoselect
        
if (key == MENU_KEY_AUTOSELECT)
            
WPN_AUTO_ON WPN_AUTO_ON
        
        
// Reshow menu unless user exited
        
if (key != MENU_KEY_EXIT)
            
show_menu_buy2(id)
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
required_lvl2 g_levelsecundary[key]
    if (
g_level[id] >= required_lvl2)
    {
        
// Store selected weapon
        
WPN_AUTO_SEC key
    
        
// Drop secondary gun again, in case we picked another (bugfix)
        
drop_weapons(id2)
    
        
// Get weapon index
        
static weaponid
        weaponid 
get_weaponid(g_secondary_items[key])
    
        
// Give the new weapon with full ammo
        
fm_give_item(idg_secondary_items[key])
        
fm_set_user_bpammo(idweaponidMAXBPAMMO[weaponid])
    
        return 
PLUGIN_HANDLED;
    }
    else
    {
        
client_print(idprint_center"No Tenes Nivel Suficiente Para usar esta Arma (Nivel Requerido %d)"g_levelsecundary[key])
        
show_menu_buy2(id)
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE

Saludos !!!!
__________________

"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
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 12-29-2009 , 20:38   Re: [ES][ZP] No recuerda la arma secundaria
#2

Podrias mostrar el show_menu_buy2?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
eXacT
Veteran Member
Join Date: Apr 2009
Location: Buenos Aires
Old 12-29-2009 , 20:39   Re: [ES][ZP] No recuerda la arma secundaria
#3

Quote:
Originally Posted by lucas_7_94 View Post
Podrias mostrar el show_menu_buy2?
si

PHP Code:
show_menu_buy2(id)
{    
    static 
menu[350], lenweap
    len 
0
    
    
// Title
    
len += formatex(menu[len], sizeof menu len"\y%L^n"id"MENU_BUY2_TITLE")
    
    
    
// 1-6. Weapon List
    
for (weap 0weap sizeof g_secondary_itemsweap++)
    {
        if(
g_level[id] >= g_levelsecundary[weap])
        {
            
len += formatex(menu[len], sizeof menu len"^n\r%d.\w %s  \y[Nivel %d]"weap+1WEAPONNAMES[get_weaponid(g_secondary_items[weap])], g_levelsecundary[weap])
        }
        else
        {
            
len += formatex(menu[len], sizeof menu len"^n\d%d. %s [\rNivel %d\d]"weap+1WEAPONNAMES[get_weaponid(g_secondary_items[weap])], g_levelsecundary[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.\w %L"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Buy Menu 2")

__________________

"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
Kiske
Veteran Member
Join Date: May 2009
Old 12-29-2009 , 22:37   Re: [ES][ZP] No recuerda la arma secundaria
#4

Aaa jajaja, ese error de qe no recuerda el Arma Secundaria, ya lo eh visto en Varios ZPs con Restriccion de Armas.

Es porque ponen mal la Restriccion.


En vez de hacer la Restriccion aca:
PHP Code:
buy_primary_weapon(idselection

Haganla aca:

PHP Code:
menu_buy1

// Aca el Ejemplo:

public menu_buy1(idkey)
{
    
// Zombies or survivors get no guns
    
if (g_zombie[id] || g_survivor[id] || !is_user_alive(id))
        return 
PLUGIN_HANDLED;
    
    
// Special keys / weapon list exceeded
    
if (key >= MENU_KEY_AUTOSELECT || WPN_SELECTION >= WPN_MAXIDS)
    {
        switch (
key)
        {
            case 
MENU_KEY_AUTOSELECT// toggle auto select
            
{
                
WPN_AUTO_ON WPN_AUTO_ON
            
}
            case 
MENU_KEY_NEXT// next/back
            
{
                if (
WPN_STARTID+WPN_MAXIDS)
                    
WPN_STARTID += 7
                
else
                    
WPN_STARTID 0
            
}
            case 
MENU_KEY_EXIT// exit
            
{
                return 
PLUGIN_HANDLED;
            }
        }
        
        
// Show buy menu again
        
show_menu_buy1(id)
        return 
PLUGIN_HANDLED;
    }
    
    if(
g_level[id] < g_levelprimary[WPN_SELECTION])
    {
        
show_menu_buy1(id)
        
ChatColor(id"!g[UqZ]!y No tenes Level suficiente"])
        
        return 
PLUGIN_HANDLED;
    }
    
    
// Store selected weapon id
    
WPN_AUTO_PRI WPN_SELECTION
    
    
// Buy primary weapon
    
buy_primary_weapon(idWPN_AUTO_PRI)
    
    
// Show pistols menu
    
show_menu_buy2(id)
    
    return 
PLUGIN_HANDLED;

Y en el BUY_PRIMARY deja todo como estaba antes ;)
Veras que ahora te recordara el Arma Secundaria ^^
__________________

Kiske is offline
Send a message via Skype™ to Kiske
eXacT
Veteran Member
Join Date: Apr 2009
Location: Buenos Aires
Old 12-29-2009 , 23:10   Re: [ES][ZP] No recuerda la arma secundaria
#5

gracias kiske
__________________

"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
 



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


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