Raised This Month: $12 Target: $400
 3% 

[ZP] Crear Niveles por AmmoPacks


  
 
 
Thread Tools Display Modes
TimooCS
Veteran Member
Join Date: Dec 2012
Location: Argentina
Old 07-01-2013 , 14:44   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#171

Quote:
Originally Posted by Axelromero91 View Post
Se me buguea cuando alcanzo el nivel maximo y cuando gasto un ammopack me salta el print diciendo que baje de nivel... como lo soluciono...?
no entendi... para el nivel maximo has esto -->

PHP Code:
if(g_level[id] == 250) return; // 250 es el nivel maximo... 
__________________
TimooCS is offline
Send a message via MSN to TimooCS Send a message via Skype™ to TimooCS
Axelromero91
Member
Join Date: Jun 2013
Location: Buenos Aires, Argentina
Old 07-01-2013 , 22:14   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#172

Te explico, tengo nivel 1, y para llegar a nivel 2 necesito 20 ammopacks, gano 25 ammopacks y subo a nivel 2
y gasto 5 ammopacks me quedan los 20 que necesiaba para el nivel 2, pero me salta el print que baje de nivel, osea gasto un ammopacks y me tira el print y me baja el level.....

En donde hira ese if(g_level[id] == 250) return; ?

Last edited by Axelromero91; 07-01-2013 at 22:15.
Axelromero91 is offline
Send a message via MSN to Axelromero91
TimooCS
Veteran Member
Join Date: Dec 2012
Location: Argentina
Old 07-01-2013 , 22:53   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#173

Quote:
Originally Posted by Axelromero91 View Post
Te explico, tengo nivel 1, y para llegar a nivel 2 necesito 20 ammopacks, gano 25 ammopacks y subo a nivel 2
y gasto 5 ammopacks me quedan los 20 que necesiaba para el nivel 2, pero me salta el print que baje de nivel, osea gasto un ammopacks y me tira el print y me baja el level.....

En donde hira ese if(g_level[id] == 250) return; ?
ahhhh.... mmm..
PHP Code:
public update_ap(idamountcheck)
{    
    if (
g_level[id] == 258) return; // aca...
    
if (!check)
    {    
        if (
g_ammopacks[id] + amount NIVELES[sizeof NIVELES 1] - 1)
            return 
PLUGIN_HANDLED
    
        g_ammopacks
[id] += amount
    
}
    else
    {
        if(
amount 0)
        {
            if(
g_ammopacks[id] < NIVELES[g_level[id]])
            {
                
g_level[id]--
                
client_print(idprint_center"Bajaste de nivel")
                
update_ap(id, -11)
            }
        }
        else
        {
            if(
g_ammopacks[id] >= NIVELES[g_level[id]])
            {
                
g_level[id]++
                
client_print(idprint_center"Subiste de nivel")
                
update_ap(id01
            }
        }
    }
    
    return 
PLUGIN_HANDLED

y con lo otro no se... yo te recomendaria que uses macros..
ahh y ahora que me doy cuenta, en este sistema de levels no tienes que poner el nivel maximo.. porque ya lo defines.. mira
PHP Code:
new const NIVELES[5] = { 51020 50 // el 5 que esta en corchetes es el nivel maximo.. 
aunque .. tedigo? macros es la onda , te ahorras mucho code.. aca te dejo el TUT si tienes alguna duda MP o crea un thread, Nv.
__________________
TimooCS is offline
Send a message via MSN to TimooCS Send a message via Skype™ to TimooCS
Old 07-01-2013, 23:11
Brad6ford
This message has been deleted by lucas_7_94. Reason: spambot
Axelromero91
Member
Join Date: Jun 2013
Location: Buenos Aires, Argentina
Old 09-19-2013 , 23:10   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#174

Yo hice lo siguiente, en ves de crear una const que contengo los ap's para los niveles use una macro simple:
PHP Code:
#define EXPLVL(%1) (%1 * 10)
#define MAXLVL 100
new g_lvl[33
y me tira este error:

//// zombie_plague40.sma
// D:\Archivos de programa\valve\cstrike\addons\amxmodx\scri
ting\zombie_plague40.sma(8437) : error 017: undefined symbol "EXPLVL"
//
// 1 Error.
// Could not locate output file compiled\zombie_plague40.amx (compile failed).
//
// Compilation Time: 3,59 sec

estas son las lineas, antes me tiraba mas errores pero los arregle, y ahora me queda ese error.


PHP Code:
public update_ap(idamountcheck)
{
    if (
check) goto check2 
   
    
    
if (g_ammopacks[id] + amount >= EXPLVL(sizeof EXPLVL 1) - 1//<- esta es la linea 8437
        
return PLUGIN_HANDLED
    
    
    g_ammopacks
[id] += amount
    
    
    check2
:
    if(
amount 0)
    {
        if(
g_ammopacks[id] < EXPLVL(g_lvl[id]))
        {
            
g_lvl[id]--
            
client_print(idprint_center"Bajaste de nivel")
            
update_ap(id, -11)
        }

    }
    else
    {
        if(
g_ammopacks[id] >= EXPLVL(g_lvl[id]))
        {
            
g_lvl[id]++
            
client_print(idprint_center"Subiste de nivel")
            
update_ap(id01
        }
    }
    
    return 
PLUGIN_HANDLED

Alguien que me ayude, siempre que lo hago con macros me tira error porque con la const no me pasaba los mismo.
Gracias de antemano.

Last edited by Axelromero91; 05-02-2014 at 16:04.
Axelromero91 is offline
Send a message via MSN to Axelromero91
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 09-20-2013 , 09:23   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#175

con las macros no hay "casi" limite (por no decir que no tienen), sería imposible llegar a él, a si que borra esa línea.
baneado is offline
Old 09-20-2013, 10:55
Axelromero91
This message has been deleted by Axelromero91.
Axelromero91
Member
Join Date: Jun 2013
Location: Buenos Aires, Argentina
Old 09-20-2013 , 18:29   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#176

Listo, ahora funciona perfecto...
Gracias.
Axelromero91 is offline
Send a message via MSN to Axelromero91
 


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


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