AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   loose identation agen..... (https://forums.alliedmods.net/showthread.php?t=12876)

WaZZeR++ 04-27-2005 15:32

loose identation agen.....
 
1 Attachment(s)
damn, i cant get i right

can some one help with thit these warnings?

i have try a lot now, but still 3 warnings...
Code:

votekickbanmenu13.sma(64) : warning 217: loose indentation
votekickbanmenu13.sma(68) : warning 217: loose indentation
votekickbanmenu13.sma(143) : warning 217: loose indentation


nightscreem 04-27-2005 16:20

try http://www.avalanche.epherion.com/indenter/

WaZZeR++ 04-28-2005 16:30

i get:

Unexpected indentation error on line 177 of your file.

The error is probably not on that line. Possibly braces or
multi-line comments inside of strings are disrupting this script.

teame06 04-28-2005 16:58

Code:
 Your Code public cmdVoteMenu( id, lvl, cid ) {     if( cmd_access( id, lvl, cid, 0 ) )             g_iMenuOption[id] = 0         g_iMenuSettings[id] = 0         showVoteMenu( id, g_iMenuPosition = 0 )         return PLUGIN_HANDLED }

This is the same thing you did on your last one..

Code:
 This fixes two of the loose indentation public cmdVoteMenu( id, lvl, cid ) {     if( cmd_access( id, lvl, cid, 0 ) )     {         g_iMenuOption[id] = 0         g_iMenuSettings[id] = 0         showVoteMenu( id, g_iMenuPosition = 0 )     }     return PLUGIN_HANDLED }

You need to learn to when to put in { } during if statements.

WaZZeR++ 04-28-2005 17:11

thx, but the one on line 143?

Code:
public actionVoteMenu( id, key ) {     switch( key )     {         case 7: {   //The switch key             ++g_iMenuOption[id]             g_iMenuOption[id] %= 2             switch(g_iMenuOption[id]){             case 0: g_iMenuSettings[id] = 0    //kick             case 1: g_iMenuSettings[id] = 1    //ban             }             showVoteMenu( id, g_iMenuPosition ) //143         }         case 8: showVoteMenu( id, ++g_iMenuPosition ) // More Option         case 9: showVoteMenu( id, --g_iMenuPosition ) // Back Option         // Chose a Player         default:         .........         {

teame06 04-28-2005 17:28

I suggest you use one of these programs

www.crimsoneditor.com or the one posted on this forum. http://forums.alliedmods.net/showthread.php?t=12835

Use Tab Spacing indentation.

WaZZeR++ 04-28-2005 17:32

well, i got i right now. testing it tomorrow.

I'm using Crimson editor, but i havnt found a tab spce indicator, ill try to find it....

teame06 04-28-2005 20:36

What i mean by use Tab indentation, don't use certain amount of spaces to tab it, use the Tab Button on your keyboard.

devicenull 04-28-2005 22:35

Code:
        case 7: {   //The switch key             ++g_iMenuOption[id]             g_iMenuOption[id] %= 2             switch(g_iMenuOption[id]){             case 0: g_iMenuSettings[id] = 0    //kick             case 1: g_iMenuSettings[id] = 1    //ban             } //This should not be here, get rid of it         showVoteMenu( id, g_iMenuPosition ) // This is techically outside of the case 7: block         }

WaZZeR++ 04-29-2005 06:53

this worked to:

Code:
public actionVoteMenu( id, key ) {     switch( key )     {         case 7: {   //The switch key             ++g_iMenuOption[id]             g_iMenuOption[id] %= 2             switch(g_iMenuOption[id]){             case 0: g_iMenuSettings[id] = 0    //kick             case 1: g_iMenuSettings[id] = 1    //ban             }                   showVoteMenu( id, g_iMenuPosition ) //just added 4 spaces         }         case 8: showVoteMenu( id, ++g_iMenuPosition ) // More Option         case 9: showVoteMenu( id, --g_iMenuPosition ) // Back Option         // Chose a Player         default:         .........         {


All times are GMT -4. The time now is 16:38.

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