Author Topic: Help me. I needed a function for checking mut?  (Read 77 times)

0 Members and 1 Guest are viewing this topic.

Offline Aimatt

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Help me. I needed a function for checking mut?
« on: October 04, 2019, 03:14:45 AM »
Hello! Here I decided to make a short admin menu made functions, but I need to make a button with mute and gag at the same position, for this I need to do:
if <the check function> then
     mute
else
     unmute
end
In the likeness of this.

Online Timmy

  • Ulysses Team Member
  • Full Member
  • *****
  • Posts: 220
  • Karma: 161
  • Code monkey
    • ULX Unofficial Documentation
Re: Help me. I needed a function for checking mut?
« Reply #1 on: October 04, 2019, 05:47:32 AM »
Assuming you use ULX to perform the muting/gagging.

ULX sets a networked boolean (NWBool) when a player is muted or gagged. You can use this to test if the restriction is active.

Code: Lua
  1. if ply:GetNWBool("ulx_muted") then
  2.   -- ply is muted
  3. else
  4.   -- ply not muted
  5. end

Code: Lua
  1. if ply:GetNWBool("ulx_gagged") then
  2.   -- ply is gagged
  3. else
  4.   -- ply not gagged
  5. end
“When given the choice between being right or being kind, choose kind.”  —Dr. Wayne Dyer