As we use ULX in our server, I'd like to implement some of the darkRP commands to ULX too, instead of having to go into console and doing it that way (we use a different scoreboard than FAdmin).
The first thing I want to do is implement the setmoney command, as it's a basic command that I, personally, am in need of.
The command "works", however rp_setmoney returns the message "
Invalid Argument", and I can't really see why -- and this is my first time "
making a ulx command".
local CATEGORY_NAME = "DarkRP"
---------------------------- Set money -----------------------------------
function ulx.setmoney( calling_ply, target_ply, amount)
--calling_ply:ConCommand( "rp_setmoney " .. tostring(target_ply) .. " " .. tostring(amount) ) -- First I tried ConCommand, and it didn't work.
calling_ply:RunConsoleCommand( "rp_setmoney", tostring(target_ply), tostring(amount)) -- Tried this too, also didn't work
ulx.fancyLogAdmin( calling_ply, "#A set the money of #T to #i.", target_ply, amount )
end
local setmoney = ulx.command( CATEGORY_NAME, "ulx setmoney", ulx.setmoney, "!setmoney" )
setmoney:addParam{ type=ULib.cmds.PlayerArg }
setmoney:addParam{ type=ULib.cmds.NumArg, min=0, max=10000, default=10000, hint="money", ULib.cmds.optional }
setmoney:defaultAccess( ULib.ACCESS_ADMIN )
setmoney:help( "Sets money for the specified person." )
I think it's probably related to addParam, as I haven't fully understood that myself :&
If I've posted in the wrong section or anything, please excuse me.