/kicks [ID] & /bans [ID]
#1

Is it possible to make that??

To access to kick & Ban logg..??
Reply
#2

What do you use for the saving part, dini, y_ini or MYSQL?
Reply
#3

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
What do you use for the saving part, dini, y_ini or MYSQL?
It matters not what he uses, file handling is done with file functions.
Reply
#4

I got one myselfe using dini files.. if you want i can post here
Reply
#5

pawn Код:
// 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;
}
pawn Код:
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;
}
Reply
#6

Much easier way for noobs to create commands like this use ****** Scanff simple.
If you need any help with this i will be happy to help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)