![]() |
|
Help Door example - Printable Version +- ItsMods (https://www.itsmods.com) +-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html) +--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html) +--- Thread: Help Door example (/Thread-Help-Door-example.html) |
Door example - Gamemaster20 - 09-29-2011 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;
}RE: Door example - Rendflex - 09-29-2011 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 Spoiler (Click to View) RE: Door example - Lemon - 09-29-2011 Download quarantine chaos zombie mod and look inside it. |