[HELP] GlobalAnnouncement
#1

Errors:
Quote:

C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4100) : error 029: invalid expression, assumed zero
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4100) : warning 215: expression has no effect
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4100) : error 001: expected token: ";", but found ")"
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4100) : error 029: invalid expression, assumed zero
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4100) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Line 4096 - 4115
pawn Код:
public GlobalAnnouncement()
{
    switch (Msg)
    {
      case 0: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[0]); Msg++;} // first message
      case 1: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[1]); Msg++;}
      case 2: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[2]); Msg++;}
      case 3: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[3]); Msg++;}
      case 4: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[4]); Msg++;}
      case 5: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[5]); Msg++;}
      case 6: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[6]); Msg++;}
      case 7: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[7]); Msg++;}
      case 8: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[8]); Msg++;}
      case 9: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[9]); Msg++;}
      case 10: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[10]); Msg++;}
      case 11: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[11]); Msg++;}
      case 12: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[12]); Msg = 0;} // last message
    }
    return 1;
}

Other lines:

pawn Код:
forward GlobalAnnouncement();

new Msg;
new Announcements[13][128] = {
"[NEWS] My message"
"[NEWS] My message"
"[NEWS] My message"
"[NEWS] My message"
"[NEWS] My message"
"[NEWS] My message"
"[NEWS] My message"
"[NEWS] My message"
"[NEWS] My message"
"[NEWS] My message"
"[NEWS] My message"
"[NEWS] My message"
"[NEWS] My message"
};
Reply
#2

Код:
forward gAnnounce();  
public gAnnounce()
{
  new rnd = random(3);
  switch(rnd)
  {
    case 0:
    {
      SendClientMessageToAll
    }
    case 1:
    {
      SendClientMessageToAll
    }
    case 2:
    {
      SendClientMessageToAll
    }
  }
}
and at the top of your script (Ongamemodeinit) add a timer
Код:
SetTimer("gAnnounce",55000,1);
Reply
#3

Quote:

C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(13) : error 010: invalid function or declaration
C:\Users\Hampus\Desktop\Freeroam 3.8\pawno\include\a_samp.inc(63) : error 025: function heading differs from prototype
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(736) : error 017: undefined symbol "random3"
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(736) : error 029: invalid expression, assumed zero
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(736) : warning 215: expression has no effect
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(741 -- 742) : error 076: syntax error in the expression, or invalid function call
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(745 -- 746) : error 076: syntax error in the expression, or invalid function call
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(749 -- 750) : error 076: syntax error in the expression, or invalid function call
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3079) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3079) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3079) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3080) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3080) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3080) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3081) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3081) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3081) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3082) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3082) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3082) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3083) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3083) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3083) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3095) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3095) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3095) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3759) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3759) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(3759) : warning 202: number of arguments does not match definition
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4123) : error 029: invalid expression, assumed zero
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4123) : warning 215: expression has no effect
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4123) : error 001: expected token: ";", but found ")"
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4123) : error 029: invalid expression, assumed zero
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4123) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


11 Errors.

Reply
#4

at the first look i noticed you were missing some commas:
Код:
"[NEWS] My message0",
"[NEWS] My message1",
//...
"[NEWS] My message11",
"[NEWS] My message12" //<- no comma at the end
dont forget that the last message dont need a comma attached at the end, its "closing" the array...
Reply
#5

pawn Код:
forward GlobalAnnouncement();

new Msg;
new Announcements[][] =
{
  "[NEWS] My message",
  "[NEWS] My message",
  "[NEWS] My message",
  "[NEWS] My message",
  "[NEWS] My message",
  "[NEWS] My message",
  "[NEWS] My message",
  "[NEWS] My message",
  "[NEWS] My message",
  "[NEWS] My message",
  "[NEWS] My message",
  "[NEWS] My message",
  "[NEWS] My message"
};
pawn Код:
public GlobalAnnouncement()
{
    switch (Msg)
    {
      case 0: SendClientMessageToAll(ANNOUNCEMENT, Announcements[0]), Msg++; // first message
      case 1: SendClientMessageToAll(ANNOUNCEMENT, Announcements[1]), Msg++;
      case 2: SendClientMessageToAll(ANNOUNCEMENT, Announcements[2]), Msg++;
      case 3: SendClientMessageToAll(ANNOUNCEMENT, Announcements[3]), Msg++;
      case 4: SendClientMessageToAll(ANNOUNCEMENT, Announcements[4]), Msg++;
      case 5: SendClientMessageToAll(ANNOUNCEMENT, Announcements[5]), Msg++;
      case 6: SendClientMessageToAll(ANNOUNCEMENT, Announcements[6]), Msg++;
      case 7: SendClientMessageToAll(ANNOUNCEMENT, Announcements[7]), Msg++;
      case 8: SendClientMessageToAll(ANNOUNCEMENT, Announcements[8]), Msg++;
      case 9: SendClientMessageToAll(ANNOUNCEMENT, Announcements[9]), Msg++;
      case 10: SendClientMessageToAll(ANNOUNCEMENT, Announcements[10]), Msg++;
      case 11: SendClientMessageToAll(ANNOUNCEMENT, Announcements[11]), Msg++;
      case 12: SendClientMessageToAll(ANNOUNCEMENT, Announcements[12]), Msg = 0; // last message
    }
    return 1;
}
Reply
#6

Quote:

C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4104) : error 029: invalid expression, assumed zero
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4104) : error 029: invalid expression, assumed zero
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4104) : warning 215: expression has no effect
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4104) : error 001: expected token: ";", but found "]"
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4104) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

pawn Код:
case 0: SendClientMessageToAll(ANNOUNCEMENT, Announcements[0]), Msg++; // first message
Reply
#7

Try:
pawn Код:
public GlobalAnnouncement()
{
    if(Msg > sizeof(Announcements)) Msg = 0;
    SendClientMessageToAll(ANNOUNCEMENT, Announcements[Msg]);
    Msg ++;
    return 1;
}
Reply
#8

same error
Quote:

C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4102) : error 029: invalid expression, assumed zero
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4102) : warning 215: expression has no effect
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4102) : error 001: expected token: ";", but found ")"
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4102) : error 029: invalid expression, assumed zero
C:\Users\Hampus\Desktop\Freeroam 3.8\gamemodes\freeroam.pwn(4102) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Reply
#9

pawn Код:
new Announcements[][] = {
Make it empty and if the same errors come please tell me what is 4102 Line? And You added Timer??
Reply
#10

Quote:
Originally Posted by [GTA
Deadly_Evil ]
pawn Код:
new Announcements[][] = {
Make it empty and if the same errors come please tell me what is 4102 Line? And You added Timer??
SendClientMessageToAll(ANNOUNCEMENT, Announcements[Msg]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)