Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Shepher & The Rev'
- // BUG: Personagem 'Kevin' está banido. Então, 'Kevin' também estará.
- // Ele verifica se a string vNick está contida no arquivo Ban.dat ou seja, nicknames com iniciais iguais ban iguais.
- // ATENÇAO: O ARQUIVO "Ban.dat" NÃO PODE FICAR EM BRANCO.
- // Para usar: VerificarBan(clientid);
- // Necessário ter o arquivo "Ban.dat" dentro da pasta TMSRV/run.
- int VerificarBan(int clientid)
- {
- FILE *stream;
- /*char Nick[12];
- ifstream iFile("Ban.dat" );
- while ( iFile && !iFile.eof() ) {
- iFile >> Nick;
- cout << Nick;
- char *pch = strstr (vNick, Nick);
- ERA APENAS TESTES ' */
- stream = fopen("Ban.dat", "r");
- char line[80];
- while ((fscanf(stream, "%[^\n]", line)) != EOF)
- {
- fgetc(stream);
- char Ban[80];
- sscanf(line, "%s", &Ban);
- char *pch = strstr(vNick,Ban);
- if(vNick == pch)
- {
- printf("Usuario %s tentou logar!\n", vNick);
- SendClientMsg(clientid, "Este personagem está bloqueado. Contate a administração!");
- // Shepher & The Rev'
- DC(clientid);
- fclose(stream);
- return 1;
- }
- }
- fclose(stream);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment