Loop - OnGameModeInit() - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Loop - OnGameModeInit() (
/showthread.php?tid=444806)
Loop - OnGameModeInit() -
Leenert - 18.06.2013
Hey everyone.
In OnGameModeInit() is use this loop to create diffrent pickups.
Код:
for(new i = 0; i < MAX_PICKUPS; i++) {
if(i < MAX_BAUTEIL_PICKUPS) { // 0 - 100
SetBauteilRandomPosInArea(i+1,362.0141, -1891.816, 2826.046, 303.6248);
}
else if(MAX_BAUTEIL_PICKUPS > i < MAX_BAUTEIL_PICKUPS + MAX_PANZERUNG_PICKUPS) { // 100 - 120
SetPanzerungRandomPosInArea(i+1,362.0141, -1891.816, 2826.046, 303.6248);
}
else if(MAX_BAUTEIL_PICKUPS + MAX_PANZERUNG_PICKUPS > i < MAX_BAUTEIL_PICKUPS + MAX_PANZERUNG_PICKUPS + MAX_REIFEN_PICKUPS) { // 120 - 155
SetReifenRandomPosInArea(i+1,362.0141, -1891.816, 2826.046, 303.6248);
}
}
My MAX_PICKUPS is 500, MAX_BAUTEIL_PICKUPS is 100, MAX_PANZERUNG_PICKUPS is 20, MAX_REIFEN_PICKUPS is 35.
My problem is, that just the first if is executed. So the "Bauteil-Pickups" are created. But after that nothing happens. Even the code after die loop is not executed.
Don't know how to fix - maybe someone knows
AW: Loop - OnGameModeInit() -
Leenert - 18.06.2013
Solved the problem - Thank you