foreach HELP :-/
#1

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.
Reply
#2

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"
Reply
#3

srry for bump, i update my post
Reply
#4

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)