Error: 032 & 052
#1

Hey there, new project i'm making (see in my sig)

I'm using Seif_'s Announcement thing, but i added a few more lines...but there are some problems,

error 032: array index out of bounds (variable "Announcements")

- That is the first error when i do this

pawn Код:
new Announcements[8][128] = { // Announcements[number of announcement messages][string lengh]
"Announcement: Visit Our Forums! Go to http://rayze-universe.tk",
"Announcement: Want to Stay with us? Add » 99.58.71.127:7777 « To your Favourites!",
"Announcement: Want to be a V.I.P Member? Pay only $10 and become V.I.P for life! (/vip)",
"Announcement: Want to know who is the developer of Party For Life! [P.F.R]? use /credits",
"Announcement: New to this server? Use /help or /commands. Also Please Register on our forums (/website)",
"Announcement: Want to be a Admin? Applicate on our forums, but Please Read our rules before doing so.",
"Announcement: Feel Free to invite your friends to Party For Life! We will have great thanks to you",
"Announcement: Do you have Ideas for this server? Go to our Ideas - Bugs - Complaints section and post!"
};
and the other part

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 = 0;} // last message
    }
    return 1;
}
Thats the First Error

But when i change
pawn Код:
new Announcements[8][128] = { // Announcements[number of announcement messages][string lengh]
to

pawn Код:
new Announcements[10][128] = { // Announcements[number of announcement messages][string lengh]
It gives me this error:

error 052: multi-dimensional arrays must be fully initialized

And thats all i changed...Please Help.



Reply
#2

Quote:
Originally Posted by Seif_
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 = 0;} // last message
    }
    return 1;
}
Oh..Uhm mind i ask what was actualy wrong?

EDIT:

Still have the same error.
Reply
#3

Quote:

"Announcement: Visit Our Forums! Go to http://rayze-universe.lol",

Lmao, why you doing that?! :P
Reply
#4

Quote:
Originally Posted by _❼_
Quote:

"Announcement: Visit Our Forums! Go to http://rayze-universe.lol",

Lmao, why you doing that?! :P
Because I can?
Reply
#5

Quote:
Originally Posted by Tɧ϶ Tσηί™
Quote:
Originally Posted by _❼_
Quote:

"Announcement: Visit Our Forums! Go to http://rayze-universe.lol",

Lmao, why you doing that?! :P
Because I can?
Lol .. I mean, you don't actually do that in your script do you? That's probably what's causing the error lol.
Reply
#6

Quote:
Originally Posted by _❼_
Quote:
Originally Posted by Tɧ϶ Tσηί™
Quote:
Originally Posted by _❼_
Quote:

"Announcement: Visit Our Forums! Go to http://rayze-universe.lol",

Lmao, why you doing that?! :P
Because I can?
Lol .. I mean, you don't actually do that in your script do you? That's probably what's causing the error lol.
What? How would that cause a problem? its in quotations...so not the problem.
Reply
#7

Look..

pawn Код:
new Announcements[8][128] = { // Announcements[number of announcement messages][string lengh]
"Announcement: Visit Our Forums! Go to http://rayze-universe.lol",
"Announcement: Want to Stay with us? Add » 99.58.71.127:7777 « To your Favourites!",
"Announcement: Want to be a V.I.P Member? Pay only $10 and become V.I.P for life! (/vip)",
"Announcement: Want to know who is the developer of Party For Life! [P.F.R]? use /credits",
"Announcement: New to this server? Use /help or /commands. Also Please Register on our forums (/website)",
"Announcement: Want to be a Admin? Applicate on our forums, but Please Read our rules before doing so.",
"Announcement: Feel Free to invite your friends to Party For Life! We will have great thanks to you",
"Announcement: Do you have Ideas for this server? Go to our Ideas - Bugs - Complaints section and post!"
};
PAWN doesn't process stuff in commentary .. so where you are putting the website "http://..." it will only be processed up until "http:" because afterwards you comment everything out by using "//" .. they should be escaped.
Reply
#8

Quote:
Originally Posted by Tɧ϶ Tσηί™
its in quotations...so not the problem.
Reply
#9

Quote:
Originally Posted by _❼_
Look..

pawn Код:
new Announcements[8][128] = { // Announcements[number of announcement messages][string lengh]
"Announcement: Visit Our Forums! Go to http://rayze-universe.lol",
"Announcement: Want to Stay with us? Add » 99.58.71.127:7777 « To your Favourites!",
"Announcement: Want to be a V.I.P Member? Pay only $10 and become V.I.P for life! (/vip)",
"Announcement: Want to know who is the developer of Party For Life! [P.F.R]? use /credits",
"Announcement: New to this server? Use /help or /commands. Also Please Register on our forums (/website)",
"Announcement: Want to be a Admin? Applicate on our forums, but Please Read our rules before doing so.",
"Announcement: Feel Free to invite your friends to Party For Life! We will have great thanks to you",
"Announcement: Do you have Ideas for this server? Go to our Ideas - Bugs - Complaints section and post!"
};
PAWN doesn't process stuff in commentary .. so where you are putting the website "http://..." it will only be processed up until "http:" because afterwards you comment everything out by using "//" .. they should be escaped.
Omg, For the last time, THERE ARE FUCKING QUOTATIONS AROUND THE STRING
|
v
"Announcement: Visit Our Forums! Go to http://rayze-universe.lol --->", <---
^
|
Reply
#10

Yes but the // will induce a comment no matter if it's being evaluated as a literal string or as a piece of code.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)