09.05.2013, 15:22
Код:
[17:19:19] sscanf warning: 'z' is deprecated, consider using 'S' instead. [17:19:19] sscanf warning: No default value found. [17:19:19] sscanf warning: Strings without a length are deprecated, please add a destination size.
pawn Код:
CMD:ban(playerid, params[])
{
new id, reason[35], name2[MAX_PLAYER_NAME], name1[MAX_PLAYER_NAME], string[128];
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GRAD2, "Grow some balls first, faggot.");
if(sscanf(params,"uz", id, reason)) return SendClientMessage(playerid, COLOR_WHITE,"USAGE: /ban [playerid/PartOfName] [reason]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY,"Invalid player specified!");
else
{
if(PlayerInfo[id][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_GRAD2, " You can't ban higher level administrators!");
new year, month, day;
new logstring[256];
getdate(year, month, day);
GetPlayerName(id, name2, sizeof(name2));
GetPlayerName(playerid, name1, sizeof(name1));
format(string, sizeof(string), "AdmCmd: %s has been banned by %s, reason: %s", name2, GetName(playerid), reason);
format(logstring, sizeof(logstring), "AdmCmd: %s was kicked by %s, reason: %s (%d-%d-%d).", name2, GetName(playerid), reason, month, day, year);
BanLog(logstring);
SendClientMessageToAll(COLOR_LIGHTRED, string);
new plrIP[16];
PlayerInfo[id][pBanned] = 1;
GetPlayerIp(id,plrIP, sizeof(plrIP));
SendClientMessage(id,COLOR_YELLOW,"|___________[BAN INFO]___________|");
format(string, sizeof(string), "Your name: %s.",name2);
SendClientMessage(id, COLOR_WHITE, string);
format(string, sizeof(string), "Your IP: %s.",plrIP);
SendClientMessage(id, COLOR_WHITE, string);
format(string, sizeof(string), "Who banned you: %s.",name1);
SendClientMessage(id, COLOR_WHITE, string);
format(string, sizeof(string), "Reason: %s.",reason);
SendClientMessage(id, COLOR_WHITE, string);
SendClientMessage(id,COLOR_YELLOW,"|___________[BAN INFO]___________|");
format(string,sizeof(string),"Please take a screenshot of this message (F8) and include it in your ban appeal.",GetName(playerid));
SendClientMessage(playerid, COLOR_YELLOW,string);
Ban(id);
}
return 1;
}
pawn Код:
SendClientMessage(id,COLOR_YELLOW,"|___________[BAN INFO]___________|");
format(string, sizeof(string), "Your name: %s.",name2);
SendClientMessage(id, COLOR_WHITE, string);
format(string, sizeof(string), "Your IP: %s.",plrIP);
SendClientMessage(id, COLOR_WHITE, string);
format(string, sizeof(string), "Who banned you: %s.",name1);
SendClientMessage(id, COLOR_WHITE, string);
format(string, sizeof(string), "Reason: %s.",reason);
SendClientMessage(id, COLOR_WHITE, string);
SendClientMessage(id,COLOR_YELLOW,"|___________[BAN INFO]___________|");
format(string,sizeof(string),"Please take a screenshot of this message (F8) and include it in your ban appeal.",GetName(playerid));
SendClientMessage(playerid, COLOR_YELLOW,string);