14.07.2017, 17:17
Hello, hope you're having a great day,
so is there a better way to do this,
ofc, it doesn't not work,
Debugging
so is there a better way to do this,
PHP Code:
foreach(new i : EVM){
format(gh, sizeof(gh), "iterator: %d", i);
SendClientMessage(playerid, EVMCOLOR_RED, gh);
Iter_Remove(EVM, i);
}
Debugging
Code:
Code 1: foreach(new I : EVM) print(i); Result: Iterator: 0 Iterator: 1 Iterator: 2 Iterator: 3 Iterator: 4 Iterator: 5 Code 2: foreach(new I : EVM){ print(i); Iter_Remove(i); } Result: sometimes it shows random numbers Iterator: 26(The first iterator appears here) Iterator: 0(always shows 0) Iterator -33161(always shows this number) some other times the server just crashes