22.06.2012, 07:46
Here's a completely different way:
at the start of your script, add this:
and
now, under OnGameModeInit add this
Now, get the coordinates of the gate when it's opened, and now you need the command..
and now, the coordinates of the gate when it closes:
Hope I helped..
at the start of your script, add this:
pawn Код:
new object;
pawn Код:
forward close();
pawn Код:
public OnGameModeInit()
{
object = CreateObject(your gate informations);
return 1;
}
pawn Код:
if (strcmp("/openmygate", cmdtext, true, 10) == 0)
{
MoveObject(object, and then type here the new coordinates when it's opened,and now the speed you want the gate to open);
SetTimer("close", 7000, 0); // 7000 = 7seconds
return 1;
}
pawn Код:
public close()
{
MoveObject(object, new coordinates of the gate when it close, speed);
return 1;
}