View Single Post
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