SA-MP Forums Archive
Loose indentation problem ... - 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: Loose indentation problem ... (/showthread.php?tid=536055)



Loose indentation problem ... - bietdoidao - 07.09.2014

I've tried any way that i'm possible to know but still get this error , can anyone help me ?
Код:
D:\SAMP Server\filterscripts\testingFS.pwn(47) : warning 217: loose indentation
D:\SAMP Server\filterscripts\testingFS.pwn(51) : warning 217: loose indentation
D:\SAMP Server\filterscripts\testingFS.pwn(55) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
The Error script using ZCMD:
pawn Код:
CMD:cableon(playerid,params[])
{
new Float:x1, Float:y2, Float:z3;
GetObjectPos(cabin_01, x1, y2, z3);
     if ((x1 == 827.7750 && y2 == -2063.8896) && z3 == 20.6669)
{
    MoveObject(cabin_01, 829.9734, -2332.8184, 19.2912, 5.11, 0.0, 0.0, 270.0);
}
else if ((x1 == 829.9734 && y2 == -2332.8184) && z3 == 19.2912)
{
    MoveObject(cabin_01, 827.7750, -2063.88964, 20.6669, 5.11, 0.0, 0.0, 90.0);
}
return 1;
}



Re: Loose indentation problem ... - bietdoidao - 07.09.2014

Here:
pawn Код:
// define this symbol as object to move
new cabin_01;

//[...]
 // Error Part
CMD:cableon(playerid,params[])
{
new Float:x1, Float:y2, Float:z3;
GetObjectPos(cabin_01, x1, y2, z3);
     if ((x1 == 827.7750 && y2 == -2063.8896) && z3 == 20.6669)
{
    MoveObject(cabin_01, 829.9734, -2332.8184, 19.2912, 5.11, 0.0, 0.0, 270.0);
}
else if ((x1 == 829.9734 && y2 == -2332.8184) && z3 == 19.2912)
{
    MoveObject(cabin_01, 827.7750, -2063.88964, 20.6669, 5.11, 0.0, 0.0, 90.0);
}
return 1;
}

// OnGameModeInit
cabin_01 = CreateObject(18879, 827.59424, -2063.88013, 22.08874,   0.00000, 0.00000, 0.00000);



Re: Loose indentation problem ... - BroZeus - 07.09.2014

He meant Indenting the code will solve the problem
this problem is caused due to bad indentation


Re: Loose indentation problem ... - bietdoidao - 07.09.2014

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
He meant Indenting the code will solve the problem
this problem is caused due to bad indentation
Can you help me to fix the code ? i'm still noob at PAWN scripting .


Re: Loose indentation problem ... - BroZeus - 07.09.2014

****** already told the solution ._.


Re: Loose indentation problem ... - Flake. - 07.09.2014

Quote:
Originally Posted by bietdoidao
Посмотреть сообщение
Can you help me to fix the code ? i'm still noob at PAWN scripting .
http://en.wikipedia.org/wiki/Indent_style

pawn Код:
CMD:cableon(playerid,params[])
{
    new Float:x1, Float:y2, Float:z3;
    GetObjectPos(cabin_01, x1, y2, z3);
    if ((x1 == 827.7750 && y2 == -2063.8896) && z3 == 20.6669)
    {
        MoveObject(cabin_01, 829.9734, -2332.8184, 19.2912, 5.11, 0.0, 0.0, 270.0);
    }
    else if ((x1 == 829.9734 && y2 == -2332.8184) && z3 == 19.2912)
    {
        MoveObject(cabin_01, 827.7750, -2063.88964, 20.6669, 5.11, 0.0, 0.0, 90.0);
    }
    return 1;
}



Re: Loose indentation problem ... - bietdoidao - 07.09.2014

Thanks Flake , i got it now.