AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help in Zombie Plague (https://forums.alliedmods.net/showthread.php?t=163834)

Kevin27_kpo 08-03-2011 20:40

Help in Zombie Plague
 
hello people, I have a bug with the zombie plague 4.2 that I'm passing levels.
I did the level, which would fail me to put the restriction of zombies, but when I follow the steps Kiske, I get loose identation (warnings)

PHP Code:

// Zombie Class Menu
public show_menu_zclass(id)
{
    
// Player disconnected
    
if (!is_user_connected(id))
        return;
    
    
// Bots pick their zombie class randomly
    
if (is_user_bot(id))
    {
        
g_zombieclassnext[id] = random_num(0g_zclass_i 1)
        return;
    }
    
    static 
menu[400], len, class
    
len 0
    
    
// Title
    
len += formatex(menu[len], sizeof menu len"\y%L \r[%d-%d]^n^n"id"MENU_ZCLASS_TITLE"ZCLASSES_STARTID+1min(ZCLASSES_STARTID+7g_zclass_i))
    
    
// 1-7. Class List
    
for (class = ZCLASSES_STARTID; class < min(ZCLASSES_STARTID+7g_zclass_i); class++)
    {
        if (
g_level[id] >= g_zclass_lvl[class])
        {
            if (class == 
g_zombieclassnext[id])
                
len += formatex(menu[len], sizeof menu len"\d%d. %s %s^n", class-ZCLASSES_STARTID+1g_zclass_name[class], g_zclass_info[class])
            else
                
len += formatex(menu[len], sizeof menu len"\r%d.\w %s\y %s^n", class-ZCLASSES_STARTID+1g_zclass_name[class], g_zclass_info[class])
        }
        else 
    {
            
len += formatex(menu[len], sizeof menu len"\r%d.\d %s %s\r (Nivel Requerido: %d)^n", class-ZCLASSES_STARTID+1g_zclass_name[class], g_zclass_info[class], g_zclass_lvl[class])
    } 
    
// 8. Back - 9. Next - 0. Exit
    
    
    
    
    
    
len += formatex(menu[len], sizeof menu len"^n\r8.\w %L^n\r9.\w %L^n^n\r0.\w %L"id"MENU_BACK"id"MENU_NEXT"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Zombie Class Menu")
}} 

and this part to

PHP Code:

public menu_zclass(idkey)
{
    
// Special keys / items list exceeded
    
if (key >= MENU_KEY_BACK || ZCLASSES_SELECTION >= g_zclass_i)
    {
        switch (
key)
        {
            case 
MENU_KEY_BACK// back
            
{
                if (
ZCLASSES_STARTID->= 0ZCLASSES_STARTID -= 7
            
}
            case 
MENU_KEY_NEXT// next
            
{
                if (
ZCLASSES_STARTID+g_zclass_iZCLASSES_STARTID += 7
            
}
            case 
MENU_KEY_EXIT// exit
            
{
                return 
PLUGIN_HANDLED;
            }
        }
        
        
// Show extra items menu again
        
show_menu_zclass(id)
        return 
PLUGIN_HANDLED;
    }
    
    if (
g_level[id] >= g_zclass_lvl[ZCLASSES_SELECTION])
    {
        
// Store selection for the next infection
        
g_zombieclassnext[id] = ZCLASSES_SELECTION;
        
        
// Show selected zombie class info and stats
    
zp_colored_print(id"^x04[ZP]^x01 %L: %s"id"ZOMBIE_SELECT"g_zclass_name[g_zombieclassnext[id]])
    
zp_colored_print(id"^x04[ZP]^x01 %L: %d %L: %d %L: %d %L: %d%%"id"ZOMBIE_ATTRIB1"g_zclass_hp[g_zombieclassnext[id]], id"ZOMBIE_ATTRIB2"g_zclass_spd[g_zombieclassnext[id]],
    
id"ZOMBIE_ATTRIB3"floatround(g_zclass_grav[g_zombieclassnext[id]]*800), id"ZOMBIE_ATTRIB4"floatround(g_zclass_kb[g_zombieclassnext[id]]*100))
    }
    else
    {
        
zp_colored_print(id"^x04[ZP]^x01 No tenes Nivel suficiente para elegir esta Clase de Zombie. [Nivel Requerido: %d]"g_zclass_lvl[ZCLASSES_SELECTION])
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_HANDLED;  


I fix a few warnigs but i have a lot of problems
if someone could help me, I thank you very much
sorry but my english

hornet 08-03-2011 21:10

Re: Help in Zombie Plague
 
Loose indentation warnings mean that you haven't tabbed ( / indented ) your code properly.

But if it's only warnings that your getting then your plugin will still compile fine.


All times are GMT -4. The time now is 03:31.

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