Ulysses Stuff > Ulysses Release Archives

SuperPowers - Set run speed and jump power of players. Update! (v1.1, SVN only)

<< < (2/5) > >>

JamminR:
Just looked over the SVN version code and have a programmer's tip.
Returning true, or actually using return at all for these specific functions, isn't necessary.
:)

stanlee:
RynO, could you make this set the values of jump/speed for certain usergroups?
This would really be useful for the premium members of my roleplay server.
I could just set the group "Premium" to a higher jump/speed.
You get what I mean  8)

Anyways, this is a great addon!

RynO-SauruS:
Thanks for the compliment. I think UTeam has the ability to set the run speed based on usergroup, but I don't know if it can set the jump power..
Changing SuperPowers to set them based on usergroups might require code for reading settings from a text table like UTeam does with UTeam.txt, which I've never done before.
I might look into it.

stanlee:

--- Quote from: RynO-SauruS on February 20, 2010, 07:12:10 PM ---Thanks for the compliment. I think UTeam has the ability to set the run speed based on usergroup, but I don't know if it can set the jump power..
Changing SuperPowers to set them based on usergroups might require code for reading settings from a text table like UTeam does with UTeam.txt, which I've never done before.
I might look into it.

--- End quote ---

Do it do it!!
:D

RynO-SauruS:
Ok, about the 'auto-set runspeed/jumppower by usergroup' thing. I've actually written a working one of the SVN version, it creates CVARs for every group like this (it will create them for custom groups, too.  ;)):

ulx_runspeed_superadmin
ulx_runspeed_admin
ulx_runspeed_user
ulx_runspeed_operator

ulx_jumppower_superadmin
ulx_jumppower_admin
ulx_jumppower_user
ulx_jumppower_operator

And if you set these greater than zero, and a player belongs to the right usergroup, it will set their runspeed or jumppower accordingly, on their FIRST spawn.
If you change these during gameplay, the player will have to reconnect or change it manually via !runspeed or !jumppower.
I made it like this so if a person wants to have a different runspeed or jumppower than the default for their group, they can use the regular command to
change it manually, and it won't reset when they die. The problem is, I need the function Player:GetUserGroup() for this to work,
and only the SVN version has this function! (it doesn't come with gmod either)
The way this works is, I hook into PlayerInitialSpawn and retrieve what's stored in the CVAR for whatever usergroup they're in.
To make a version of this for non-SVN, I need some other method of doing this without Player:GetUserGroup().. *looks at JamminR and Megiddo*
I guess I'll go ahead and upload the one I made for SVN ULX/ULib..

Oh, by the way JamminR, thanks for the developers tip, I removed 'return true'.  ;)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version