"warning 217: loose indentation" - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: "warning 217: loose indentation" (
/showthread.php?tid=530096)
"warning 217: loose indentation" -
IvanSb - 05.08.2014
Hello everyone, I'm newbie and I'm learning how to script and I have error that I don't understand but all works fine so can you guys help me
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_HELP)
{
if(response)
{
if(listitem == 0)
{
SendClientMessage(playerid, COL_YELLOW, "/yolo");
}
if(listitem == 1)
{
SendClientMessage(playerid, COL_WHITE, "No!");
}
if(listitem == 2)
{
if(IsPlayerAdmin (playerid))
{
SendClientMessage(playerid, COL_YELLOW, "/rconhelp");
}
else
{
SendClientMessage(playerid, COL_RED, "You are not an admin");
}
}
return 1;
}
}
return 0;
}
Error: C:\Users\Iwan\Desktop\samp\gamemodes\CT.pwn(94) : warning 217: loose indentation
94th line is this one
Thank you very much, regards!
Re: "warning 217: loose indentation" -
Stinged - 05.08.2014
What mirou123 told you to do will just HIDE the warnings. DON'T DO THAT.
It is very important to fix indentation.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_HELP)
{
if(response)
{
if(listitem == 0)
{
SendClientMessage(playerid, COL_YELLOW, "/yolo");
}
if(listitem == 1)
{
SendClientMessage(playerid, COL_WHITE, "No!");
}
if(listitem == 2)
{
if(IsPlayerAdmin (playerid))
{
SendClientMessage(playerid, COL_YELLOW, "/rconhelp");
}
else
{
SendClientMessage(playerid, COL_RED, "You are not an admin");
}
}
return 1;
}
return 0;
}
Re: "warning 217: loose indentation" -
IvanSb - 05.08.2014
I still don't know what's the problem
Re: "warning 217: loose indentation" -
Weaselpwns - 05.08.2014
Loose indentation means that several things are misplaced.
Example:
pawn Код:
public OnGameModeInit()
{
return 1;
}//This one is too far out.
public OnGameModeInit()
{
return 1;
}//While this is correct.
Get my point?
An extra space/tab will give you the warning =)
Re: "warning 217: loose indentation" -
IvanSb - 05.08.2014
Thank you very much
(+rep by me, ty)