Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Is there any safer way to do this?

$
0
0
Hello, hope you're having a great day,
so is there a better way to do this,
PHP Code:

foreach(new EVM){
    
format(ghsizeof(gh), "iterator: %d"i);
    
SendClientMessage(playeridEVMCOLOR_REDgh);
    
Iter_Remove(EVMi);


ofc, it doesn't not work,
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


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>