Keep Doing it
#1

hi guys
i was asking anyone knows how to make something moving forever?
like

i want an object to move right then when it reaches to the place it moves to left again then right .... and doing this forever!
if you got what i mean? :S

Thx..
Reply
#2

https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/GetObjectPos
Create a timer which moves the object, and check when the object pos is at the first destination, then move him to the next position, etc etc
Reply
#3

i think i did that
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)