28.05.2014, 11:49
Quote:
PHP код:
PHP код:
|
Anyways here's the full code
pawn Код:
CMD:ban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return NOACCESS
new targetid, reason[128];
if(sscanf(params, "us[30]", targetid, reason)) return SendClientMessage(playerid, -1, "USAGE: /ban [id] [reason]");
if(!IsPlayerConnected(targetid) || targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "The player is not connected.");
new pName[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], day, month, year, hour, minute, second, string[150];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
GetPlayerName(playerid,targetname,MAX_PLAYER_NAME);
getdate(day, month, year);
gettime(hour, minute, second);
format(string, sizeof(string), "[{FF0000}BAN{EEEEEE}]Administrator %s has banned %s for %s",pName,targetname,reason);
SendClientMessageToAll(COLOR_WHITE,string);
format(string, sizeof(string),"[{FF0000}BAN{EEEEEE}]Administrator %s has banned you for %s",pName,reason);
SendClientMessage(targetid,COLOR_WHITE,string);
SendClientMessage(targetid,COLOR_WHITE,"--------------------------------------");
SendClientMessage(targetid, COLOR_RED, "Ban Information");
format(string, sizeof(string), "Banned by: %s", pName);
SendClientMessage(targetid, COLOR_RED, string);
format(string, sizeof(string), "Banned for: %s", reason);
SendClientMessage(targetid, COLOR_RED, string);
format(string, sizeof(string), "Ban date: %d/%d/%d at %d:%d:%d.", day, month, year, hour, minute, second);
SendClientMessage(targetid, COLOR_RED, string);
SendClientMessage(targetid, COLOR_WHITE,"Please press the F8 button to take a screenshot to use it on your appeal");
SendClientMessage(targetid,COLOR_WHITE,"--------------------------------------");
PlayerInfo[targetid][pBanned] = 1;
// PlayerInfp[targetid][pBannedBy] = pName; // error lines
// PlayerInfo[targetid][pBannedFor] = reason; // error lines
SetTimerEx("BanPlayer", 200, false, "i", targetid);
return 1;
}