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
Help with Global Variables
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#1
Help with Global Variables

Hey, This is the first time I've ever used Global Variables, and I'm having some troubles with Global variables. This is what I've added to both script files I want the global variable to apply on. This is not all of the script, only the parts that include the global variables.

Map 1:


Quote:void OnStart()
{
SetGlobalVarInt("Globalvar1", 0);
}

void func_on()
{
if(GetGlobalVarInt("Globalvar1") == 1)
{
SetSwingDoorLocked("elevator_door_1", false, false);
}
}
Map 2:


Quote:void OnStart()
{
SetGlobalVarInt("Globalvar1", 0);
SetEntityConnectionStateChangeCallback("valve_iron_1", "valve_func1");

}


void valve_func1(string &in asEntity, int alState)
{
AddLocalVarInt("Var1", 1);
{
AddGlobalVarInt("Globalvar1", 1);
func_on();
}
}

void func_on()
{
if(GetGlobalVarInt("Globalvar1") == 1)
{
SetSwingDoorLocked("elevator_door_1", false, false);
}
}
Again, these are not the full .hps files because I don't want to ruin anything (and there's alot of lines). There are NO fatal errors it works perfectly, but once I do what I'm required by the script, it loads the other map and the elevator door is still locked. Any information about this would be very helpful. Thanks Smile

(This post was last modified: 12-01-2011, 08:37 AM by flamez3.)
12-01-2011, 08:36 AM
Find


Messages In This Thread
Help with Global Variables - by flamez3 - 12-01-2011, 08:36 AM
RE: Help with Global Variables - by Obliviator27 - 12-01-2011, 09:05 AM
RE: Help with Global Variables - by flamez3 - 12-01-2011, 09:13 AM
RE: Help with Global Variables - by Obliviator27 - 12-01-2011, 09:16 AM
RE: Help with Global Variables - by Your Computer - 12-01-2011, 11:56 PM



Users browsing this thread: 1 Guest(s)