shepher

Ban Perso - Shepher & The Rev' - [YDP.dll]

Jun 30th, 2011
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. // Shepher & The Rev'
  2.  
  3. // BUG: Personagem 'Kevin' está banido. Então, 'Kevin' também estará.
  4. // Ele verifica se a string vNick está contida no arquivo Ban.dat ou seja, nicknames com iniciais iguais ban iguais.
  5. // ATENÇAO: O ARQUIVO "Ban.dat" NÃO PODE FICAR EM BRANCO.
  6. // Para usar: VerificarBan(clientid);
  7. // Necessário ter o arquivo "Ban.dat" dentro da pasta TMSRV/run.
  8. int VerificarBan(int clientid)
  9. {
  10. FILE *stream;
  11. /*char Nick[12];
  12. ifstream iFile("Ban.dat" );
  13. while ( iFile && !iFile.eof() ) {
  14. iFile >> Nick;
  15. cout << Nick;
  16. char *pch = strstr (vNick, Nick);
  17. ERA APENAS TESTES ' */
  18. stream = fopen("Ban.dat", "r");
  19. char line[80];
  20. while ((fscanf(stream, "%[^\n]", line)) != EOF)
  21. {
  22. fgetc(stream);
  23. char Ban[80];
  24. sscanf(line, "%s", &Ban);
  25. char *pch = strstr(vNick,Ban);
  26. if(vNick == pch)
  27. {
  28. printf("Usuario %s tentou logar!\n", vNick);
  29. SendClientMsg(clientid, "Este personagem está bloqueado. Contate a administração!");
  30. // Shepher & The Rev'
  31. DC(clientid);
  32. fclose(stream);
  33. return 1;
  34. }
  35. }
  36. fclose(stream);
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment