SA-MP Forums Archive
Make a log when using command. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Make a log when using command. (/showthread.php?tid=92797)



Make a log when using command. - craponnaruto - 22.08.2009

I need to make a bank log when using a bank command.Like /deposit or /bank


Re: Make a log when using command. - MenaceX^ - 22.08.2009

Then do it.


Re: Make a log when using command. - craponnaruto - 22.08.2009

...I'm going to say this again but more clear.How can I make it so when a player types certain commands,a log is created in scriptfiles and it saves your bank data.


Re: Make a log when using command. - Weirdosport - 22.08.2009

You need something like dudb, or dini to save it as a scriptfile. (Although with some wiki'ing you could just make yourself using fwrite).


Re: Make a log when using command. - woot - 22.08.2009

pawn Код:
forward BankLog(string[]);
public BankLog(string[])
{
    new entry[128];
    format(entry, sizeof(entry), "%s\n",string);
    new File:hFile;
    hFile = fopen("/logs/bank.log", io_append);
    fwrite(hFile, entry);
    fclose(hFile);
}
Example usage in /deposit:
pawn Код:
format(string, sizeof(string), "[DEPOSIT] %s used /deposit %d", PlayerName(playerid), amount);
BankLog(string);



Re: Make a log when using command. - craponnaruto - 22.08.2009

Thanks