AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   New line in chat/center/ShowStatus (https://forums.alliedmods.net/showthread.php?t=296368)

georgik57 04-19-2017 06:04

New line in chat/center/ShowStatus
 
Is it possible? I've seen new line being possible in center message at least on one server.
I've tried with \n on center message with no luck. How to do it? And how about the others? Proof:
http://i.imgur.com/V3L0fzY.png

PartialCloning 04-19-2017 09:13

Re: New line in chat/center/ShowStatus
 
Code:
^n

redivcram 04-19-2017 09:52

Re: New line in chat/center/ShowStatus
 
^

PHP Code:

client_print(idprint_center"An enemy is near you!^nAn enemy is near you!"); 


PRoSToTeM@ 04-19-2017 11:28

Re: New line in chat/center/ShowStatus
 
PHP Code:

client_print(clientprint_center"Some^rSome"); 

Or
PHP Code:

message_begin(MSG_ONESVC_CENTERPRINT_client);
write_string("Some^nSome");
message_end(); 


OciXCrom 04-19-2017 14:14

Re: New line in chat/center/ShowStatus
 
Basically you use ^r instead of ^n in center messages.

georgik57 04-19-2017 14:28

Re: New line in chat/center/ShowStatus
 
Thanks. How about ShowStatus text? The shit that shows "Friend: Bla Health: 100%". Is it possible to new line it too?
Edit: also, the chat?

OciXCrom 04-19-2017 14:49

Re: New line in chat/center/ShowStatus
 
For the chat, simply display another chat message. For ShowStatus - if none of the regular "tricks" don't work (^n, ^r), you probably can't.

PartialCloning 04-19-2017 15:48

Re: New line in chat/center/ShowStatus
 
Quote:

Originally Posted by OciXCrom (Post 2513592)
Basically you use ^r instead of ^n in center messages.

Not really. ^n works for me using engclient_print. Like PRoSToTeM@ mentioned it seems to depend on what method you use to print the message.

PRoSToTeM@ 04-19-2017 15:50

Re: New line in chat/center/ShowStatus
 
Quote:

Originally Posted by PartialCloning (Post 2513631)
Not really. ^n works for me using engclient_print.

Yep, engclient_print uses svc_centerprint. I forgot about engclient_print, it is more clear than sending svc_centerprint.

georgik57 04-19-2017 16:09

Re: New line in chat/center/ShowStatus
 
Regarding multiple chat messages, it's not a good idea to spam MSG_ONE messages. They can easily overflow the client. Is there no way at all of making it go to the next line?

Are there any other special characters like ^n and ^r new-line related?

Would trying them both at once make any difference? If yes, which one of them should be first?

I've read the titles.txt and resource/cstrike_english.txt files and they seem to be using \n only for new lines.
I know that in AMXX, \ is used to mark the continuation of a line, no matter if it is located inside a string or not, so I'm guessing that when I'm trying to send "An enemy is near you!\nAn enemy is near you!" AMXX messes with it?


All times are GMT -4. The time now is 15:45.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.