Raised This Month: $ Target: $400
 0% 

Read certain part of chat message


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Buckshot
Senior Member
Join Date: Mar 2014
Location: Sweden
Old 03-29-2014 , 18:36   Re: Read certain part of chat message
Reply With Quote #10

Quote:
Originally Posted by Black Rose View Post
Say commands are different.
"say" is the command, everything else is the first argument.
So you have to manually parse that argument into the bits you want.

Code:
#include <amxmodx> public plugin_init( ) {     register_plugin( "Report Player", "1.0", "BuckShot" )     register_clcmd( "say", "PlayerReport" ) } public PlayerReport( id ) {     new FullMsg[ 192 ], Reason[ 161 ], Name[ 32 ], Command[ 32 ]         read_args( FullMsg, charsmax(FullMsg) )     strbreak(FullMsg, Command, charsmax(Command), FullMsg, charsmax(FullMsg))         if ( ! equali(Command, "/report") )         return;         strbreak(FullMsg, Name, charsmax(Name), Reason, charsmax(Reason))         server_print("%s, %s, %s", Command, Name, Reason); }
Thank you By the way.. I think the "new len = sizeof( Name )" has to be there, and also len instead of charsmax(Name) i noticed you removed it. Otherwise it is going to strbreak after 32 characters, which is not what we want. All player names are not 32 characters long, so it might put some of the Message in there as well. Also the Command isn't 32 chars long.. Correct me if im wrong
__________________
PM me for private work.



Last edited by Buckshot; 03-29-2014 at 19:25.
Buckshot is offline
Send a message via Skype™ to Buckshot
 



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 05:56.


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