Ulysses
General => Developers Corner => Topic started by: AustinFox123 on January 29, 2014, 05:20:39 PM
-
So I have this code for !warn but i can't seem to get it working! No errors are being created but the code doesn't work! Please help!
local CATEGORY_NAME = "Custom"
my_warn_reasons = { "Spamming", "Rude", "Language", "Arguing with Staff", "Prop Killing" }
function ulx.warn( calling_ply, target_plys, Reason )
return true
end
local warn = ulx.command( CATEGORY_NAME, "ulx warn", ulx.warn, "!warn" )
warn:addParam{ type=ULib.cmds.PlayerArg }
warn:addParam{ type=ULib.cmds.StringArg, hint="reason", completes=my_warn_reasons, ULib.cmds.takeRestOfLine }
warn:defaultAccess( ULib.ACCESS_ADMIN )
warn:help( "Warn a player." )
warn:logString( "#1s warned #2s for #3s" )
-
Where did you put this code?
-
addons/ulx/lua/ulx/modules/sh/warn.lua
-
Better question.. what do you expect this to do?
The only thing this command is doing is returning true, which doesn't DO anything.
-
Well, i want the command to add a "strike" to a user so basically when they get 3 strikes (warns) then get kicked.
So the command would be like !warn David Propkill
and then it would say something like David Has 1 Warning For Reason: Propkill
-
Check out my Warning module. It does exactly that.
http://forums.ulyssesmod.net/index.php/topic,5958.0.html (http://forums.ulyssesmod.net/index.php/topic,5958.0.html)
-
Thanks, just what i was looking for. ;D