20.03.2009, 15:57
here is an Example:
This should work, Hope you under stand this
newX/Y/Z = where to move
oldX/Y/Z = Original location to move back the opbject
pawn Код:
//Top of script
forward objTimer();
new obj, objstatus = 1;
public OnGameModeInit()
{
obj = CreateObject(objid, X, Y, Z, rX, rY, rZ);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/gate", true) == 0)
{
if(objstatus = 1)
{
MoveObject(obj, newX, newY, newZ);
objstatus = 0;
}
SetTimer("objTimer", 5000, false);//5000 = 5 seconds
return 1;
}
return 1;
}
public objTimer()
{
if(objstatus == 0)
{
MoveObject(objID, oldX, oldY, oldZ);
objstatus = 1;
}
return 1;
}
newX/Y/Z = where to move
oldX/Y/Z = Original location to move back the opbject