AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Loose indentation? how can i fix it? (https://forums.alliedmods.net/showthread.php?t=311693)

maxpayn 10-29-2018 11:01

Loose indentation? how can i fix it?
 
1 Attachment(s)
I'm new member of alliedmods and the only 1 reason i came here because i want to ask you guys that how can i fix a problem called: loose indentation in sourcemod scripting when i compile my script that error shows everytime... here's my script down below...

xines 10-29-2018 11:32

Re: Loose indentation? how can i fix it?
 
It's because you mix spaces with tabs.

Spoiler

maxpayn 10-29-2018 17:21

Re: Loose indentation? how can i fix it?
 
Quote:

Originally Posted by xines (Post 2621802)
It's because you mix spaces with tabs.

Spoiler
Can you fix it for me ?


PC Gamer 10-30-2018 09:33

Re: Loose indentation? how can i fix it?
 
1 Attachment(s)
I used the TextFX plugin for Notepad++ to reindent the attached file.

xines 10-31-2018 12:55

Re: Loose indentation? how can i fix it?
 
Maxpayn, if you paid attention you'd realize i put the fixed script along with my post...

Hint: "it's in the spoiler"

Dragokas 11-01-2018 12:46

Re: Loose indentation? how can i fix it?
 
max, you expirience problems with compilation not because of indentation warnings,
but because error in prototype of menu handler.

In old syntax:
Code:

public Action:AdminSoundsMenuHandler(Handle:menu, MenuAction:action, param1, param2)
I guess it should be:
Code:

public AdminSoundsMenuHandler(Handle:menu, MenuAction:action, param1, param2)
or
Code:

public int AdminSoundsMenuHandler(Handle:menu, MenuAction:action, param1, param2)

Swolly 11-02-2018 07:18

Re: Loose indentation? how can i fix it?
 
#pragma tabsize 0 this code fixing this error

Bacardi 11-02-2018 08:07

Re: Loose indentation? how can i fix it?
 
Quote:

Originally Posted by Swolly (Post 2622274)
#pragma tabsize 0 this code fixing this error

More like bypass error

Dragokas 11-02-2018 08:58

Re: Loose indentation? how can i fix it?
 
Personally, I like this indentation warning feature. Saved me few times warn the place where I have really forgot a wrong code logic.
Just curious, are there any program languages where such feature exist too?

Ilusion9 11-02-2018 11:49

Re: Loose indentation? how can i fix it?
 
Quote:

Originally Posted by Dragokas (Post 2622195)
I guess it should be:
Code:

public AdminSoundsMenuHandler(Handle:menu, MenuAction:action, param1, param2)
or
Code:

public int AdminSoundsMenuHandler(Handle:menu, MenuAction:action, param1, param2)

Code:

public int AdminSoundsMenuHandler(Menu menu, MenuAction action, int param1, int param2)


All times are GMT -4. The time now is 13:20.

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