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 , 17:32   Re: Read certain part of chat message
Reply With Quote #8

Quote:
Originally Posted by Black Rose View Post
You can. Just use read_args() and strbreak(), parse() or strtok() to single out the first argument from the rest.
Hm.. I just tried all this out, but i can't get it to work.. Nothing at all happens, it doesn't even seem to go to the Playerreport function when i type /report bla blablal.. I know why.. It is because "/report blablabla" isn't a command.. But i gotta make it one somehow, so it is a command whatever you type after the /report

Code:

PHP Code:
#include <amxmodx>

new const File[ ] = "addons/amxmodx/reportlog.txt"

public plugin_init( ) {
    
register_plugin"Report Player""1.0""BuckShot" )
    
register_clcmd"say /report""PlayerReport" )
}

public 
PlayerReportid )
{
    new 
FullMsg192 ], Reason161 ], Name32 ], WriteMsg192 ]
    
    
read_argsFullMsg31 )
    
read_argv1Name32 )
    
    new 
len sizeofName )
    
    
strbreakFullMsgNamelenReason160 )
    
formatexWriteMsg192"Player: %s\n Reason: %s"NameReason)
    
write_fileFileWriteMsg )
    


Edit: I gotta register_clcmd("say ", "PlayerReport" ) only, and check if contains /report? that could work
__________________
PM me for private work.



Last edited by Buckshot; 03-29-2014 at 17:42.
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