Quote:
Originally Posted by rappy93
pawn Код:
if(sscanf(params,"d", playerid)) return SendClientMessage(playerid, "/kick [target id]");
Think this might do it.
|
This can help.
If you want to add a reason to it use this:
pawn Код:
if(sscanf(params, "us[128]", tID, reason)) return SendClientMessage(playerid, /*COLOR HERE*/, "* [USAGE]: /kick [playerid/PartOfName] [Reason]");
I replaced the "d" with "u" so you can type a part of the players name or his ID.
"s" stands for string, that means that it's a message, in this case: your reason.
"[128]", behind the "s" is the maximum length your reason can have.
If you want to make your reason optional, use this:
pawn Код:
if(sscanf(params, "uS(No Reason)[128]", tID, reason)) return SendClientMessage(playerid, /*COLOR HERE*/, "* [USAGE]: /kick [playerid/PartOfName] [Reason]");
Make sure you have a local variable. Example:
Edit:
I forgot to mention that "tID" is the targetid, you have to make a local variable for that one too.