Ulysses
General => Developers Corner => Topic started by: Jonas Præstegaard on September 09, 2015, 09:45:55 PM
-
Is there any way to check if a specific player has been muted, gimped, gagged, frozen etc.?
-
Looks like it uses NWBool for each, so you can just use ply:GetNWBool("ulx_gagged", false) to check them. Change the "gagged" part to check each one obviously. That works for all the communication ones, but I'm not 100% sure on the frozen one.
-
<player object>:IsFrozen()
There are other ways to check the mute status too. variables when on server side that might be quicker lookup.
(I didn't look close enough to tell if they were local or global though, so nwbool is more likely)
-
There must be some way of checking this. Also: the <object>:IsFrozen() doesn't work with ULX's freeze for some reason.
Any other input?
-
Jonas, Yes, there is some way, Aaron's answer for the mute, gagged and gimped would be correct and safest way to determine.
If it's not working for you, you'd really need to show us a code example of how you're checking.
I'm also unsure why freeze isn't working for you, it's what we use in our own code.
-
Thanks for the help lads. The NWBool worked perfectly.
I did encounter another strange problem though. I hope you might be able to help:
Code (clientside):
if tar:GetNWBool("ulx_gagged", true) then
print("Player was gagged!")
RunConsoleCommand("ULX","ungag",tar:Name())
else
print("Player was NOT gagged!")
RunConsoleCommand("ULX","gag",tar:Name())
end
Console output (after 3 tries - starting ungagged):
Player was NOT gagged!
ServerLog: [ULX] Fillipuster :D gagged Bot03
You gagged Bot03
Player was gagged!
ServerLog: [ULX] Fillipuster :D gagged Bot03
You gagged Bot03
Player was gagged!
ServerLog: [ULX] Fillipuster :D gagged Bot03
You gagged Bot03
For some reason it always gags the player, never ungags (even though the check returns gagged as true)...
Any help is appreciated :D
-
ULX does not seem to execute the opposite when you write the "ULX" in capitals. That might be a bug... or maybe we're not supposed to scream ULX in our consoles. D:
] ULX gag "Timmy"
You gagged Yourself
] ULX ungag "Timmy"
You gagged Yourself
] ulx ungag "Timmy"
You ungagged Yourself
Your script will work if you make the "ULX" in RunConsoleCommand lower-case.
-
Well.. Hmm. That is an interesting bug- Nice find! I've got it fixed up here. (https://github.com/Nayruden/Ulysses/commit/414bfc7fa6769e095bf788ca5685dbd1736b7156) :)
-
I'm a little rusty right now with lua, but need some more details for :IsFrozen(). When you say it doesn't work, do you mean it literally doesn't work, nothing works, it gives you an error, or your code specifically doesn't work with it? IsFrozen is a boolean (if that is how you spell it, I forgot now). So it should be telling you true or false..
-
@Everyone: Thanks a bunch! Strange bug indeed...
@Bit That Apple: I checked through my code and found that I did the check wrong. Obj:IsFrozen() does work with ULX's freeze.
Amazing support!
-
Welcome. Glad you got it sorted out.