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
[SOLVED]Variables & if
Omenapuu Offline
Junior Member

Posts: 31
Threads: 8
Joined: Oct 2013
Reputation: 1
#1
[SOLVED]Variables & if

So I got another problem with scripting. This time I can't get an if statement to work with variables, don't know what's wrong. I looked it over a couple times & still can't figure why isn't it working.

Spoiler below!

AddLocalVarInt("var1", 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "var1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "scare1", true, 1);


void var1(string &in asParent, string &in asChild, int alState)
{
SetLocalVarInt("var1", 2);
}
void scare1(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("var1") == 2)
{//INSERT CODE HERE


That isn't straight from the code but I picked up the pieces that aren't functioning.. So what's exactly wrong there? I can't spot it. Probably because I'm not really sure how to use IF statements. Also I made an Else statement after it so it worked fine.. What's wrong with those variables?
(This post was last modified: 01-01-2015, 06:12 PM by Omenapuu.)
12-31-2014, 02:38 PM
Find


Messages In This Thread
[SOLVED]Variables & if - by Omenapuu - 12-31-2014, 02:38 PM
RE: Variables & if - by DnALANGE - 12-31-2014, 03:04 PM
RE: Variables & if - by Omenapuu - 12-31-2014, 10:07 PM
RE: Variables & if - by Daemian - 01-01-2015, 05:23 AM
RE: Variables & if - by Mudbill - 01-01-2015, 06:05 AM
RE: Variables & if - by Omenapuu - 01-01-2015, 12:21 PM
RE: Variables & if - by Daemian - 01-01-2015, 02:44 PM
RE: Variables & if - by Omenapuu - 01-01-2015, 04:50 PM
RE: Variables & if - by Omenapuu - 01-01-2015, 06:11 PM
RE: [SOLVED]Variables & if - by Mudbill - 01-01-2015, 07:54 PM



Users browsing this thread: 2 Guest(s)