07.01.2018, 00:46
Hello, I'am trying to make fallout minigame by myself but i have some problems.
So, i have timer to MoveObject (fallout platforms) down by 5 units every x seconds.
I HAVE:
public OnGameModeInit()
Timer for moving random(100) object down by 5 units every 5 seconds
The timer functions
PROBLEM 1:
I have no idea how to call that random(100) only once per generated number.
So if random(100) is for example 66, DO NOT CALL 66 AGAIN! (how?)
And if it's generate something 99x, stop generating so last object stay on its position !
Any idea?
PROBLEM 2:
How to get these objects back to their positions like in OnGameModeInIt after i stop my timer?
So, i have timer to MoveObject (fallout platforms) down by 5 units every x seconds.
I HAVE:
Код:
new fFallObject[100];
Код:
fFallObject[1] = CreateObject(...); //... 1 - 100 fFallObject[100] = CreateObject(...);
Код:
SetTimer("FalloutFall", 5000, true);
Код:
forward FalloutFall(); public FalloutFall() { for(new i = 0; i < MAX_PLAYERS; i++) { if(FalloutJoined[i] == true) { //some code } } new Fall = random(100); new Float:oX, Float:oY, Float:oZ; GetObjectPos(fFallObject[Fall], oX, oY, oZ); MoveObject(fFallObject[Fall],oX,oY,oZ-5,5); }
I have no idea how to call that random(100) only once per generated number.
So if random(100) is for example 66, DO NOT CALL 66 AGAIN! (how?)
And if it's generate something 99x, stop generating so last object stay on its position !
Any idea?
PROBLEM 2:
How to get these objects back to their positions like in OnGameModeInIt after i stop my timer?
Код:
forward FalloutRespawn(); public FalloutRespawn() { //??? :'( xD }