Making a ban save into a banlog.txt
#4

Quote:
Originally Posted by SyntaxQ
Посмотреть сообщение
pawn Код:
CMD:ban (playerid, params[])
{
   // replace targetid with the variable you use in your ban cmd and add this code
    new str[128];
    format(str, sizeof(str), "%s(%d) banned %s(%d)", GetName(playerid), playerid, GetName(targetid), targetid);
    new File:log;
    log = fopen("Logs/banslog", io_append);
    fwrite(log, str);
    fclose(log);
    return 1;
}

//-------------
stock GetName(playerid)
{
    new pName[MAX_PLAYERS];
    GetPlayerName(playerid, pName, sizeof(pName));
    return pName;
}
You can even include time and date using gettime(..); and getdate(..); and
You can learn better from this tutorial:
http://forum.sa-mp.com/showthread.ph...highlight=logs

EDIT: Were you looking for this^?
Yeah thanks .
Reply


Messages In This Thread
Making a ban save into a banlog.txt - by Johnson_Brooks - 28.05.2014, 14:05
Re: Making a ban save into a banlog.txt - by Johnson_Brooks - 28.05.2014, 14:27
Re: Making a ban save into a banlog.txt - by SyntaxQ - 28.05.2014, 15:31
Re: Making a ban save into a banlog.txt - by Johnson_Brooks - 28.05.2014, 18:44

Forum Jump:


Users browsing this thread: 1 Guest(s)