Something weird I found
#1

Hi guys, when I was making this small piece of code, I thought I was programming in Lua so I put this down:

pawn Код:
COMMAND:admins(playerid, params[])
{
    new AdminCount = 0;
    foreach(Player, i) if pData[i][AdminLevel] >= 1 then AdminCount++;
}
As you see I put in the statement 'then', now that came up with a funny error.

Код:
C:\Documents and Settings\Elliot\My Documents\Game Stuff\San Andreas Flight Club\Server\gamemodes\flight.pwn(426) : error 001: expected token: "*then", but found "-identifier-"
C:\Documents and Settings\Elliot\My Documents\Game Stuff\San Andreas Flight Club\Server\gamemodes\flight.pwn(426) : error 017: undefined symbol "then"
As you can see the expected token is '*then', and so I put that into my command.

pawn Код:
COMMAND:admins(playerid, params[])
{
    new AdminCount = 0;
    foreach(Player, i) if pData[i][AdminLevel] >= 1 *then AdminCount++;
}
And it came up with no errors. And the code works.

Now, am I a total noob for not ever knowing about this? Or does no one ever use it? Because I haven't seen this being used in many scripts. And were any of you aware of this?
Reply


Messages In This Thread
Something weird I found - by Burthop - 05.05.2012, 08:56
Re: Something weird I found - by mincer1667 - 05.05.2012, 09:04
Re: Something weird I found - by Burthop - 05.05.2012, 09:10
Re: Something weird I found - by Disturn - 05.05.2012, 12:57
Re: Something weird I found - by Burthop - 05.05.2012, 15:54
Re: Something weird I found - by KingHual - 05.05.2012, 15:58

Forum Jump:


Users browsing this thread: 1 Guest(s)