Raised This Month: $ Target: $400
 0% 

[ZP] duda con la restricción de armas 4.3


  
 
 
Thread Tools Display Modes
Author Message
Sidix
Senior Member
Join Date: Feb 2011
Location: Limbo City
Old 04-30-2012 , 17:58   [ZP] duda con la restricción de armas 4.3
#1

Hola a todos bueno yo uso la versión 4.3 Fix5a mi duda/problema es que saqué las restricciones de armas por niveles del zombie anihilation porque el metodo que existe para la version 4.2 no me funciona y puse el del zp de L// que es version 4.3 el problema es porque cuando entro al server al elegir un arma aparecen todas "Min lvl 1"

ejemplo:
Code:
Arma primaria [1-7]

1. Schmidt TMP [Min Lvl: 1]
2. ES P90 [Min Lvl: 1]
3. XM1014 M4 [Min Lvl: 1]
4. Ingram MAC-10 [Min Lvl: 1]
5. Steyr AUG A1 [Min Lvl: 1]
6. AK-47 Kalashnikov [Min Lvl: 1]
7. MP5 Navy [Min Lvl: 1]

8. Recordar Selección [Deshabilitado]

9. Siguiente/Anterior

0. Salir.
PHP Code:
// Buy Menu 1
public show_menu_buy1(taskid)
{
    
// Get player's id
    
static id
    
(taskid g_maxplayers) ? (id ID_SPAWN) : (id taskid);
    
    
// Player dead?
    
if (!g_isalive[id])
        return;
    
    
// Zombies, survivors or snipers get no guns
    
if (g_zombie[id] || g_survivor[id] || g_sniper[id])
        return;
    
    
// Bots pick their weapons randomly / Random weapons setting enabled
    
if (get_pcvar_num(cvar_randweapons) || g_isbot[id])
    {
        
buy_primary_weapon(idrandom_num(0ArraySize(g_primary_items) - 1))
        
menu_buy2(idrandom_num(0ArraySize(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)
        
        
buy_all_weapon(id)
        return;
    }
    
    static 
menu[300], lenweapmaxloopsweap_level
    len 
0
    maxloops 
min(WPN_STARTID+7WPN_MAXIDS)
    
    
// Title
    
len += formatex(menu[len], charsmax(menu) - len"\y%L \r[%d-%d]^n^n"id"MENU_BUY1_TITLE"WPN_STARTID+1min(WPN_STARTID+7WPN_MAXIDS))
    
    
// 1-7. Weapon List
    
for (weap WPN_STARTIDweap maxloopsweap++)
    {
        
weap_level ArrayGetCell(g_primary_levelweap)
        
        if (
g_level[id] < weap_level)
            
len += formatex(menu[len], charsmax(menu) - len"\d%d. %s (\rMin Lvl \w%d\d)^n"weap-WPN_STARTID+1WEAPONNAMES[ArrayGetCell(g_primary_weaponidsweap)], weap_level)
        else
            
len += formatex(menu[len], charsmax(menu) - len"\r%d.\w %s \d(\yMin Lvl \w%d\d)^n"weap-WPN_STARTID+1WEAPONNAMES[ArrayGetCell(g_primary_weaponidsweap)], weap_level)
    }
    
    
// 8. Auto Select
    
len += formatex(menu[len], charsmax(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], charsmax(menu) - len"^n^n\r9.\w %L/%L^n^n\r0.\w %L"id"MENU_NEXT"id"MENU_BACK"id"MENU_EXIT")
    
    
// Fix for AMXX custom menus
    
if (pev_valid(id) == PDATA_SAFE)
        
set_pdata_int(idOFFSET_CSMENUCODE0OFFSET_LINUX)
    
    
show_menu(idKEYSMENUmenu, -1"Buy Menu 1")
}

// Buy Menu 2
show_menu_buy2(id)
{
    
// Player dead?
    
if (!g_isalive[id])
        return;
    
    static 
menu[250], lenweapmaxloopsweap_level
    len 
0
    maxloops 
ArraySize(g_secondary_items)
    
    
// Title
    
len += formatex(menu[len], charsmax(menu) - len"\y%L^n"id"MENU_BUY2_TITLE")
    
    
// 1-6. Weapon List
    
for (weap 0weap maxloopsweap++)
    {
        
weap_level ArrayGetCell(g_secondary_levelweap)

        if (
g_level[id] < weap_level)
            
len += formatex(menu[len], charsmax(menu) - len"\d%d. %s (\rMin Lvl \w%d\d)^n"weap+1WEAPONNAMES[ArrayGetCell(g_secondary_weaponidsweap)], weap_level)
        else
            
len += formatex(menu[len], charsmax(menu) - len"\r%d.\w %s \d(\yMin Lvl \w%d\d)^n"weap+1WEAPONNAMES[ArrayGetCell(g_secondary_weaponidsweap)], weap_level)
    }
    
    
// 8. Auto Select
    
len += formatex(menu[len], charsmax(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], charsmax(menu) - len"^n^n\r0.\w %L"id"MENU_EXIT")
    
    
// Fix for AMXX custom menus
    
if (pev_valid(id) == PDATA_SAFE)
        
set_pdata_int(idOFFSET_CSMENUCODE0OFFSET_LINUX)
    
    
show_menu(idKEYSMENUmenu, -1"Buy Menu 2")

PHP Code:
// Buy Menu 1
public menu_buy1(idkey)
{
    
// Player dead?
    
if (!g_isalive[id])
        return 
PLUGIN_HANDLED;
    
    
// Zombies, survivors or snipers get no guns
    
if (g_zombie[id] || g_survivor[id] || g_sniper[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;
    }
    
    new 
weap_level ArrayGetCell(g_primary_levelWPN_SELECTION)
    
    if (
weap_level && (g_level[id] < weap_level))
    {
        
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_LEVEL"weap_level)

        
// Show buy menu again
        
show_menu_buy1(id)
        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;
}

// Buy Menu 2
public menu_buy2(idkey)
{
    
// Player dead?
    
if (!g_isalive[id])
        return 
PLUGIN_HANDLED;
    
    
// Zombies, survivors or snipers get no guns
    
if (g_zombie[id] || g_survivor[id] || g_sniper[id])
        return 
PLUGIN_HANDLED;
    
    
// Special keys / weapon list exceeded
    
if (key >= ArraySize(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 
weap_level ArrayGetCell(g_secondary_levelkey)
    
    if (
weap_level && (g_level[id] < weap_level))
    {
        
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_LEVEL"weap_level)

        
// Show buy menu again
        
show_menu_buy2(id)
        return 
PLUGIN_HANDLED;        
    }    
    
    
// Store selected weapon
    
WPN_AUTO_SEC key
    
    
// Drop secondary gun again, in case we picked another (bugfix)
    
drop_weapons(id2)
    
    
// Get weapon's id
    
static weaponidwname[32]
    
weaponid ArrayGetCell(g_secondary_weaponidskey)
    
ArrayGetString(g_secondary_itemskeywnamecharsmax(wname))
    
    
// Give the new weapon and full ammo
    
fm_give_item(idwname)
    
ExecuteHamB(Ham_GiveAmmoidMAXBPAMMO[weaponid], AMMOTYPE[weaponid], MAXBPAMMO[weaponid])
    
    
show_menu_buy3(id)
    
    return 
PLUGIN_HANDLED;


en esta parte tengo la duda por que al cambiar el valor 1 a 2 todas las armas se restringen a lvl 2
PHP Code:
case SECTION_BUY_MENU_WEAPONS:
            {
                if (
equal(key"PRIMARY"))
                {
                    
// Set up some vars to hold parsing info
                    
new weap_ent_name[32], level[5]                    
                    
                    
// Parse weapons
                    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
                    {
                        
// Trim spaces
                        
trim(key)
                        
trim(value)
                        
                        
strtok(keyweap_ent_namecharsmax(weap_ent_name), levelcharsmax(level), ':')

                        if (
level[0])
                        {
                            
trim(level)                        
                            
ArrayPushCell(g_primary_levelstr_to_num(level))
                        }
                        else
                            
ArrayPushCell(g_primary_level1)  // Esta es la Línea...
                        
                        // Trim spaces
                        
trim(weap_ent_name)                        

                        
// Add to weapons array
                        
ArrayPushString(g_primary_itemsweap_ent_name)
                        
ArrayPushCell(g_primary_weaponidscs_weapon_name_to_id(weap_ent_name))
                    }                    
                }
                else if (
equal(key"SECONDARY"))
                {
                    
// Set up some vars to hold parsing info
                    
new weap_ent_name[32], level[5]                    
                    
                    
// Parse weapons
                    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
                    {
                        
// Trim spaces
                        
trim(key)
                        
trim(value)
                        
                        
strtok(keyweap_ent_namecharsmax(weap_ent_name), levelcharsmax(level), ':')
                        
                        if (
level[0])
                        {
                            
trim(level)                        
                            
ArrayPushCell(g_secondary_levelstr_to_num(level))
                        }
                        else
                            
ArrayPushCell(g_secondary_level1// Esta es la Línea...
                        
                        // Trim spaces
                        
trim(weap_ent_name)                        

                        
// Add to weapons array
                        
ArrayPushString(g_secondary_itemsweap_ent_name)
                        
ArrayPushCell(g_secondary_weaponidscs_weapon_name_to_id(weap_ent_name))
                    }                    
                }
            } 
lo que quiero saber es como puedo restringir las armas con valores diferentes...

ejemplo:
Code:
Arma primaria [1-7]

1. Schmidt TMP [Min Lvl: 1]
2. ES P90 [Min Lvl: 5]
3. XM1014 M4 [Min Lvl: 8]
4. Ingram MAC-10 [Min Lvl: 10]
5. Steyr AUG A1 [Min Lvl: 13]
6. AK-47 Kalashnikov [Min Lvl: 17]
7. MP5 Navy [Min Lvl: 20]

8. Recordar Selección [Deshabilitado]

9. Siguiente/Anterior

0. Salir.
estuve tratando de editar el zombieplague.ini pero no logré nada...

Gracias de antemano
__________________
[IMG]http://img839.**************/img839/1879/dmcdanteprofile.png[/IMG]

Last edited by Sidix; 04-30-2012 at 18:12.
Sidix is offline
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 04-30-2012 , 21:17   Re: [ZP] duda con la restricción de armas 4.3
#2

¿Que es
PHP Code:
weap_level 
?

Last edited by XINLEI; 04-30-2012 at 21:17.
XINLEI is offline
Sidix
Senior Member
Join Date: Feb 2011
Location: Limbo City
Old 05-02-2012 , 10:59   Re: [ZP] duda con la restricción de armas 4.3
#3

https://forums.alliedmods.net/showthread.php?t=119596

alguien que me ayude.... ???
__________________
[IMG]http://img839.**************/img839/1879/dmcdanteprofile.png[/IMG]

Last edited by Sidix; 05-02-2012 at 10:59.
Sidix is offline
Sambuseti
Member
Join Date: Jun 2011
Location: Chile
Old 05-18-2012 , 02:27   Re: [ZP] duda con la restricción de armas 4.3
#4

en el .ini del zp

PHP Code:
PRIMARY weapon_tmp:weapon_mac10:weapon_ump45:15 weapon_p90:25 weapon_galil:35 weapon_sg552:45 weapon_mp5navy:60 weapon_scout:79 weapon_aug:95 weapon_xm1014:120 weapon_m4a1:150 weapon_famas:180 weapon_ak47:205 weapon_m3:238 weapon_awp:285 weapon_sg550:340 weapon_g3sg1:380
SECONDARY 
weapon_glock18:weapon_usp:25 weapon_p228:75 weapon_elite:100 weapon_fiveseven:150 weapon_deagle:200 
Sambuseti is offline
Send a message via MSN to Sambuseti Send a message via Skype™ to Sambuseti
Sidix
Senior Member
Join Date: Feb 2011
Location: Limbo City
Old 05-18-2012 , 11:00   Re: [ZP] duda con la restricción de armas 4.3
#5

Ya lo pude solucionar de todas formas gracias por tu respuesta.

Saludos.
__________________
[IMG]http://img839.**************/img839/1879/dmcdanteprofile.png[/IMG]
Sidix is offline
Matians
Veteran Member
Join Date: Nov 2010
Location: ME QUIEREN ROBAR
Old 05-18-2012 , 17:21   Re: [ZP] duda con la restricción de armas 4.3
#6

Quote:
Originally Posted by Sidix View Post
Ya lo pude solucionar de todas formas gracias por tu respuesta.

Saludos.
Porfavor ami me pasa lo mismo, postea la solucion D:
Matians is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 05-18-2012 , 15:58   Re: [ZP] duda con la restricción de armas 4.3
#7

Dejá la solución que utilizaste.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
GalaxyA
BANNED
Join Date: Sep 2012
Location: Noob Member
Old 09-06-2012 , 23:01   Re: [ZP] duda con la restricción de armas 4.3
#8

pliss queremos la solucion todos queremos saber
GalaxyA is offline
Send a message via MSN to GalaxyA
 



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 22:37.


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