04.07.2012, 09:59
I generally don't do nested ifs. Especially not 10 levels deep. Instead of doing this:
I do this:
pawn Код:
if(foo())
{
if(bar())
{
// possibly 100 lines of code
}
else return SendClientMessage(playerid, -1, "Not Bar");
}
else return SendClientMessage(playerid, -1, "Not Foo");
pawn Код:
if(!foo())
return SendClientMessage(playerid, -1, "Not Foo");
if(!bar())
return SendClientMessage(playerid, -1, "Not Bar");
// possibly 100 lines of code

