Advertisement
tyler569

Untitled

Jun 15th, 2012
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. #replaces bad words in player chat with cheese and noties them they have been censored
  2. bind(player_chat,null,null,@chatevent,
  3. assign(@player,@chatevent['player'])
  4. assign(@msg,to_lower(@chatevent['message']))
  5. assign(@bw,array('fuck','cunt','nigger','nigga','bitch','ass','whore'))
  6. assign(@flag,0)
  7. for(assign(@i,0),lte(@i,6),inc(@i),
  8. assign(@newmsg,replace(@msg,@bw[@i],'cheese'))
  9. if(not(equals(@msg,@newmsg)),
  10. assign(@flag,1)
  11. )
  12. assign(@msg,@newmsg)
  13. )
  14. if(equals(@flag,1),
  15. modify_event('message', @msg)
  16. msg(concat(color(c),'Your chat has been censored'))
  17. console('chat censored for'@player)
  18. )
  19. )
  20.  
  21. #censores signs with bad words - erases text and notifies placer
  22. bind(sign_changed,null,null,@signevent,
  23. assign(@text,to_lower(@signevent['text']))
  24. assign(@bw,array('fuck','cunt','nigger','nigga','bitch','ass','whore'))
  25. assign(@flag,0)
  26. for(assign(@i,0),lte(@i,6),inc(@i),
  27. assign(@newmsg,replace(@text,@bw[@i],'cheese'))
  28. if(not(equals(@text,@newmsg)),
  29. msg(concat(color(c),'Your sign has been censored'))
  30. console('sign censored for'@player)
  31. cancel()
  32. )
  33. assign(@text,@newmsg)
  34. )
  35. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement