BernardoMalkovich

/reportarbug

Jun 19th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. if(strcmp(cmd, "/reportarbug", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. new length = strlen(cmdtext);
  6. while ((idx < length) && (cmdtext[idx] <= ' '))
  7. {
  8. idx++;
  9. }
  10. new offset = idx;
  11. new result[256];
  12. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  13. {
  14. result[idx - offset] = cmdtext[idx];
  15. idx++;
  16. }
  17. result[idx - offset] = EOS;
  18. if(!strlen(result))
  19. {
  20. return true;
  21. }
  22. getdate(Ano, Mes, Dia);
  23. gettime(Hora, Minuto, Segundo);
  24. if(PlayerInfo[playerid][pConnectTime] >= 0)
  25. {
  26. new OPS[256];
  27. SendClientMessage(playerid, COLOR_WHITE, "Obrigado por reportar o bug, iremos verificar o mais rapido!");
  28. SendClientMessage(playerid, COLOR_WHITE, "Entraremos em contato com voce. Aguarde!");
  29. new File:filebug;
  30. filebug = fopen("BUGS.txt",io_append);
  31. format(OPS, 256, "//>__________________ [ %d/%d/%d as %d:%d:%d ] __________________<\n\n//Reportado por: %s\n Suposto BUG: %s\n\n",
  32. Dia, Mes, Ano,
  33. Hora, Minuto, Segundo,
  34. PlayerName(playerid),
  35. result);
  36. fwrite(filebug,OPS);
  37. fclose(filebug);
  38. SendClientMessage(playerid, COLOR_AZULCLARO, "BUG salvo com sucesso!");
  39. return true;
  40. }
  41. else
  42. {
  43. SendClientMessage(playerid, COLOR_BRANCO, "Você precisa ter mais de 1 hora jogada para relatar um BUG");
  44. return true;
  45. }
  46. }
  47. return true;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment