Raised This Month: $ Target: $400
 0% 

[ZP] Como hacer zp_Reset


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Nico1
Senior Member
Join Date: Oct 2010
Old 02-01-2011 , 12:50   [ZP] Como hacer zp_Reset
#1

Bueno Primero vamos a
Code:
// Player vars
y hay ponemos
Code:
reset_pj[33]
Ahora vamos a
Code:
public client_putinserver
Y hay agregamos
Code:
reset_pj[id] = 0
despues vamos a
Code:
    // Client commands
y hay ponemos
Code:
register_clcmd("reset", "menu_reset")
Ahora vamos a
Code:
// Game Menu
Y hay ponemos
Code:
len += formatex(menu[len], sizeof menu - 1 - len, "\r8.\r Reset Menu!^n^n")
Ahora vamos a
Code:
menu_game(id, key)
Y hay agregamos
Code:
        case 7: 
        {
        client_cmd(id, "reset")
        }
Ahora vamos al final del plugin y ponemos
Code:
 public menu_reset(id)
{
    new Menu1 = menu_create("\yResetear Personaje^n^n^n\r- \wRequisitos^n\r- Nivel:\y554", "menu_resethandler")
    
    if (Lvl[id] >= 250)
        menu_additem(Menu1, "\y Resetear Personaje^n^n", "1", 0)
    else
        menu_additem(Menu1, "\d Resetear Personaje^n^n", "1", 0)
    
    menu_additem(Menu1, "\r No, no quiero resetear^n^n^n^n^n^n^n^n^n^n^n", "2", 0)
    
    menu_setprop(Menu1,MPROP_EXITNAME,"\y Salir")
    menu_setprop(Menu1, MPROP_EXIT, MEXIT_ALL)
    menu_display(id, Menu1, 0)
    return PLUGIN_HANDLED
}

public menu_resethandler(id, Menu1, item)
{
    if (item == MENU_EXIT)
    {
        menu_destroy(Menu1)
        return PLUGIN_HANDLED
    }
    
    new Data[6], Name[64]
    new Access, Callback
    menu_item_getinfo(Menu1, item, Access, Data, sizeof(Data)-1, Name, sizeof(Name)-1, Callback)
    
    new Key = str_to_num(Data)
    
    switch (Key)
    {
        case 1:
        {
            if (reset_pj[id] >= 999)
            {
                zp_colored_print(id, "^x03[^x04ZP^x03]^x01 Llegastes al level maximo de resets")
                client_print(id, print_center, "Llegastes al level maximo de resets")
                return PLUGIN_HANDLED
            }
            if (g_ammopacks[id] >= 1000000)
            {
                Lvl[id] = 1
                g_ammopacks[id] = 4
                reset_pj[id]++
                zp_colored_print(id, "^x03[^x04ZP^x03]^x01 Acabas de resetear!")
                client_print(id, print_center, "Acabas de resetear!")
            }
            else
            {
                zp_colored_print(id, "^x03[^x04ZP^x03]^x01 Para resetear necesitas ser level:^x03 554")
                client_print(id, print_center, "Para resetear necesitas ser level:^x03 554")
            }
            menu_reset(id)
        }
    }
    menu_destroy(Menu1)
    return PLUGIN_HANDLED
}
]
Listo nos vemos
__________________

Last edited by Nico1; 02-01-2011 at 13:16.
Nico1 is offline
 


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 18:28.


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