• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
my Doors close, but not open.
#1
Hi, i have a probelem with my Doors! I can close, but no open Sad Important my Mod, is no with Zombi!

Code:
CreateDoors(open, close, angle, size, height, hp, range)
{
        offset = (((size / 2) - 0.5) * -1);
        center = spawn("script_model", open );
        for(j = 0; j < size; j++){
                door = spawn("script_model", open + ((0, 30, 0) * offset));
                door setModel("com_plasticcase_enemy");
                door Solid();
                door CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
                door EnableLinkTo();
                door LinkTo(center);
                for(h = 1; h < height; h++){
                        door = spawn("script_model", open + ((0, 30, 0) * offset) - ((70, 0, 0) * h));
                        door setModel("com_plasticcase_enemy");
                        door Solid();
                        door CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
                        door EnableLinkTo();
                        door LinkTo(center);
                }
                offset += 1;
        }
        center.angles = angle;
        center.state = "open";
        center.hp = hp;
        center.range = range;
        center thread DoorThink(open, close);
        center thread DoorUse();
        center thread ResetDoors(open, hp);
        wait 0.01;
}

DoorThink(open, close)
{
        while(1)
        {
                if(self.hp > 0){
                        self waittill ( "triggeruse" , player );
                        if(player.team == "allies"){
                                if(self.state == "open"){
                                        self MoveTo(close, level.doorwait);
                                        wait level.doorwait;
                                        self.state = "close";
                                        continue;
                                }
                                if(self.state == "close"){
                                        self MoveTo(open, level.doorwait);
                                        wait level.doorwait;
                                        self.state = "open";
                                        continue;
                                }
                        }
                        if(player.team == "axis"){
                                if(self.state == "close"){
                                        self.hp--;
                                        player iPrintlnBold("HIT");
                                        wait 1;
                                        continue;
                                }
                        }
                } else {
                        if(self.state == "close"){
                                self MoveTo(open, level.doorwait);
                        }
                        self.state = "broken";
                        wait .5;
                }
        }
}

DoorUse(range)
{
        self endon("disconnect");
        while(1)
        {
                foreach(player in level.players)
                {
                        if(Distance(self.origin, player.origin) <= self.range){
                                if(player.team == "allies"){
                                        if(self.state == "open"){
                                                player.hint = "Press ^3[{+activate}] ^7to ^2Close ^7the door";
                                        }
                                        if(self.state == "close"){
                                                player.hint = "Press ^3[{+activate}] ^7to ^2Open ^7the door";
                                        }
                                        if(self.state == "broken"){
                                                player.hint = "^1Door is Broken";
                                        }
                                }
                                if(player.team == "axis"){
                                        if(self.state == "close"){
                                                player.hint = "Press ^3[{+activate}] ^7to ^2Attack ^7the door";
                                        }
                                        if(self.state == "broken"){
                                                player.hint = "^1Door is Broken";
                                        }
                                }
                                if(player.buttonPressed[ "+activate" ] == 1){
                                        player.buttonPressed[ "+activate" ] = 0;
                                        self notify( "triggeruse" , player);
                                }
                        }
                }
                wait .045;
        }
}

ResetDoors(open, hp)
{
        while(1)
        {
                level waittill("RESETDOORS");
                self.hp = hp;
                self MoveTo(open, level.doorwait);
                self.state = "open";
        }
}

Code:
CreateDoors((565, 1540, 295), (653, 1540, 295), (90, 90, 0), 3, 2, 15, 60);
  Reply
#2
The reason are those things, you need that function, the one that makes the .buttonpressed thing

Code:
if(player.buttonPressed[ "+activate" ] == 1){
                                        player.buttonPressed[ "+activate" ] = 0;
  Reply
#3
Okay, my Doors working! THX for your Tipp! Next Problem.... no Text

Code:
"Close the door"
"Open the door"



  Reply
#4
(10-07-2011, 16:31)body_guard Wrote: Okay, my Doors working! THX for your Tipp! Next Problem.... no Text

Code:
"Close the door"
"Open the door"


Awesome music in the background :p
Did you use the sound thingy I added for testing in the chaotic invasion 2 mod, or was it just the sound of your music you were listening to when fraps recorded while you played? :p
  Reply
#5
Recorded with Fraps, and music added

My Doors working! [open close + Text + all Teams] I found this fuc.... Zombi Bugs ^^



THX to Yamato - nice Tipp!

/please close
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help How do I open the admin menu for GeKKos QS Mod? conorr 1 2,845 08-15-2013, 13:52
Last Post: Yamato
Music [Release] [C#] [LIBRARY] SABSFile library (open sound files) JariZ 31 18,438 07-07-2013, 17:20
Last Post: Red-EyeX32
Question Help what program, open and edit plugins ??? lexa__33 1 2,641 06-24-2013, 09:36
Last Post: EnVi Sweden Rocks
  [News] Free Battlefield 3 Close Quarters DLC! iPaddie 2 3,816 06-11-2013, 21:08
Last Post: RaZ
  GunGame with doors Mathdu91 22 20,012 04-07-2013, 15:35
Last Post: DYNAMIA
  Help MW2 Liberation - Application won't open. uanaka 4 5,577 07-10-2012, 15:07
Last Post: DidUknowiPwn
Exclamation [News] [RAGE] Can't open forum for 4 weeks Nekochan 5 3,588 05-06-2012, 18:17
Last Post: 4FunPlayin
  Diablo III Open Beta Weekend Lemon 1 1,752 04-20-2012, 17:28
Last Post: frozenliquid
  So close Pozzuh 2 1,530 11-09-2011, 20:17
Last Post: 4FunPlayin
Wink [Tutorial] Partial fix:Couldn't open techniqueSet 'pimp/techsets/mc_l_sm_r0c0x0_clrdtl.techset' hitmax 11 5,943 09-03-2011, 14:21
Last Post: Nekochan

Forum Jump:


Users browsing this thread: 1 Guest(s)