SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

Thread Tools Display Modes
Old 11/08/2011, 08:41 AM   #1
iPLEOMAX's Avatar
Join Date: Mar 2011
Location: AE
Posts: 1,251
Reputation: 744
Default foreach

What am I doing wrong here?

pawn Code:
new Iterator:MaxSavedSlots<MAX_PLAYERS>; //Global

foreach(MaxSavedSlots, slot) //OnPlayerConnect

I get this:
pawn Code:
warning 203: symbol is never used: "YSI_gCMaxSavedSlots"
Goodbye SA-MP.
iPLEOMAX is offline  
Old 11/08/2011, 09:04 AM   #2
Darnell's Avatar
Join Date: Jul 2010
Posts: 824
Reputation: 35
Default Re: foreach

pawn Code:
new Iterator:YSI_gCMaxSavedSlots<MAX_PLAYERS>; //Global

foreach(YSI_gCMaxSavedSlots, slot) //OnPlayerConnect
I hope it helped ...
Darnell is offline  
Old 11/08/2011, 09:06 AM   #3
Grim_'s Avatar
Join Date: Sep 2008
Location: United States
Posts: 2,862
Reputation: 118
Default Re: foreach

Do you ever add or remove data from or to the iterator variable? If not, try to do so by using one of the following functions:

Iter_Add( MaxSavedSlots, value );
Iter_Remove( MaxSavedSlots, value );
Grim_ is offline  

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
foreach HELP :-/ [H]265 Help Archive 3 10/06/2011 11:26 AM
Help with foreach ajwar Help Archive 2 12/02/2011 09:37 AM
Help with foreach NewbBeginner Help Archive 10 08/12/2010 06:56 PM
Foreach bug? armyoftwo Help Archive 3 30/10/2010 10:27 AM
for() vs foreach() The Scripter Help Archive 15 21/08/2010 01:43 AM

All times are GMT. The time now is 09:50 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.