Banning system
#4

Quote:
Originally Posted by vassilis
Посмотреть сообщение
I see there is getdate too so it actually helps thanks!
If still needed:

pawn Код:
/*Code here*/

    new sender[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sender, sizeof(sender));
    GetPlayerName(id, receiver, sizeof(receiver));
    new File:Bans = fopen("Bans.txt", io_append);
    if(Bans)
    {
        new y, m, d, h, mi, s;
        getdate(y,m,d);
        gettime(h,mi,s);
        format(string, sizeof(string), "- %i/%i/%i (%i:%i:%i) - %s banned by %s for %s\r\n", d, m, y, h, mi, s, sender, receiver, reason);
        fwrite(Bans, string);
        fclose(Bans);
        printf("- Successfully added ban to Bans.txt - %s banned by %s due to %s at %i/%i/%i", sender, receiver, reason, d, m, y);
    }
    else
    {
        printf("- Couldn't write ban at Bans.txt - %s banned by %s due to %s at %i/%i/%i", sender, receiver, reason, d, m, y);
    }
    /*Rest of code here*/
(You need to create Bans.txt at "scriptfiles" ..)
Reply


Messages In This Thread
Banning system - by vassilis - 22.03.2014, 11:00
Re: Banning system - by CroM256 - 22.03.2014, 11:15
Re: Banning system - by vassilis - 22.03.2014, 12:12
Re: Banning system - by Kyance - 22.03.2014, 13:30

Forum Jump:


Users browsing this thread: 3 Guest(s)