Jakwob-WG

[SNIPPET] Command logging

Oct 23rd, 2014
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.33 KB | None | 0 0
  1. OnPlayerCommandPerformed(playerid, cmdtext[], success)
  2. {
  3.   new File:log = fopen("cmd.txt", io_write);
  4.     if(log)
  5.     {
  6. new str[56], name[MAX_PLAYER_NAME];
  7. GetPlayerName(playerid, name, sizeof(name));
  8. format(str,sizeof(str),"%s has used %s command. \r\n",name,cmdtext);
  9.         fwrite(log, str);
  10.         fclose(log);
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment