03.11.2012, 18:21
What is the default value for optional parameters that are left empty with sscanf?
I'm trying to insert -1 in the unbanstamp column if the player left "days" empty.
pawn Код:
CMD:ban(playerid, params[])
{
if(!IsPlayerAdminEx(playerid, 3)) {
return SendClientMessage(playerid, COLOR_GREY, " You are not authorised to use that command!");
}
new
target,
reason[20],
days;
if(sscanf(params, "usD", target, reason, days)) {
return SendSyntaxMessage(playerid, "Leave days empty to permaban the player", "/ban [playerid] [reason] [days]");
}
BanAccount(target, ReturnNameEx(playerid), reason, days == -1 ? -1 : gettime() + (days * 86400));
return 1;
}