Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Door example
#1
can someone show me an example on how to use this

Code:
CreateDoors(open, close, xangle, yangle, zangle, size, height, hp, range)
{
        offset = (((size / 2) - 0.5) * -1);
        center = spawn("script_model", open, 1);
        center SetOwner( level );
        for(j = 0; j < size; j++){
                door = spawn("script_model", open + ((35, 0, 0) * offset), 1);
                door setModel(level.crateModelEnemy);
                door SetOwner( level );
                door LinkTo(center);
                for(h = 1; h < height; h++){
                        door = spawn("script_model", open + ((35, 0, 0) * offset) - ((0, 95, 0) * h), 1);
                        door setModel(level.crateModelEnemy);
                        door SetOwner( level );
                        door LinkTo(center);
                }
                offset += 1;
        }
        if(!isDefined(yangle)){
                Temp = VectorToAngles(open - close);
                yangle = Temp[1]-90;
        }
        center.angles = (xangle, yangle, 0-zangle);
        center.state = "open";
        center.maxhp = hp;
        center.hp = hp;
        center.range = range;
        center thread DoorThinkUse(open, close);
        //center thread DoorThinkRepair();
        center thread DoorUse();
        center thread ResetDoors(open, hp);
        wait 0.01;
}
Reply

#2
Just imagine it beign a simple thread, but you just don't need to define "who" is using it, so a example of this would be,

Code:
Main()
{
CreateDoors((1337, 1337, 1337), (1313, 4124, 12.3), (0, 0, 0), (0, 0, 0), (0, 0, 0), 5, 20, 99, 190)
}

The thread has to be in the same gsc.
Also I would recommend that you thread it from where the "level" is active, not the player.
So it could be where the "level thread X" is located in the famous
_rank.gsc, in the Init() thread.
Reply

#3
Download quarantine chaos zombie mod and look inside it.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] [SOURCE] DOOR V2.0 [HARD] Tony. 5 5,332 09-26-2013, 14:01
Last Post: Nekochan
Video [Release] DOOR v1.0 [HARD] Tony. 15 8,154 09-19-2013, 17:44
Last Post: Nekochan
  DOOR HUD E-losev 2 3,172 07-17-2013, 17:50
Last Post: E-losev
  Help door code problem Gamemaster20 3 2,940 10-30-2011, 21:02
Last Post: iAegle

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.