Raised This Month: $ Target: $400
 0% 

Output Message With Spaces As One Argument


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
klashfire
Member
Join Date: May 2014
Location: NY, USA
Old 04-06-2016 , 21:29   Output Message With Spaces As One Argument
Reply With Quote #1

Well, first off - I'm new to sourcemod (coding, not server handling).

I want to know how to output a clients entire message to the chat even though they have spaces.
Let's say my plugin was just like the sm_say command, bundled with sourcemod. The command allows the user to type
Code:
/say Stop Abusing The Commands
and the output message would be:
(ALL) Stop Abusing The Commands

Although, when I try to replicate such a feature in a plugin, I would normally get
(ALL) Stop

This is of course because the spaces indicate that separate arguments are present and treats them as such. I reviewed the basechat.sp file, however, and found no indication of how this was done.

The user could just type in console
Code:
say /command "this is a message"
and the message in quotes would be treated as one string. I want to know how to do this in chat.
__________________

klashfire is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 04-06-2016 , 21:44   Re: Output Message With Spaces As One Argument
Reply With Quote #2

https://sm.alliedmods.net/api/index....d=show&id=474&
Miu is offline
klashfire
Member
Join Date: May 2014
Location: NY, USA
Old 04-06-2016 , 21:51   Re: Output Message With Spaces As One Argument
Reply With Quote #3

oh, nvm actually - I had that in my code, but I accidentally had a conflicting command later on that overwrites it.

Thanks anyway.
__________________

klashfire is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-06-2016 , 21:57   Re: Output Message With Spaces As One Argument
Reply With Quote #4

While it's brought up, if you are having issues with quotation marks not working in the chat box, then take a look at this plugin:

https://forums.alliedmods.net/showthread.php?t=271137
__________________
ddhoward is offline
klashfire
Member
Join Date: May 2014
Location: NY, USA
Old 04-06-2016 , 22:09   Re: Output Message With Spaces As One Argument
Reply With Quote #5

Quote:
Originally Posted by ddhoward View Post
While it's brought up, if you are having issues with quotation marks not working in the chat box, then take a look at this plugin:

https://forums.alliedmods.net/showthread.php?t=271137
nice!
Side question: any reason for that tf2 update? I remember when it happened and realized it affected the sourcemod chat arguments, but I never knew why it was implemented.
__________________

klashfire is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-07-2016 , 02:52   Re: Output Message With Spaces As One Argument
Reply With Quote #6

Chat is passed to the server via a console command, so if you persuaded someone to say something containing `"; quit` they'd quit the game, and other similar exploits.
__________________
asherkin is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:00.


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