27.11.2011, 14:54
Is it possible to make that??
To access to kick & Ban logg..??
To access to kick & Ban logg..??
// At The Top
#define LOG_BAN
#define LOG_KICK
// Kick Command
CMD: kick(playerid, params[])
{
// Code Here
#if defined LOG_KICK
LogKick(playerid, id, params);
#endif
return 1;
}
// Ban Command
CMD: ban(playerid, params[])
{
// Code Here
#if defined LOG_BAN
LogBan(playerid, id, params);
#endif
return 1;
}
stock LogBan(playerid, id, text[])
{
new File:gFile, year, month, day, hour, minute, second, string[256], nick[MAX_PLAYER_NAME];
getdate(year, month, day);
gettime(hour, minute, second);
if(!fexist("Ban_Log.txt"))
{
gFile = fopen("Ban_Log.txt", io_write);
fclose(gFile);
}
gFile = fopen("Ban_Log.txt", io_append);
format(string, sizeof(string), "[Date: %02d/%02d/%02d || Time: %02d:%02d:%02d] Ban Name: %s (%d)", day, month, year, hour, minute, second, nick, id);
fwrite(gFile, string);
fclose(gFile);
return 1;
}
stock LogKick(playerid, id, text[])
{
new File:gFile, year, month, day, hour, minute, second, string[256], nick[MAX_PLAYER_NAME];
getdate(year, month, day);
gettime(hour, minute, second);
if(!fexist("Kick_Log.txt"))
{
gFile = fopen("Kick_Log.txt", io_write);
fclose(gFile);
}
gFile = fopen("Kick_Log.txt", io_append);
format(string, sizeof(string), "[Date: %02d/%02d/%02d || Time: %02d:%02d:%02d] Kick Name: %s (%d)", day, month, year, hour, minute, second, nick, id);
fwrite(gFile, string);
fclose(gFile);
return 1;
}