Hey guys,
I am the "developer" for a new server. You can't really call me a developer. I google crap until I figure it out, and the server owner acts like I'm a god because he has no idea how to internet, let alone anything to do with technical stuff.
Anyways, he saw on another server they had a ULX mod that allowed you to set players walk and run speeds. There was a selection menu similar to the psay menu, and then there were to sliders, similar to the sliders for changing gravity.
There was a mod that did something like this called SuperPowers, but that was in 2010 and the download link is long gone. So I was wondering if anyone could give me some guidance as to how to make a mod of ULX. I know the very very basics such as functions and hooks, but I'm not really sure how to do the sliders and selection menus or really how to integrate it with ULX. I read the ULib docs, but that doesn't seem to help with ULX.
Okay, so I've looked around in my server files, and I think I've found the place where the "modules" are declared. addons/ulx/lua/ulx/modules is pretty intuitive. It seems that hp is the simplest example of what I want to do, just have you choose a player and set a variable. The problem I have is I can't seem to find the graphical side. I have looked in xgui and those modules, but I can't find a place where hp sets up it's client side.
Still haven't found the graphical stuff, but I'm just going to assume it is un-needed for now, as I just pretty much copy-pasted the hp code and changed it to work for Player.SetRunSpeed. No idea if this will majorly screw up the server, but I'm going to put it at the bottom of fun.lua and try it anyways.
------------------------------ Speed ------------------------------
function ulx.runspeed( calling_ply, target_plys, amount )
for i=1, #target_plys do
target_plys[ i ]:SetRunSpeed( amount )
end
ulx.fancyLogAdmin( calling_ply, "#A set the running speed for #T to #i", target_plys, amount )
end
local runspeed = ulx.command( CATEGORY_NAME, "ulx runspeed", ulx.runspeed, "!runspeed" )
runspeed:addParam{ type=ULib.cmds.PlayersArg }
runspeed:addParam{ type=ULib.cmds.NumArg, min=250, max=2000, hint="runspeed", ULib.cmds.round }
runspeed:defaultAccess( ULib.ACCESS_ADMIN )
run speed:help( "Sets the running speed for target(s)." )
Thanks,
roastchicken