Raised This Month: $ Target: $400
 0% 

How to parse string


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
monolit
Junior Member
Join Date: May 2011
Old 05-13-2011 , 12:07   Re: How to parse string
Reply With Quote #3

Can you show me example please ? I'm very begginer in scripting.

Is it something like this?
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "mute"
#define VERSION "1.0"
#define AUTHOR "monolit"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say ""CmdSay")
}

public 
CmdSay(id)
{
    static 
arg[60]
    
read_argv(1argcharsmax(arg))
    
    if(
arg[0] != '!')
        return 
PLUGIN_CONTINUE;
    
    if(
equal(arg"!mute"5))
    {
        new 
target[20], mutetime[7], reason[40]
           
        
replace(argcharsmax(arg), "!mute """)
        
        
strbreak argtargetsizeof target-1mutetimesizeof mutetime-)
        
        
replace(argcharsmax(arg), target"")
        
replace(argcharsmax(arg), mutetime"")
        
        
copy(reasoncharsmax(reason), arg)
        
        
client_print(idprint_console"^nTarget: %s"target)
        
client_print(idprint_console"Time: %d"mutetime)
        
client_print(idprint_console"Reason: %s"reason)
        
        return 
PLUGIN_HANDLED_MAIN;
    }
    return 
PLUGIN_CONTINUE;

Also what is the difference between Charsmax(smth) and sizeof smth-1

Last edited by monolit; 05-13-2011 at 12:22.
monolit 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 04:20.


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