Originally Posted by DobbysGamertag
I'm not too sure, I use SendMessageToAdmins and SaveIn, I format a string, then when they enter any command, it saves. Does your code compile?
Edit:
pawn Код:
forward SaveIn(filename[],text[]);
public SaveIn(filename[],text[]) { new File:Lfile; new filepath[256]; new string[256]; new year,month,day; new hour,minute,second;
getdate(year,month,day); gettime(hour,minute,second); format(filepath,sizeof(filepath),"PATHHERE/%s.txt",filename);//save it as %s.txd Lfile = fopen(filepath,io_append); format(string,sizeof(string),"[%02d/%02d/%02d | %02d:%02d:%02d] %s\r\n",day,month,year,hour,minute,second,text); fwrite(Lfile,string); fclose(Lfile); return 1; }
Here's my OnPlayerCommand:
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success) { if(!success) SendClientMessage(playerid,bad,"Incorrect command, type /cmds to find out available commands"); if(WatchList[playerid] >= 1) { new string[124]; format(string, sizeof(string),"[WATCHLIST]%s entered command %s",pName(playerid),cmdtext); SendMessageToAdmins(connect,string); } else if(WatchList[playerid] <= 0) { new string[124]; format(string, sizeof(string),"%s entered command %s",pName(playerid),cmdtext); SaveIn("EnteredCommands",string); } return 1; }
Understand how i've done it?
|