moveobject with timer plz help me :|
#1

I want to make my object to move with timer from:
X1,Y1,Z1 -->X2,Y2,Y3-->X3,Y3,Z3-->X4,Y4,Z4-->X5,Y5,Z5-->X6,Y6,Z6 .
with timer .. I want to make this move , to move over and over again without stop (when player near the object - somthing like 30.000)

the object X,Y,Z :
X1Y1Z1 - http://prntscr.com/4dbnpz
X2Y2Z2 - http://prntscr.com/4dbnvs
X3Y3Z3 - http://prntscr.com/4dboii
X4Y4Z4 - http://prntscr.com/4dbolm
X5Y5Z5 - http://prntscr.com/4dbodl
X6Y6Z6 - http://prntscr.com/4dboom

I dont know how to make it..someone can help me plz ? I will +REP
tnx very much !!!!!!!!!!!!!
Reply
#2

Have you tried using settimer and killtimer for every object's coordinates? Im gueesing you want to make the spawnings random not in the same order everytime.
Reply
#3

I can give you idea because I have no time to code it for you.
So you want to check if a player is close to your object at a given distance by using snippet or what ever to check it. After that you create object at the initial spot and if player is close give it some movement ( https://sampwiki.blast.hk/wiki/MoveObject ) after object is moved to X2Y2Z2 it will call his mother (https://sampwiki.blast.hk/wiki/OnObjectMoved) and tell her that he's done. Inside OnObjectMoved you want to create a check if it's the object you're moving and if it is make switch function which will go through states of object movement which you can control by creating a simple variable named "state" or what ever. And that's pretty much it once it get sto the last case 5: you put state variable back to 0. That's what came onto my mind when I saw this, there might be a bit easier way?
Reply
#4

Check out the pirateship.pwn that comes with the SA: MP server on how to do this. Use OnObjectMoved to set next point, or stop the object/kill the timer or reset. Good luck!
Reply
#5

Quote:
Originally Posted by Lofti
Посмотреть сообщение
Have you tried using settimer and killtimer for every object's coordinates? Im gueesing you want to make the spawnings random not in the same order everytime.
Quote:
Originally Posted by MicroD
Посмотреть сообщение
I can give you idea because I have no time to code it for you.
So you want to check if a player is close to your object at a given distance by using snippet or what ever to check it. After that you create object at the initial spot and if player is close give it some movement ( https://sampwiki.blast.hk/wiki/MoveObject ) after object is moved to X2Y2Z2 it will call his mother (https://sampwiki.blast.hk/wiki/OnObjectMoved) and tell her that he's done. Inside OnObjectMoved you want to create a check if it's the object you're moving and if it is make switch function which will go through states of object movement which you can control by creating a simple variable named "state" or what ever. And that's pretty much it once it get sto the last case 5: you put state variable back to 0. That's what came onto my mind when I saw this, there might be a bit easier way?
Quote:
Originally Posted by Virtual1ty
Посмотреть сообщение
Check out the pirateship.pwn that comes with the SA: MP server on how to do this. Use OnObjectMoved to set next point, or stop the object/kill the timer or reset. Good luck!

I am beginner in Pawn and I dont know how to write it .. please someone may code it for me ? its very simple to you
plz plz !!!
tnx !
Reply
#6

someone ? plz ? I wil rep you
Reply
#7

plz someone ! just example for me
Reply
#8

plz someone ! just example for me
Reply
#9

someone ?
Reply
#10

it easey for you .. why nobody can give me an example ? i just want to learn
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)