Hello to whomever may be reading this and thank you,
I can't seem to figure out how to set up custom ulx commands.
I'm working on an XP/Credit shop system with levelling and perks and so on, and I want to be able to set, add, remove and do other things with credits, xp and levels by using ULX considering I thought it would be easier than making my own arguments in a chat command.
The code below is all I have so far for the ULX stuff, i've simply put it on the bottom of the serverside script I have running, could someone please share some advice? I understand it's documented, but I can barely find a decent documentation for someone brand new to the idea of Ulib and ULX.
local CATEGORY_NAME = "Combine F3"
function ulx.setxp( calling_ply, target_ply, xp )
local oldxp = target_ply:GetPData("XP", 0)
local newxp = oldxp + xp
target_ply:SetPData("XP", newxp)
ulx.fancyLogAdmin( calling_ply, "#A set #T's xp to #i", target_ply, xp )
end
local setxp = ulx.command( CATEGORY_NAME, "ulx setxp", ulx.setxp, "!setxp" )
setxp:addParam{ type=ULib.cmds.PlayersArg }
setxp:addParam{ type=ULib.cmds.NumArg, min=0, default=0, hint="xp", ULib.cmds.round }
setxp:defaultAccess( ULib.ACCESS_ADMIN )
setxp:help( "Sets target's XP to given amount." )