open.mp forum
[Pawn] Need suggestion / help - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Need suggestion / help (/showthread.php?tid=1080)



Need suggestion / help - Pinch - 2020-05-10

Hello Burgershot!

This is what I'm trying to create:

Let's say that I have a map with 800 objects and that map is constructed fine. Now, I want to change position of every object of that map to random(90) and after doing that I want to revert the map to her origin state via Move Dyn Object (default coordinates)

Any idea how could I do this without using many arrays as I'll have 5000 objects that'll repeat this Per-player (I'm (re)creating someone's tutorial system, this is the exact thing I want:?https://youtu.be/7RMptvUBqQw (Corelli from sa-mp forums is the creator))


RE: Need suggestion / help - EvilShadeZ - 2020-05-10

create a variable that generates the random offset. Spawn the object with the random offset and instantly move the object to its own location but subtract the offset then. Also if they are in a grid, just like that video, you can easily offset it by the grid amounts themselves.
Also in the streamer you can use E_STREAMER_EXTRA_ID together with Streamer_Get<type>Data to assign data to the objects themselves to know what they're supposed to without having an array.