[HELP] Some question about dialog and "\n"
#1

Hey, I'm working on Spray tag system, and everything works fine, but when I'm using too much letters,
some part of them just cutted and its looks like some part to of the letters is behind the wall
Picture for example: http://i39.tinypic.com/2hwi72e.png

and my question is how can I know if some player wrote \n inside the dialog and make it in the mode
like if player wrote in the dialog Test\nTest123
its will make the text like that
"
Test
Test123
"

Thanks for help.
Reply
#2

*BUMP* moved to page 3.
Reply
#3

Use | and replace | to \n in your own function
Reply
#4

SetObjectMaterialText() does not accept that it will just show anything you put as the string on one line. If you want more than one line you'll need to use an additional object.
Reply
#5

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
SetObjectMaterialText() does not accept that it will just show anything you put as the string on one line. If you want more than one line you'll need to use an additional object.
When I'm writing in the gamemode SetObjectMaterialText Sometest123\nTest its works
but when I'm writing it in the dialog its not works because the dialog dosen't support it, so I want to know how to make the dialog to support it, like if player wrote \n in the dialog, it will replace it with '\n' in the gamemode.
like bbcode just in pawn.
Quote:
Originally Posted by Jefff
Посмотреть сообщение
Use | and replace | to \n in your own function
That's the problem, I don't know how to do it, because of that I made this topic,
maybe you guys can teach me how to do it.
Reply
#6

pawn Код:
Check(txt[])
{
    new d=0;
    while(txt[d])
    {
        if(txt[d] == '|')
            txt[d] = '\n';
        d++;
    }
}
pawn Код:
input - Test|Test123
Check(inputtext);
output - Test\nTest123
pawn Код:
Check(inputtext);
SetObjectMaterialText(...);
Reply
#7

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
Check(txt[])
{
    new d=0;
    while(txt[d])
    {
        if(txt[d] == '|')
            txt[d] = '\n';
        d++;
    }
}
pawn Код:
input - Test|Test123
Check(inputtext);
output - Test\nTest123
pawn Код:
Check(inputtext);
SetObjectMaterialText(...);
Thank you very much, Its works great, thank you so much.
you just made my day

last question, if I want to made 'g' symbol as embed color for example
if players wrote Test123{g}Test1
Test1 will be green, how to make it?
Reply
#8

BUMP moved to page 3 again.
Reply
#9

On top of your script:
pawn Код:
#define {g} "{00FF00}"
Reply
#10

Quote:
Originally Posted by Dragonsaurus
Посмотреть сообщение
On top of your script:
pawn Код:
#define {g} "{00FF00}"
Your line makes this error
error 074: #define pattern must start with an alphabetic character
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)