09-29-2011, 04:08
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;
}