Alternative112

Untitled

Jul 15th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. Public:loadBadWords() {
  2. new File:file = fopen(BAD_WORDS_FILE, io_read);
  3. new i, string[30];
  4. if (file) {
  5. while(fread(file, string)) {
  6. if (strlen(string) > 0) {
  7. printf("Before cutting, string is '%s'", string);
  8.  
  9. if (sscanf(string, "s[20]", badWords[i])) {
  10. printf("Could not get a word from '%s'", string);
  11. }
  12. else {
  13. printf("Bad word loaded: %s", badWords[i]);
  14. }
  15. }
  16. else {
  17. printf("Could not load bad word '%s'", string);
  18. }
  19. i++;
  20. }
  21. }
  22. else {
  23. file = fopen(BAD_WORDS_FILE, io_write);
  24. fclose(file);
  25. print("0Admin: badWords file does not exist - creating.");
  26. loadBadWords();
  27. }
  28. return 1;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment