17.06.2013, 01:14
If you want definite results use sscanf like this.
Ok well suppose you wanted your ban to work without days or a reason you can just do it like this then make some checks after to determine which gives a more specific result for instance.
I prefer this method hands down.
pawn Код:
CMD:ban(playerid, params[])
{
new pid, days, reason[128];
if(sscanf(params, "uis[128]", pid, days, reason)) return SendClientMessage(playerid, 0xFF00FFFF, "Usage /ban <ID> <Days> <Reason>");
........
}
pawn Код:
CMD:ban(playerid, params[])
{
new pid, days, reason[128];
sscanf(params, "uis[128]", pid, days, reason)
if(days < 0) days = 1; // Default days
........
}