Frictional Games Forum (read-only)

Full Version: Unexpected token in IF Statement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I've got this random problem where my cs won't load. the error says line 176,1 Unexpected Token. but the token has to be there.

void rotten01();
{ <------- Error here ?
if(GetLocalVarInt("rottenkeyuse") == 2)
{
RemoveItem("rotten_key");
GiveSanityBoost();
}
}

any help please
Remove the semicolon after void rotten01()

It doesn't belong at the end of functions, so it doesn't understand the brackets.
(07-07-2012, 04:46 AM)heyitsrobert97 Wrote: [ -> ]Hi, I've got this random problem where my cs won't load. the error says line 176,1 Unexpected Token. but the token has to be there.

void rotten01();
{ <------- Error here ?
if(GetLocalVarInt("rottenkeyuse") == 2)
{
RemoveItem("rotten_key");
GiveSanityBoost();
}
}

any help please
the semicolon ( ; ) on the line above the error doesn't belong there. Semicolons are only needed after statements, not function headers.
opps lol i have a mind blank thanks Big Grin