public OnPlayerText(playerid, text[])
{
new File:fi_log;
fi_log = fopen("scriptfiles/Admin/Logs/Chatlog.txt", io_append);
new string[256], day, year, month, hour, minute, second;
getdate(year, month, day); gettime(hour, minute, second);
format(string, sizeof(string), "|[%d/%d/%d - %d:%d:%d]|%s|\r\n", day, month, year, hour, minute, second, text);
fwrite(fi_log, string);
fclose(fi_log);
public Chatlog(text[])
{
new File:fi_log;
fi_log = fopen("scriptfiles/Admin/Logs/Chatlog.txt", io_append);
new string[256], day, year, month, hour, minute, second;
getdate(year, month, day); gettime(hour, minute, second);
format(string, sizeof(string), "|[%d/%d/%d - %d:%d:%d]|%s|\r\n", day, month, year, hour, minute, second, text);
fwrite(fi_log, string);
fclose(fi_log);
return 1;
}
CMD:kick(playerid, params[])
{
new pID, atext[256], cstring[256], aname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME];
if(sscanf(params, "us[256]", pID, atext)) return SendClientMessage(playerid, 0xFF0000AA, "[USAGE] /kick <playerid> <reason>");
if(pInfo[playerid][Level] < 3) return 0;
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR] User is not connected.");
else
{
GetPlayerName(playerid, aname, sizeof(aname));
GetPlayerName(pID, pname, sizeof(pname));
format(cstring, sizeof(cstring), "[ADMIN] %s has kicked %s from the server for %s", aname, pname, atext);
SendClientMessageToAll(0xFF0000AA, cstring);
format(cstring, sizeof(cstring), "You've been kicked from the server by %s for %s", aname, atext);
SendClientMessage(pID, 0xFF0000AA, cstring);
new File:fi_log;
fi_log = fopen("Admin/Logs/Kicklog.txt", io_append);
new string[256], day, year, month, hour, minute, second;
getdate(year, month, day); gettime(hour, minute, second);
format(string, sizeof(string), "[%d/%d/%d - %d:%d:%d]%s has kicked %s from the server. reason: %s.\r\n", day, month, year, hour, minute, second, aname, pname, atext);
fwrite(fi_log, string);
fclose(fi_log);
Kick(pID);
}
return 1;
}
11/5/2013 - 18:29:33]GwE_NIKO has kicked GwE_NIKO from the server. reason: I don't need a reason to kick myself, do i?. [11/5/2013 - 18:29:33] [11/5/2013 - 18:31:9]GwE_NIKO has kicked GwE_NIKO from the server. reason: I don't need a reason to kick myself, do i?. [11/5/2013 - 18:31:9] |