question
#3

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;
}
Reply


Messages In This Thread
question - by iJumbo - 08.11.2010, 10:03
Re: question - by iggy1 - 08.11.2010, 10:15
Re: question - by HireMe - 08.11.2010, 10:37
Re: question - by Bessensap - 08.11.2010, 10:39
Re: question - by iggy1 - 08.11.2010, 11:20
Re: question - by iJumbo - 08.11.2010, 11:24

Forum Jump:


Users browsing this thread: 1 Guest(s)