Making a ban save into a banlog.txt
#1

I want to know how can i create a banlog.txt and actually make the bans save to that log instead of the samp.ban file .
Im using y_ini ( i dont know if it matters) but i have no idea how to make a banlog . Any help ?
Reply
#2

Код:
C:\Users\Desktop\GTA SA-MP Server\gamemodes\CnR.pwn(1937) : error 017: undefined symbol "Log"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#3

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^?
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)