24.12.2017, 08:09
Iter_Init should be called once when the mode starts (in OnGameModeInit/OnFilterScriptInit). If you use the latest version of YSI 4, a player can belong to only 1 job so you can use the optimized version of multi-iterator:
in this case, you do not need to use Iter_Init function. The only difference except the MAX_JOB + MAX_PLAYERS instead of MAX_JOBS * MAX_PLAYERS is the usage. In the old version, you would use:
which now becomes:
For more information: https://sampforum.blast.hk/showthread.php?tid=571159
pawn Код:
new Iterator:Job<MAX_JOB, MAX_PLAYERS>;
pawn Код:
foreach (new i : Job[job_id])
pawn Код:
foreach (new i : Job<job_id>)