toribio

toribio

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