Advertisement
tyler569

muteall - untested

Jun 4th, 2012
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. admin:/muteall [$onoff = 'null'] = >>>
  2. assign(@onoff,$onoff)
  3. if(not(is_boolean(@onoff)),
  4. msg(concat(color(c),'The correct format is:')) #Format would need better
  5. die(concat(color(9),'/muteall [true or false]'))
  6. )
  7. assign(@playerlist,all_players())
  8. assign(@playerson,subtract(array_size(@playerlist),1))
  9. for(assign(@l,0),lte(@l,@playerson),inc(@l),
  10. assign(@mute,array_get(@playerlist,@l))
  11. assign(@ranks,pgroup(@mute))
  12. if(nor(array_contains(@ranks,'admin'),array_contains(@ranks,'mod')),
  13. runas(~op,concat('/mute ',@mute))
  14. )
  15. )
  16. if(@onoff,
  17. store_value('all_muted',true),
  18. store_value('all_muted',false)
  19. )
  20. <<<
  21.  
  22.  
  23.  
  24. #IN main.ms player_join event
  25. if(get_value(all_muted),
  26. runas(~op,concat('/mute ',@player)) #@player is player joining
  27. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement