Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unexpected end of file help
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#9
RE: Unexpected end of file help

'asTimer' is the name of the timer you set using AddTimer. Unfortunately, that means you were right to have it as "1" before, since it is a string and not an integer (sorry ingedoom...)
In the future you may want to name your timer's something more specific

The problem is that your series of 'if..else' statements are outside of a function - they can't be used like that, they must be within a function

Here
void Flashingkeh(string &in asTimer)

{

ChangeMap("Mohammadsmap.map", "flashingreturn", "", "");

StartPlayerLookAt("LookatReturn", 1, 2.0f, "");

}

if(asTimer == "1")

{

SetPlayerActive(true);

    }

    else if(asTimer == "2")

{

SetPlayerActive(false);

    }

    else if(asTimer == "3")

{

ChangeMap("Mohammadsmap.map", "flashingreturn", "", "");

StartPlayerLookAt("LookatReturn", 1, 2.0f, "");



}

Did you intend the if...else statements to be part of 'void Flashingkeh(string &in asTimer)' ?

Also,
AddTimer("1", 5, "flashingreturn");
AddTimer("2", 2, "Playerdisablemove");
AddTimer("3", 15, "Flashingkeh");

Are those the timers that are being checked by the if...else statements? Because all of those timers call different functions, which removes the need to use if...else statements to check which timer is the current one


Perhaps you will find this article helpful instead.
http://wiki.frictionalgames.com/hpl2/tut...ncedtimers

(This post was last modified: 03-15-2013, 11:16 PM by Adrianis.)
03-15-2013, 11:08 PM
Find


Messages In This Thread
Unexpected end of file help - by killerblade - 03-15-2013, 10:26 AM
RE: Unexpected end of file help - by Adrianis - 03-15-2013, 10:36 AM
RE: Unexpected end of file help - by killerblade - 03-15-2013, 11:31 AM
RE: Unexpected end of file help - by Adrianis - 03-15-2013, 12:25 PM
RE: Unexpected end of file help - by ingedoom - 03-15-2013, 01:54 PM
RE: Unexpected end of file help - by killerblade - 03-15-2013, 08:57 PM
RE: Unexpected end of file help - by ingedoom - 03-15-2013, 09:30 PM
RE: Unexpected end of file help - by killerblade - 03-15-2013, 10:49 PM
RE: Unexpected end of file help - by ingedoom - 03-15-2013, 11:16 PM
RE: Unexpected end of file help - by Adrianis - 03-15-2013, 11:08 PM
RE: Unexpected end of file help - by Adrianis - 03-15-2013, 11:23 PM



Users browsing this thread: 1 Guest(s)