This is how I would 'parse' the string:
PHP Code:
new szArg[45]
read_args(szArg, charsmax(szArg))
// Might need a remove_quotes(szArg) here. I can't remember.
new szCmd[12], szTarget[12], szTime[4], szReason[20]
strbreak(szArg, szCmd, charsmax(szCmd), szArg, charsmax(szArg))
strbreak(szArg, szTarget, charsmax(szTarget), szArg, charsmax(szArg))
strbreak(szArg, szTime, charsmax(szTime), szReason, charsmax(szReason))
client_print(id, print_console, "Command: %s", szCmd) // In your case szCmd should be "!mute"
client_print(id, print_console, "Target: %s", szTarget)
client_print(id, print_console, "Time: %d", str_to_num(szTime))
client_print(id, print_console, "Reason: %s", szReason)
Quote:
Originally Posted by minimiller
Or you can use parse()
|
You can't use parse if you want to have any spaces in the reason section.
__________________