Why doesn't this work?
#1

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

Most likey too long.
Reply
#3

Quote:
Originally Posted by BMUK
Посмотреть сообщение
Most likey too long.
I've putted the size of the string higher q.q
Reply
#4

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

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

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

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

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

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
It's the same limit.
No it's not.
Reply
#10

If you embed color in SendClientMessage, your text shouldn't increase more than 150 (including color embedding code), otherwise it won't appear.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)