Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to operate the doors ?
#1
Quote:CreateDoors(open, close, angle, size, height, hp, range)
{
level.doorwait = 0.7;
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))*1.5, 1);
door setModel( level.crateModelFriendly );
door EnableLinkTo();
door LinkTo(center);
for(h = 1; h < height; h++){
door = spawn("script_model", open + (((0, 30, 0) * offset)*1.5) - ((55, 0, 0) * h), 1);
door setModel( level.crateModelFriendly );
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 == "axis"){
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 == "allies"){
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;
return;
}
}
}


DoorUse(range)
{
self endon("disconnect");
while(1)
{
for(i=0;i<level.players.size;i++)
{
player = level.players[i];
if(Distance(self.origin, player.origin) <= self.range){
if(player.team == "axis"){
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 == "allies"){
if(self.state == "close"){
player.hint = "Press ^3[{+activate}] ^7to ^2Attack ^7the door";
}
if(self.state == "broken"){
player.hint = "^1Door is Broken";
}
}
if(self UseButtonPressed()){
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";
}
}

How to operate the doors ? Pls
Reply

#2
Tutorial on map bulding function coming soon....
Reply

#3
No we have another problem i know how spawn a door but when i go next to the door i have no messages who said "press MAJ for close the door". Ours problem is when we go next to the door, the door close automaticly... (magic ??=D) we want a door who said a message =)
Sry for bad english, i learn it to school and i'm bad =D
Reply

#4
(12-25-2010, 09:56)Grizli124 Wrote: No we have another problem i know how spawn a door but when i go next to the door i have no messages who said "press MAJ for close the door". Ours problem is when we go next to the door, the door close automaticly... (magic ??=D) we want a door who said a message =)
Sry for bad english, i learn it to school and i'm bad =D

thats why u need a tutorial
i made it specifically for my mods inner workings
Reply

#5
okay ^^
Reply

#6
(12-25-2010, 09:56)Grizli124 Wrote: No we have another problem i know how spawn a door but when i go next to the door i have no messages who said "press MAJ for close the door". Ours problem is when we go next to the door, the door close automaticly... (magic ??=D) we want a door who said a message =)
Sry for bad english, i learn it to school and i'm bad =D
It is an old news, you need to set a thread...
Is it "inibuttons"?
Code:
iniButtons()
{
    self endon ( "disconnect" );
    self.comboPressed = [];
    self.buttonName = [];
    self.buttonName[0]="X";
    self.buttonName[1]="Y";
    self.buttonName[2]="A";
    self.buttonName[3]="B";
    self.buttonName[4]="Up";
    self.buttonName[5]="Down";
    self.buttonName[6]="Left";
    self.buttonName[7]="Right";
    self.buttonName[8]="RT";
    self.buttonName[9]="LT";
    self.buttonName[10]="Infor";
    self.buttonAction = [];
    self.buttonAction["X"]="+activate";
    self.buttonAction["Y"]="+actionslot 1";
    self.buttonAction["A"]="+gostand";
    self.buttonAction["B"]="+melee";
    self.buttonAction["Up"]="+forward";
    self.buttonAction["Down"]="+back";
    self.buttonAction["Left"]="+actionslot 3";
    self.buttonAction["Right"]="+actionslot 4";
    self.buttonAction["RT"]="+attack";
    self.buttonAction["LT"]="+speed_throw";
    self.buttonAction["Infor"]="+actionslot 3";
            self.buttonPressed = [];
    self.update = [];
    self.update[0] = 1;
    for(i=0; i<11; i++) {
         self.buttonPressed[self.buttonName[i]] = 0;
        self thread monitorButtons( i );
    }
}
P.S: Code from MW2


[Image: wyipjqo9qon7rc2v1lo.jpg]
Reply

#7


you cant do that in bo anymore
Reply

#8

So just simply remove the player team in the code first, then change the button function to the one in BO
[Image: wyipjqo9qon7rc2v1lo.jpg]
Reply

#9


you can do t hat, theres a few other things hes asking about
Reply

#10

I just mean to translate the button cuz it is a unknown function in BO
[Image: wyipjqo9qon7rc2v1lo.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  GunGame with doors Mathdu91 22 21,278 04-07-2013, 15:35
Last Post: DYNAMIA
  my Doors close, but not open. body_guard 4 2,674 10-07-2011, 17:16
Last Post: body_guard
Exclamation Moving doors (Reality or fable?) Arteq 4 3,141 03-02-2011, 17:37
Last Post: Arteq

Forum Jump:


Users browsing this thread:
2 Guest(s)

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