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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: warning 217: loose indentation? (
/showthread.php?tid=269572)
warning 217: loose indentation? -
mastalol - 17.07.2011
EDIT: SOLVED Thanks [HiC]TheKiller
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/vr", true) == 1)
{
if(IsPlayerVipMember(playerid)) return SendClientMessage(playerid,red,"Only Vip's Can Repair Their Vehicles.");
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);// gettin the vehicle id
SetVehicleHealth(vehicleid,1000.0);// set the vehicle health
SendClientMessage(playerid,Green1, "Vehicle fixed.");
}
else
{
SendClientMessage(playerid,red, "You are not in a vehicle!");
}
}
}
return 1;
}
Код:
D:\Rockstar Games\Grand Theft Auto San Andreas Samp Server\gamemodes\TESTME.PWN(559) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
Help?EDIT: SOLVED Thanks [HiC]TheKiller
Re: warning 217: loose indentation? -
SmileyForCheat - 17.07.2011
Where Line 559?
Re: warning 217: loose indentation? -
[HiC]TheKiller - 17.07.2011
Move the else to be in line with the brackets.
You could alternatively put this at the top of your script
Re: warning 217: loose indentation? -
mastalol - 17.07.2011
EDIT: SOLVED Thanks [HiC]TheKiller
Quote:
Originally Posted by SmileyForCheat
Where Line 559?
|
pawn Код:
554 public OnPlayerCommandText(playerid, cmdtext[])
555 {
556 if(strcmp(cmdtext, "/vr", true) == 1)
557 {
558 if(IsPlayerVipMember(playerid)) return SendClientMessage(playerid,red,"Only Vip's Can Repair Their Vehicles.");
559 {
560 if(IsPlayerInAnyVehicle(playerid))
561 {
562 new vehicleid = GetPlayerVehicleID(playerid);// gettin the vehicle id
563 SetVehicleHealth(vehicleid,1000.0);// set the vehicle health
564 SendClientMessage(playerid,Green1, "Vehicle fixed.");
565 }
566 else
567 {
568 SendClientMessage(playerid,red, "You are not in a vehicle!");
569 }
570
571 }
572 }
573 return 1;
574 }
EDIT: SOLVED Thanks [HiC]TheKiller
Re: warning 217: loose indentation? -
[HiC]TheKiller - 17.07.2011
There is multiple indenting errors, if you want to fix that then
http://dracoblue.net/tidy/pawn/
Re: warning 217: loose indentation? -
Kush - 17.07.2011
Quote:
Originally Posted by mastalol
EDIT: SOLVED Thanks [HiC]TheKiller
pawn Код:
554 public OnPlayerCommandText(playerid, cmdtext[]) 555 { 556 if(strcmp(cmdtext, "/vr", true) == 1) 557 { 558 if(IsPlayerVipMember(playerid)) return SendClientMessage(playerid,red,"Only Vip's Can Repair Their Vehicles."); 559 { 560 if(IsPlayerInAnyVehicle(playerid)) 561 { 562 new vehicleid = GetPlayerVehicleID(playerid);// gettin the vehicle id 563 SetVehicleHealth(vehicleid,1000.0);// set the vehicle health 564 SendClientMessage(playerid,Green1, "Vehicle fixed."); 565 } 566 else 567 { 568 SendClientMessage(playerid,red, "You are not in a vehicle!"); 569 } 570 571 } 572 } 573 return 1; 574 }
EDIT: SOLVED Thanks [HiC]TheKiller
|
Remember, regardless if your using tabsize 0 to solve your 'indentation' problem, doesn't mean that you can place anything where ever. Remember to indent properly, it makes your script neat and easier to go through stuff.
Re: warning 217: loose indentation? -
mastalol - 17.07.2011
EDIT: SOLVED Thanks [HiC]TheKiller
Quote:
Originally Posted by Kush
Remember, regardless if your using tabsize 0 to solve your 'indentation' problem, doesn't mean that you can place anything where ever. Remember to indent properly, it makes your script neat and easier to go through stuff.
|
Yes I Know I Have Fixed It...
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/vr", true) == 1) {
if(IsPlayerVipMember(playerid)) return SendClientMessage(playerid,red,"Only Vip's Can Repair Their Vehicles.");
{
if(IsPlayerInAnyVehicle(playerid)) {
new vehicleid = GetPlayerVehicleID(playerid);
SetVehicleHealth(vehicleid,1000.0);
SendClientMessage(playerid,Green1, "Vehicle fixed.");
}
else {
SendClientMessage(playerid,red, "You are not in a vehicle!");
}
}
}
return 1;
}
EDIT: SOLVED Thanks [HiC]TheKiller