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
#3
RE: Variables & if

(12-31-2014, 03:04 PM)DnALANGE Wrote: Here an example from 1 of my scripts;
This script will work on my doors to open\close.

OnStart
{
PHP Code: (Select All)
SetLocalVarInt("ElevatorOpen"0); 
}

PHP Code: (Select All)
void elevatordooropenFloor1(string &in asEnitiy)
{
 
 if(
GetLocalVarInt("ElevatorOpen") == 0)
 {
  
SetMoveObjectState("door_security_door_closed_3", -12);
  
SetMoveObjectState("door_security_door_closed_2"12);
  
SetLocalVarInt("ElevatorOpen"1);

 }
 
 else
 {
  
SetMoveObjectState("door_security_door_closed_3"0.7);
  
SetMoveObjectState("door_security_door_closed_2"0.7);
  
SetLocalVarInt("ElevatorOpen"0);

 }


This means ;
IF the doors are closed ADDING a variable to OPEN the doors.
ELSE the doors are closed and setting the variable BACK to 0 = CLOSED.
-
Try and play a little with my copy\past lines and i think you can figur it for the rest of your scriot.
If not, we are here to help.
Good luck!

I can't still get it to work.. I honestly have no idea why isn't it working, pretty sure it's just as the one you said..

PHP Code: (Select All)
void var1(string &in asParentstring &in asChildint alState)
{
    
SetLocalVarInt("VARIABLE"3);
}

void scare1(string &in asParentstring &in asChildint alState)
{
    if(
GetLocalVarInt("VARIABLE") != 1)
    {
         
CODE
}


Im pretty sure the problem is somewhere there. No errors or anything, the IF just seems to not give me the value I want, dunno...


http://gyazo.com/4e9fe5f111e5dfce5b956a749255c330 Theres the area.
12-31-2014, 10:07 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)