toribio

toribio

Feb 15th, 2009
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. public OnPlayerCommandText(playerid, cmdtext[])
  2. {
  3.     new cmd[256], tmp[256], idx;
  4.     cmd = strtok(cmdtext, idx);
  5.  
  6.     if(!strcmp(cmd, "/bug", true))
  7.     {
  8.         new string[256], nome[24], ip[24], bug[256], File:arquivo, atual[8];
  9.         tmp = strtok(cmdtext, idx), bug = tmp;
  10.         while(strlen(tmp) > 0)
  11.         {
  12.             strcat(bug, " ");
  13.             strcat(bug, tmp);
  14.             tmp = strtok(cmdtext, idx);
  15.         }
  16.         if(!strlen(tmp))
  17.             return SendClientMessage(playerid, 0xFFFFFFAA, "USE: /bug [descriοΏ½οΏ½o]");
  18.         GetPlayerName(playerid, nome, sizeof nome);
  19.         GetPlayerIp(ayerid, ip, sizeof ip);
  20.         getdate(atual[2], atual[1], atual[0]);
  21.         gettime(atual[3], atual[4], atual[5]);
  22.         format(string, sizeof string, "[%02d/%02d/%d][%02d:%02d:%02d][%s][%s]: %s\r\n",
  23.             atual[0], atual[1], atual[2], atual[3], atual[4], atual[5], ip, nome, bug);
  24.         SendClientMessage(playerid, 0xFFF000AA, "Obrigado por nos avisar este bug.");
  25.         arquivo = fopen("bugs.txt", io_append);
  26.         fwrite(arquivo, string);
  27.         fclose(arquivo);
  28.         return 1;
  29.     }
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment