Guest User

Untitled

a guest
Dec 30th, 2019
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. Occorrente:
  2. game.py
  3. uiwhisper.py
  4.  
  5. Aprite il file uiwhisper.py e cercate la stringa
  6.  
  7. PHP:
  8. def OpenWithTarget(self, targetName)
  9. Sotto noterete
  10.  
  11. PHP:
  12. self.ignoreButton.Hide()
  13. bene, sostituitelo con:
  14.  
  15. PHP:
  16. pnblock = open("blacklist.txt", "r")
  17. pnauslese = pnblock.read()
  18. pnblock.close()
  19. if pnauslese.find(targetName) !=-1:
  20. self.ignoreButton.Hide()
  21. else:
  22. self.ignoreButton.Show()
  23. Poi sotto cercate:
  24. PHP:
  25. def OpenWithoutTarget(self, event)
  26. e troverete:
  27. PHP:
  28. self.ignoreButton.Hide()
  29. Sostituite Hide() con Show()
  30.  
  31. Ora cercate:
  32. PHP:
  33. def IgnoreTarget(self)
  34. e troverete questo:
  35.  
  36. PHP:
  37. def IgnoreTarget(self):
  38. net.SendChatPacket("/ignore " + self.targetName)
  39. Sostituite il tutto cosi:
  40. PHP:
  41. ignoredplayer = self.targetName + "\n"
  42. out_file = open("blacklist.txt", "a")
  43. out_file.write(ignoredplayer)
  44. out_file.close()
  45. chat.AppendChat(chat.CHAT_TYPE_INFO, "L' utente " + self.targetName + " è stato bloccato e non può più inviarti pm.")
  46. chat.AppendChat(chat.CHAT_TYPE_INFO, "Per sbloccarlo rimuovi il suo nome blacklist.txt nella cartella del client.")
  47. self.ignoreButton.Hide()
  48. Con li file uiwhisper.py abbiamo finito.
  49.  
  50. Ora aprite il file game.py e cercate:
  51.  
  52. PHP:
  53. def OnRecvWhisper(self, mode, name, line)
  54. Modificate tutta la funzione con questo:
  55.  
  56. PHP:
  57. def OnRecvWhisper(self, mode, name, line)
  58. pnblock = open("blacklist.txt", "r")
  59. pnauslese = pnblock.read()
  60. pnblock.close()
  61. if pnauslese.find(name) !=-1 and pname[0] != "[":
  62. if name.find("[") !=-1:
  63. chat.AppendWhisper(mode, name, line)
  64. self.interface.RecvWhisper(name)
  65. else:
  66. chat.AppendChat(chat.CHAT_TYPE_INFO, "Il giocatore bloccato " + name + " ha cercato di contattarti")
  67. net.SendWhisperPacket(name, "Sei stato bloccato.")
  68. if mode == chat.WHISPER_TYPE_GM:
  69. self.interface.RegisterGameMasterName(name)
  70. chat.AppendWhisper(mode, name, line)
  71. Finito.
  72. Ora create un file chiamato blacklist.txt nella directory principale del client ed avrete terminato...
Advertisement
Add Comment
Please, Sign In to add comment