General > Developers Corner
Help Adding !warn command
AustinFox123:
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" )
Neku:
Where did you put this code?
AustinFox123:
addons/ulx/lua/ulx/modules/sh/warn.lua
MrPresident:
Better question.. what do you expect this to do?
The only thing this command is doing is returning true, which doesn't DO anything.
AustinFox123:
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
Navigation
[0] Message Index
[#] Next page
Go to full version