Make a log when using command.
#1

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

Then do it.
Reply
#3

...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.
Reply
#4

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).
Reply
#5

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);
Reply
#6

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)