toribio

toribio

Feb 13th, 2009
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1.     if(!strcmp(cmd, "/bug", true))
  2.     {
  3.         new string[256], nome[24], bug[256], new File:arquivo;
  4.         tmp = strtok(cmdtext, idx), bug = tmp;
  5.         while(strlen(tmp) > 0)
  6.         {
  7.             strcat(bug, " ");
  8.             strcat(bug, tmp);
  9.             tmp = strtok(cmdtext, idx);
  10.         }
  11.         if(!strlen(tmp))
  12.             return SendClientMessage(playerid, 0xFFFFFFAA, "USE: /bug [descri��o]");
  13.         GetPlayerName(playerid, nome, sizeof nome);
  14.         format(string, sizeof string, "Bug encontrado por %s: %s\r\n", nome, bug);
  15.         arquivo = fopen("bugs.txt", io_append); //append = ler/escrever, coloca o ponteiro no final do arquivo
  16.         fwrite(arquivo, string);
  17.         fclose(arquivo);
  18.         return 1;
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment