SA-MP Forums Archive
foreach HELP :-/ - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: foreach HELP :-/ (/showthread.php?tid=260603)



foreach HELP :-/ - [H]265 - 09.06.2011

I trying to make spam FNC with foreach loop but i get error's can someone help me


pawn Код:
Spam(playerid,times,text[])
{
      new
          Iterator:Message<times>;

      foreach(Message, i)
      {
         static
            LEN = 1;
         new
            iString[64];
         format(iString, sizeof iString, "%s",text);
         SCM(playerid, 0xFFFFFF, iString);
         printf("",LEN,text);
         LEN++;
      }
      return true;
}
ERRORS:


pawn Код:
C:\Users\----\test.pwn(85) : warning 204: symbol is assigned a value that is never used: "iString"
C:\Users\----test.pwn(85 -- 111) : error 088: public variables and local variables may not have states (symbol "Message")
C:\Users\-test.pwn(113) : error 017: undefined symbol "YSI_gMessageS"
C:\Users-test.pwn(113) : error 017: undefined symbol "YSI_gMessageA"
C:\Users\-test.pwn(113) : warning 215: expression has no effect
C:\Users\-\test.pwn(113) : error 001: expected token: ";", but found "]"
C:\Users\-\test.pwn(113) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.



Re: foreach HELP :-/ - [H]265 - 09.06.2011

You mean this?

pawn Код:
Spam(playerid,times,text[])
{
      Itter_Create(spam, times);
      foreach(spam, i)
      {
         static
            LEN = 1;
         new
            iString[64];
         format(iString, sizeof iString, "%s",text);
         SCM(playerid, iString);
         printf("",LEN,text);
         LEN++;
      }
      return true;
}
it won't work :-/

i get one strange error and warn:

pawn Код:
error 008: must be a constant expression; assumed zero
warning 204: symbol is assigned a value that is never used: "YSI_gspamC"



Re: foreach HELP :-/ - [H]265 - 09.06.2011

srry for bump, i update my post


Re: foreach HELP :-/ - [H]265 - 10.06.2011

bump