Vloms - Leveling & Perks

I went ahead and made a leveling addon (which I’ve tried to make modular, at least partially).
Why? Because, surprisingly, there’s hardly any free ones out there.

What it is

This is more or less a remake of my old ExP Mod addon. It was rebuilt from scratch, hopefully this makes it less mess code-wise.
Old addon can be found here, in case you’re interested.

Basically, this allows you to gain experience and level up.
Leveling up unlocks perks that give you benefits, such as more health when you spawn.

It’s relatively easy to configure and you can add your own modules to it, which work like tiny addons.
You can also add your own perks rather easily.

I’ve also included a ulx module so you can give XP and levels, take them away, view a player’s level, etc.

Features

-Leveling system (Possible to change required XP formula)
-Custom XP rates for different usergroups (Give VIPs faster XP!)
-Dynamic perks system (Examples included)
-Dynamic modules system (Examples included)
-Easy to configure (Change XP rate, etc)
-HUD with 2 choices (Or add your own via a module)
-Perks menu (Clientside)
-Basic logging system (Can be disabled)
-ULX Integration (Admin commands)

Media

The HUD. There’s 2 default HUD’s available (0 and 1, anything else hides the HUD), one being a bit smaller and on the bottom so it doesn’t get in the way as much.
The client can change this with a consolecommand:


vloms_hudtype 0/1

http://i.imgur.com/ik9W0SI.jpg[/thumb]

A perks menu. Forgive me for my shitty UI, design isn’t my strongest side :v:.
The images (locked / unlocked) can be changed, just override the png files.

[thumb]http://i.imgur.com/mgwRjp0.jpg[/thumb]

The ULX module. Regular players only have ‘viewlevel’, which’ll print a player’s level to their chat.

[thumb]http://i.imgur.com/dSOvF2A.jpg

Download:

Full source code available on Github, includes info:

Or on the Steam workshop:

https://garrysmods.org/download/14040/button.png

Suggestions, tips, anything like that are more than welcome!

This is a nice addition to the community, many people would have sold it on ScriptFodder or elsewhere.

That is exactly why I didn’t. I think everyone should be able to enjoy these things.

I hope i don’t sound stupid but is it possible make it so you spend pointshop points when leveling up/purchasing a perk?

You don’t have to buy perks, they’re unlocked automatically.

Although I don’t recommend it (after all, you can’t control when you level up), you should be able to take pointshop points for leveling up.
You’ll want to put this in the VPlayerLevelUp hook.


ply:PS_TakePoints(10)

I like things being free, but at the same time scriptfodder allows coders to actually make something out of coding. I am the type that would rather pay for a good script then download a free one with limited support or features (Not saying yours is just generally). A wise man once said, you get what you pay for.

I’ve found the time to do a small update, adding the ability to give certain usergroups a higher XP rate.
You can either do this only for XP they’re given by the automatic XP timer or for all XP (meaning if you give them XP through ULX, that’ll also get increased).



Vloms.GroupAutoXP = true --Enable bonus XP rate ONLY from the auto-XP timer (see above)
Vloms.GroupAllXP = false --Determines if XP bonuses are always given (including autoxp)
Vloms.GroupXPRates = {
	{'owner', 2.5},
	{'superadmin', 2},
	{'admin', 1.5},
	{'moderator', 1.4},
	{'operator', 1.3},
	{'vip', 1.5},
	{'trusted', 1.1}
}


This should work with all admin mods since it checks UserGroup against the values in the table.

snip