CMD:ban(playerid, params[])
{
new ID, string[128], reason[24];
if(!(PlayerInfo[playerid][pAdmin] >= 3)) return SendClientMessage(playerid, -1, ""COL_RED"[ERROR]"COL_LIGHTBLUE" - You are not high enough to use this command.");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, ""COL_RED"[ERROR]"COL_LIGHTBLUE" - The player you're trying to ban isn't connected to the server.");
if(sscanf(params, "us[24]", ID, reason)) return SendClientMessage(playerid, -1, "[USAGE] - /ban ( ID ) ( Reason )");
format(string, sizeof(string), "** %s(%d) Has been banned by Administrator %s(%d) - Reason: %s",PlayerName(ID), ID, PlayerName(playerid), playerid, reason);
SendClientMessageToAll(COLOR_LIGHTRED, string);
Log("Log/ban.log", string);
PlayerInfo[ID][pBanned] =1;
Kick(ID);
return 1;
}
CMD:kick(playerid, params[])
{
new ID, string[90], reason[24];
if(!(PlayerInfo[playerid][pAdmin] >= 3)) return SendClientMessage(playerid, -1, ""COL_RED"[ERROR]"COL_LIGHTBLUE" - You are not high enough to use this command.");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, ""COL_RED"[ERROR]"COL_LIGHTBLUE" - The player you're trying to kick isn't connected to the server.");
if(sscanf(params, "us[24]", ID, reason)) return SendClientMessage(playerid, -1, "[USAGE] - /kick ( ID ) ( Reason )");
format(string, sizeof(string), "** %s(%d) Has been kicked by Administrator %s(%d) - Reason: %s",PlayerName(ID), ID, PlayerName(playerid), playerid, reason);
SendClientMessageToAll(COLOR_LIGHTRED, string);
Log("Log/kick.log", string);
Kick(playerid);
return 1;
}
stock Log(sz_fileName[], sz_input[]) {
new sz_logEntry[156], i_dateTime[2][3], File: fileHandle = fopen(sz_fileName, io_append);
gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);
format(sz_logEntry, sizeof(sz_logEntry), "[%i/%i/%i - %i:%i:%i] %s\r\n", i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], sz_input);
fwrite(fileHandle, sz_logEntry);
return fclose(fileHandle);
}
stock Log(sz_fileName[], sz_input[]) {
new sz_logEntry[156], i_dateTime[2][3], File: fileHandle = fopen(sz_fileName, io_append);
gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);
format(sz_logEntry, sizeof(sz_logEntry), "[%i/%i/%i - %i:%i:%i] %s\r\n", i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], sz_input);
if(fileHandle)
{
fwrite(fileHandle, sz_logEntry);
fclose(fileHandle);
}
}
Change to:
pawn Код:
|