[SOLVED] Foreach loop not working
#1

I've recently gone back to coding in PAWN and now I'm stuck with a rather strange issue with foreach that has absolutely driven me mental in the past hour. Basically, everything works perfectly except for the player loops that don't work at all and thus dont create 3D Texts. It does print 'testoutb' and also creates the pickup, but doesnt print 'testb' or create the 3D texts.

Here is the code, I am talking about the loops at line 33 and 44.
-cut-

Help would be appreciated!

By the way, there are no errors whatsoever, the other loops also all work fine, it's just the player ones in this particular script that don't work. In other callbacks the player loops work just fine aswell.
Reply
#2

Foreach only operates on connected players. If this is in OnGameModeInit the loop won't run at all.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
Foreach only operates on connected players. If this is in OnGameModeInit the loop won't run at all.
Oh wow, I feel absolutely stupid right now. Much appreciated!

( Would have given you reputation but I've already did so before and it doesn't allow me to give it again. )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)