ULX

Author Topic: Group Buffs  (Read 4048 times)

0 Members and 1 Guest are viewing this topic.

Offline Cocoufo [NexusGaming]

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Group Buffs
« on: May 21, 2016, 01:55:29 AM »
Group Buffs

This plug-in allows you to edit/change the run speed and health of ULX groups for servers that do not have access to UTeam


How to install:
Download the file and go into garrysmod\lua\autorun\ and place the file there.

Once installed you will have to edit the file to add your server ulx groups with the speed and health you want them to have

Note: Some gamemodes may override the health and speed settings (Deathrun is one of them...) to remove the override you will have to edit the gamemode files and remove the overrides (Lines of code to look for:ply:SetHealth(ply:GetMaxHealth()) and ply:SetRunSpeed(300)) Do this at your own risk until I find a way to make my lua file override the gamemode settings.

Updates:
  • Sorted out overrides so it should work with most gamemodes now
  • Added support for setting health and speed to SteamIDs



« Last Edit: May 22, 2016, 06:28:53 AM by Cocoufo [NexusGaming] »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Group Buffs
« Reply #1 on: May 21, 2016, 06:03:14 AM »
Thanks for sharing a nice little release.

In review of the code, one step you didn't mention was that, if using a custom group name that isn't superadmin, admin, or user, the person who uses this will have to open the file manually (in notepad or other text editor) and verify the groups table has, and if not, edit manually, the groups they use and adjust the speed/healths if wanted.

There is no console command to modify real-time. (That would be a great addition)

Additionally, this has no reliance whatsoever on ULib or ULX.
It's 100% Gmod lua. (Which is fine, but the name you gave the release made me think it was going to have ulx console commands to change speed/health during server run)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Cocoufo [NexusGaming]

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Group Buffs
« Reply #2 on: May 21, 2016, 09:04:14 AM »
Thanks for the feedback :D

I'd love to take on your suggestions not only as a challenge but as something that could benefit others. For now I'll edit the name and descripton so others know that there is no real-time commands to modify the speed/etc.


Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Group Buffs
« Reply #3 on: May 21, 2016, 09:56:22 AM »
Addons are always loaded after gamemodes. Your overrides should work.

What's probably happening is the gamemode is setting these things when the player spawns and that is being called after your addon loads. You'll need to find a way to call your functions after any gamemode hooks take place to override them without removing from the gamemode.