ULX

Author Topic: [Fun] SetSpeed - Set individual player's running speed!  (Read 4651 times)

0 Members and 1 Guest are viewing this topic.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
[Fun] SetSpeed - Set individual player's running speed!
« on: July 11, 2014, 04:50:29 AM »
Hey guys,

This is just a small ulx module that I hacked together for use on my own server. I don't actually know how to give you guys an easy way to put it on your server. I just added at the end of fun.lua, because I'm a rebel (seriously guys how do I do this? this seems really hackey.)

Anyways just copy and paste it to the end of your fun.lua or someone can explain to me how ulx modules should be added on.

Code: [Select]
------------------------------ 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)." )
« Last Edit: July 11, 2014, 04:52:52 AM by roastchicken »
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Fanney

  • Newbie
  • *
  • Posts: 44
  • Karma: 11
Re: [Fun] SetSpeed - Set individual player's running speed!
« Reply #1 on: July 11, 2014, 10:27:56 AM »
I just added at the end of fun.lua, because I'm a rebel (seriously guys how do I do this? this seems really hackey.)
Just create an own addon folder in addons and add the lua file in <youraddon>/lua/ulx/modules/sh/name.lua.

And then you can just insert it there and have it loaded by ULX.


B2T:
It's a lil simple thing, how about multiple commands regarding fun?