29.03.2013, 16:58
Hello,
I get this in my console :
This happens when i do my /ban command, the command works fine but i want to fix the warnings too!
Command :
BanPlayer Timer :
Please help!
I get this in my console :
Код:
[20:19:05] sscanf warning: No default value found. [20:19:05] sscanf warning: Unknown format specifier '[', skipping. [20:19:05] sscanf warning: Unknown format specifier '6', skipping. [20:19:05] sscanf warning: Unknown format specifier '4', skipping. [20:19:05] sscanf warning: Unknown format specifier ']', skipping. [20:19:05] sscanf warning: Format specifier does not match parameter count.
Command :
pawn Код:
CMD:ban(playerid, params[])
{
new ReAson[64];
if(PlayerInfo[playerid][pAdmin] < 5)
return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to be Level 5 to use this command!");
else if(sscanf(params, "dS[64]", bID, ReAson))
return SendClientMessage(playerid, COLOR_LIGHTRED, "Usage: /ban <playerid> <reason>");
else if(bID == playerid)
return SendClientMessage(playerid, COLOR_LIGHTRED, "You can't ban yourself!");
else if(!IsPlayerConnected(bID))
return SendClientMessage(playerid, COLOR_LIGHTRED, "Player not found!");
else
{
new pName[24];
new str[128];
GetPlayerName(playerid, pName, 24);
format(str, 128, "Adminstrator %s banned you! (Reason : %s)", pName, ReAson);
SendClientMessage(bID, COLOR_ORANGE, str);
new pNaMe[24];
new rName[24];
new sTr[128];
GetPlayerName(playerid, pNaMe, 24);
GetPlayerName(bID, rName, 24);
format(sTr, 128, "Adminstrator %s banned %s! (Reason : %s)", pNaMe, rName, ReAson[0] ? ReAson : "No Reason Given");
SendClientMessageToAll(COLOR_ORANGE, sTr);
SetTimerEx("BanPlayer", 100, false, "i", playerid);
}
return 1;
}
pawn Код:
forward BanPlayer(playerid);
public BanPlayer(playerid)
{
Ban(bID);
return 1;
}