Making a ban save into a banlog.txt - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Making a ban save into a banlog.txt (
/showthread.php?tid=515882)
Making a ban save into a banlog.txt -
Johnson_Brooks - 28.05.2014
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 ?
Re: Making a ban save into a banlog.txt -
Johnson_Brooks - 28.05.2014
Код:
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.
Re: Making a ban save into a banlog.txt -
SyntaxQ - 28.05.2014
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^?
Re: Making a ban save into a banlog.txt -
Johnson_Brooks - 28.05.2014
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 .