Raised This Month: $51 Target: $400
 12% 

Loose indentation? how can i fix it?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
maxpayn
New Member
Join Date: Aug 2018
Old 10-29-2018 , 11:01   Loose indentation? how can i fix it?
Reply With Quote #1

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...
Attached Files
File Type: sp Get Plugin or Get Source (mxadminsounds.sp - 111 views - 2.9 KB)

Last edited by Fyren; 10-29-2018 at 12:54. Reason: read the rules, don't style your entire post
maxpayn is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 10-29-2018 , 11:32   Re: Loose indentation? how can i fix it?
Reply With Quote #2

It's because you mix spaces with tabs.

Spoiler
__________________
xines is offline
maxpayn
New Member
Join Date: Aug 2018
Old 10-29-2018 , 17:21   Re: Loose indentation? how can i fix it?
Reply With Quote #3

Quote:
Originally Posted by xines View Post
It's because you mix spaces with tabs.

Spoiler
Can you fix it for me ?
maxpayn is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 10-30-2018 , 09:33   Re: Loose indentation? how can i fix it?
Reply With Quote #4

I used the TextFX plugin for Notepad++ to reindent the attached file.
Attached Files
File Type: sp Get Plugin or Get Source (mxadminsounds.sp - 90 views - 2.8 KB)
PC Gamer is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 10-31-2018 , 12:55   Re: Loose indentation? how can i fix it?
Reply With Quote #5

Maxpayn, if you paid attention you'd realize i put the fixed script along with my post...

Hint: "it's in the spoiler"
__________________
xines is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 11-01-2018 , 12:46   Re: Loose indentation? how can i fix it?
Reply With Quote #6

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)
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 11-01-2018 at 12:46.
Dragokas is offline
Swolly
Senior Member
Join Date: Jul 2018
Location: Turkey
Old 11-02-2018 , 07:18   Re: Loose indentation? how can i fix it?
Reply With Quote #7

#pragma tabsize 0 this code fixing this error
Swolly is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-02-2018 , 08:07   Re: Loose indentation? how can i fix it?
Reply With Quote #8

Quote:
Originally Posted by Swolly View Post
#pragma tabsize 0 this code fixing this error
More like bypass error
__________________
Do not Private Message @me
Bacardi is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 11-02-2018 , 08:58   Re: Loose indentation? how can i fix it?
Reply With Quote #9

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?
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 11-02-2018 , 11:49   Re: Loose indentation? how can i fix it?
Reply With Quote #10

Quote:
Originally Posted by Dragokas View Post
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)
Ilusion9 is offline
Reply



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 04:33.


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