Ulysses
General => Developers Corner => Topic started by: ATomIC on July 24, 2014, 02:30:55 PM
-
Could someone help me figure out how to add a cooldown to commands such as ULX ASAY, ULX PSAY, and provide just a snippet of code so I could figure out how to do it? I hate trolls coming into the server spamming "N*GGER" into ASAY.
-
ULX's anti-spam stuff code are a good place to start looking -
https://github.com/Nayruden/Ulysses/blob/master/ulx/lua/ulx/modules/sh/chat.lua#L258 (https://github.com/Nayruden/Ulysses/blob/master/ulx/lua/ulx/modules/sh/chat.lua#L258)
You could then use that idea within a "ULibCommandCalled (http://ulyssesmod.net/docs/files/lua/ulib/shared/defines-lua.html#ULibCommandCalled)" hook to start the timer, make sure it's passed, adn return if it's passed, return false if time hasn't passed.
And, perhaps better yet, this might be a good topic for "Suggestion" forum area.
Though we already perform chat spam checks for the Gmod PlayerSay hook, as our asay/csay/other functions that communicate with players are custom, they don't use the playersay hook.
-
Better yet, remove the ASAY permission from "user" group.
Seems bad idea to allow users to grafitti the admin wall.
-
Better yet, remove the ASAY permission from "user" group.
Seems bad idea to allow users to grafitti the admin wall.
What if a user needs to contact an Admin?
-
PlayerChat: Is there an admin online?
Or, if offline:
http://forums.ulyssesmod.net/index.php/topic,7391.0.html (http://forums.ulyssesmod.net/index.php/topic,7391.0.html)
http://forums.ulyssesmod.net/index.php/topic,7394.0.html (http://forums.ulyssesmod.net/index.php/topic,7394.0.html) - bit more complicated - requires your own web/php server.