The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
if statement isn't working
Spazatron Offline
Junior Member

Posts: 33
Threads: 17
Joined: Oct 2012
Reputation: 2
#1
if statement isn't working

I have a note that when you finish reading, teleports you to a new map. This is a map that the player will have already been in before, therefore I need to tell the script that the player is revisiting the map for the second time, and to execute a certain script, otherwise it'd just execute the script from when they were in the map before. So, I have this code when the player reads the note:
void NoteRead(string &in asEntity, string &in asType)
{
    AddGlobalVarInt("SwitchBack", 1);
}
Then on the map that they're teleported to:
void OnStart()
{
    if(GetGlobalVarInt("SwitchBack") == 1)
    {
         [script for second visit]
    }    
    else
    {
         [script for first visit]
    }
}
But when the map is loaded and the player teleports, neither of the codes are executed.
10-05-2014, 06:18 PM
Find


Messages In This Thread
if statement isn't working - by Spazatron - 10-05-2014, 06:18 PM
RE: if statement isn't working - by Wapez - 10-05-2014, 06:24 PM
RE: if statement isn't working - by Spazatron - 10-05-2014, 07:18 PM



Users browsing this thread: 1 Guest(s)