Hello,
How to make it work with double quotes? "
It won't work both of them.
Code:
new FirstArg[ 32 ], SecondArg[ 32 ];
read_argv( 1, FirstArg, sizeof ( FirstArg ) -1 );
read_argv( 2, SecondArg, sizeof ( SecondArg ) -1 );
if(contain(SecondArg, "^"") == 0 )
{
console_print(id, "Working...");
}
new Regex:check = regex_match(SecondArg, "^"", ret, error, charsmax(error), "i")
if(Regex:check != REGEX_MATCH_FAIL && Regex:check != REGEX_PATTERN_FAIL && Regex:check != REGEX_NO_MATCH)
{
console_print(id, "Working...");
}
P.S
Till i got answer i found a solution... i know is not the best but at least it work
/* === START REASON === */
new CheckReason[ 100 ];
read_argv( 2, CheckReason, sizeof ( CheckReason ) -1 );
if( strlen(CheckReason) < 10 )
{
console_print(id, "Reason isn't sufficient, please describe more (minimum - 10 chars)");
return PLUGIN_HANDLED
}
read_args( CheckReason, charsmax ( CheckReason ) ); //catch charachters
if( contain( CheckReason, "^"" ) <= 0 )
{
console_print(id, "Invalid reason format, please use: amx_kick <name, #userid> ^"reason^"");
return PLUGIN_HANDLED
}
// Clean & final reason
new reason[ 100 ];
read_argv( 2, reason, sizeof ( reason ) -1 );
/* === END REASON === */
Well what i want to do is to force admin to use command in this way:
amx_kick Nickname "reason_between_quotes"
My solution from beloved it check only if contain at least 1 double_quote
Why i force using ""
Cause if you execute command in this way: amx_kick Nickname You have been kicked from server because you are inactive!
The reason isn't printed fully
If someone can help me to find a simple and clean solution for checking reason argument 2 from kick and force admin to use double quote "" i appreciate.
Thank you