18.08.2011, 15:23
I quess in this case it's better to use OnObjectMoved callback instead of timer, kinda:
pawn Код:
// gObj - global var which stores objectid
// bool:gState - global var which stores current state of the object (false = 'left', true = 'right')
public OnObjectMoved(objectid)
{
if(objectid == gObj)
{
if(gState)
{
// Move object to the 'left' here
gState = false;
}
else
{
// Move object to the 'right' here
gState = true;
}
}
return 1;
}