Again: error 001: expected token: "-string end-", but found "-identifier-"
#1

Код:
C:(799) : error 001: expected token: "-string end-", but found "-identifier-"
C:(801) : error 010: invalid function or declaration
PHP код:
new randomMessages[][] =
{
     
""COL_WHITE"["COL_BLUE"SERVER]"COLOR_GREY" Found A Bug? Let Us Know! Report It Here: www.Apocalypse-Z.tk",//line 799
    
""COL_WHITE"["COL_BLUE"SERVER]"COLOR_GREY" Seen A Hacker/Rulebreaker? Let Us Know With ' /report <id> <reason> ' ."
};//line 801 
PHP код:
function RandomMessages()
{
    new 
randomMsg random(sizeof(randomMessages));
    
SendClientMessageToAll(-1randomMessages[randomMsg]);

This Error Is Completely Messing up with me before, any help?
Reply
#2

can u show the full code ?
Reply
#3

thats it.
Reply
#4

Hmm, lemme try to see what's wrong
Reply
#5

What if you remove those colors from text?
Reply
#6

Show me the COLOR_ defines.
Reply
#7

Random Messages don't work like that.

pawn Код:
new randomMessages[][] =
{
     "Found A Bug? Let Us Know! Report It Here: www.Apocalypse-Z.tk",
    " Seen A Hacker/Rulebreaker? Let Us Know With ' /report <id> <reason> ' ." ,
}
pawn Код:
RandomMessages() //There is no need to use "Function" or public or stock or anything like that..
{
    new randomMsg = random(sizeof(randomMessages)), string[150];
    format(string, sizeof(string), "[{0000FF}SERVER{FFFFFF}]: {E6E6E6} %s", randomMessages[randomMsg]);
    SendClientMessageToAll(-1, string);
}
You cannot use double quotes in anything, nor can you use defines in color embedding. Replace my colors in the {} with the ones of your choice, but they have to be the actual color code. Unfortunately, this isn't PHP, and you can't simply use the echo function to print stuff.
Reply
#8

it should be
pawn Код:
new randomMessages[][] =
{
     "Found A Bug? Let Us Know! Report It Here: www.Apocalypse-Z.tk",
    " Seen A Hacker/Rulebreaker? Let Us Know With ' /report <id> <reason> ' ."
};
Reply
#9

Quote:
Originally Posted by Eth
Посмотреть сообщение
it should be
pawn Код:
new randomMessages[][] =
{
     "Found A Bug? Let Us Know! Report It Here: www.Apocalypse-Z.tk",
    " Seen A Hacker/Rulebreaker? Let Us Know With ' /report <id> <reason> ' ."
};
Thank you for copying my post. If I already answered it, why would you copy me?
Reply
#10

Quote:
Originally Posted by TakeiT
Посмотреть сообщение
Random Messages don't work like that.

pawn Код:
new randomMessages[][] =
{
     "Found A Bug? Let Us Know! Report It Here: www.Apocalypse-Z.tk",
    " Seen A Hacker/Rulebreaker? Let Us Know With ' /report <id> <reason> ' ." ,
}
pawn Код:
RandomMessages() //There is no need to use "Function" or public or stock or anything like that..
{
    new randomMsg = random(sizeof(randomMessages)), string[150];
    format(string, sizeof(string), "[{0000FF}SERVER{FFFFFF}]: {E6E6E6} %s", randomMessages[randomMsg]);
    SendClientMessageToAll(-1, string);
}
You cannot use double quotes in anything, nor can you use defines in color embedding. Replace my colors in the {} with the ones of your choice, but they have to be the actual color code. Unfortunately, this isn't PHP, and you can't simply use the echo function to print stuff.
Thanks For Help! +1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)