Why doesn't this work? -
FireCat - 22.07.2011
I have this piece of code
pawn Код:
if(mathson == false)
{
KillTimer(stopper);
mathson = true;
new rand1;
new rand2;
new rand4;
rand1 = random(222);
rand2 = random(111);
rand4 = random(50);
answer = rand1 + rand2 + rand4;
new str[264];
format(str,sizeof str,"« Maths » "lgreen2"What is "lorange"%d+%d+%d"lgreen2"? Worth "lorange"$15,000 "lgreen2"+"lorange"5 Score"lgreen2"! "lyellow"Use /ANSWER <answer> to answer!",rand1,rand2,rand4);
SendClientMessageToAll(red,str);
stopper = SetTimer("endmath",60000,false);
}
It doesn't send the message, but it activates the timer...
Whats the problem?
Re: Why doesn't this work? -
BMUK - 22.07.2011
Most likey too long.
Re: Why doesn't this work? -
FireCat - 22.07.2011
Quote:
Originally Posted by BMUK
Most likey too long.
|
I've putted the size of the string higher q.q
Re: Why doesn't this work? -
BMUK - 22.07.2011
The string that you are sending to the client in one single message is too long,
fact.
Try removing the embedded colors and you will see that it will send. You need to loose about 20 - 30 characters.
I counted 148 characters in that string.
Re: Why doesn't this work? -
MoroDan - 22.07.2011
Quote:
Originally Posted by FireCat
I have this piece of code
pawn Код:
if(mathson == false) { KillTimer(stopper); mathson = true; new rand1; new rand2; new rand4; rand1 = random(222); rand2 = random(111); rand4 = random(50); answer = rand1 + rand2 + rand4; new str[264]; format(str,sizeof str,"« Maths » "lgreen2"What is "lorange"%d+%d+%d"lgreen2"? Worth "lorange"$15,000 "lgreen2"+"lorange"5 Score"lgreen2"! "lyellow"Use /ANSWER <answer> to answer!",rand1,rand2,rand4); SendClientMessageToAll(red,str); stopper = SetTimer("endmath",60000,false); }
It doesn't send the message, but it activates the timer...
Whats the problem?
|
Max output is 128.
Re: Why doesn't this work? -
Mean - 22.07.2011
Quote:
Originally Posted by MoroDan
Max output is 128.
|
Not really, since 0.3c, when color embedding came, it's a little higher, as far as I know.
But yes, probably it is too long.
Respuesta: Why doesn't this work? -
clavador - 22.07.2011
Quote:
Originally Posted by FireCat
I have this piece of code
pawn Код:
if(mathson == false) { KillTimer(stopper); mathson = true; new rand1; new rand2; new rand4; rand1 = random(222); rand2 = random(111); rand4 = random(50); answer = rand1 + rand2 + rand4; new str[264]; format(str,sizeof str,"« Maths » "lgreen2"What is "lorange"%d+%d+%d"lgreen2"? Worth "lorange"$15,000 "lgreen2"+"lorange"5 Score"lgreen2"! "lyellow"Use /ANSWER <answer> to answer!",rand1,rand2,rand4); SendClientMessageToAll(red,str); stopper = SetTimer("endmath",60000,false); }
It doesn't send the message, but it activates the timer...
Whats the problem?
|
Make the string 128 (max chat output) and you'll see your message, but it will be cut to that length.
You should part it in two if you want it to be that long.
Re: Why doesn't this work? -
IstuntmanI - 22.07.2011
Quote:
Originally Posted by Mean
Not really, since 0.3c, when color embedding came, it's a little higher, as far as I know.
But yes, probably it is too long.
|
It's the same limit.
Try like this:
Код:
format(str,sizeof str,"« Maths » "lgreen2"What is \"%d+%d+%d\" ? Worth "lorange"$15,000 + 5 Score"lgreen2"! "lyellow"Use /ANSWER <answer> to answer!",rand1,rand2,rand4);
SendClientMessageToAll(red,str);
If still don't work, remove more colours.
Re: Why doesn't this work? -
Mean - 22.07.2011
Quote:
Originally Posted by costel_nistor96
It's the same limit.
|
No it's not.
Re: Why doesn't this work? -
Adil - 22.07.2011
If you embed color in SendClientMessage, your text shouldn't increase more than 150 (including color embedding code), otherwise it won't appear.