22.05.2014, 13:42
Use optional string as Bible showed you. You also don't need to check anything because "reason" array stores the text whether the input was given or not.
EDIT: Didn't refresh the page.
--
Yes, the text should be inside parentheses and it doesn't matter about the letter case (lower/upper).
Documentation for optional strings: https://github.com/Y-Less/sscanf/wik...tional-strings
pawn Код:
CMD:kick(playerid, params[])
{
new targetid, reason[64];
if (sscanf(params, "rS(No reason specified)[64]", targetid, reason)) return SendClientMessage(playerid, COLOR_HERE, "Usage: /kick [id] [reason]");
//rest of code here
new msg[144];
format(msg, sizeof (msg), "%s has been kicked <> Reason: %s", ..., reason);
// ... is the argument for the name, modify it accoding to the code you have..
SendClientMessageToAll(COLOR_HERE, msg);
return 1;
}
--
Yes, the text should be inside parentheses and it doesn't matter about the letter case (lower/upper).
Documentation for optional strings: https://github.com/Y-Less/sscanf/wik...tional-strings

