Rillsen1998

Saving Logs And Formatting Text

Feb 20th, 2013
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.73 KB | None | 0 0
  1. #define LOGS_FOLDER "Logs/"
  2.  
  3. #define SendClientFormattedMessage(%0,%1,%2,%3) \
  4. format(Format,150,%2,%3); \
  5. SendClientMessage(%0,%1,Format)
  6.  
  7. #define SendClientFormattedMessageToAll(%0,%1,%2) \
  8. format(Format,150,%1,%2); \
  9. SendClientMessageToAll(%0,Format)
  10.  
  11. #define SaveLog(%0,%1,%2) \
  12. FileLog = fopen(%0,io_append); \
  13. format(Log,500,%1,%2); \
  14. strcat(Log,"\r\n"); \
  15. fwrite(FileLog,Log); \
  16. fclose(FileLog)
  17.  
  18. #define SaveToLog(%0,%1) \
  19. new Year,Month,Day; \
  20. getdate(Year,Month,Day); \
  21. format(Log,500,"%s%02d.%02d.%d.log",LOGS_FOLDER,Day,Month,Year); \
  22. FileLog = fopen(Log,io_append); \
  23. format(Log,500,%0,%1); \
  24. strcat(Log,"\r\n"); \
  25. fwrite(FileLog,Log); \
  26. fclose(FileLog)
  27.  
  28. new Format[150];
  29.  
  30. new File:FileLog;
  31.  
  32. new Log[500];
Advertisement
Add Comment
Please, Sign In to add comment