Raised This Month: $ Target: $400
 0% 

Read certain part of chat message


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 03-29-2014 , 18:10   Re: Read certain part of chat message
Reply With Quote #9

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); }
__________________

Last edited by Black Rose; 03-29-2014 at 18:11.
Black Rose is offline
 



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