08.11.2010, 10:37
I am not the best scripter but i thought about something like this
pawn Код:
#include <a_samp>
new OldMove;
new NewMove;
new ObjectMoving;
forward isobjectmoving(Objectid);
forward OnObjectStopMoving(Objectid);
public OnFilterScriptInit()
{
OldMove = 0;
NewMove = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/moveobject", cmdtext, true) == 0)
{
// here you put something like new ObjectId;
// place something to check the ID for it;
ObjectMoving = SetTimer("isobjectmoving", 3000, 1); // this is a loop that repeats every 3 sec
return 1;
}
return 0;
}
public isobjectmoving(Objectid)
{
// here you put something to check if a object is moving something like NewMove = CheckObjectPosition(Objectid)
if(NewMove == OldMove)
{
KillTimer(ObjectMoving);
OnObjectStopMoving(Objectid);
return 1;
}
else
{
OldMove = NewMove;
}
return 1;
}
public OnObjectStopMoving(Objectid)
{
// your stuff here
return 1;
}