Guthen / guthlevelsystem

Garry's Mod Level System
Apache License 2.0
12 stars 0 forks source link
addon garrysmod glua guthen level system

guthlevelsystem

Features

Installation

Custom HUDs

For now, there are 2 default HUDs that you can choose to use (or not) :

default_progress default_progress default_text default_text

Custom HUDs are located in lua/guthlevelsystem/hud and you can choose one by specifying the configuration variable guthlevelsystem.settings.hud.selected in sh_config.lua

ULX & SAM & xAdmin2 compatibility

ULX, SAM & xAdmin2 have common commands implemented for managing levels and XPs of players, such as :

DarkRP job compatibility

Level

Adding a level constraint to a DarkRP job is quite simple, you have to add a variable level = X, (or LSlvl = x; default to 0) to it and to replace X by the level wanted. See example below

Example, TEAM_RANDOM is accessible at least at level 5 :

TEAM_RANDOM = DarkRP.createJob("Random", {
    color = Color(226, 47, 255, 255),
    model = {"models/player/eli.mdl"},
    description = [[waw]],
    weapons = {},
    command = "random",
    max = 1,
    salary = 0,
    admin = 0,
    vote = false,
    hasLicense = false,
    candemote = false,
    LSlvl = 5, --  here is my required level to be able to choose the job
    level = 5, --  or, I can write it like that!
})

Prestige

Adding a prestige condition is similar to the level, you have to add an other variable prestige = Y, (default to 0) to the job, again, replace Y by the prestige wanted. See example below

Example, TEAM_VIP is accessible at least at level 5 of the 2nd prestige :

TEAM_VIP = DarkRP.createJob("VIP", {
    color = Color(226, 47, 255, 255),
    model = {"models/player/gman.mdl"},
    description = [[wuw]],
    weapons = {},
    command = "vip",
    max = 1,
    salary = 0,
    admin = 0,
    vote = false,
    hasLicense = false,
    candemote = false,
    LSlvl = 5, --  here is my required level to be able to choose the job
    level = 5, --  or, I can write it like that!
    prestige = 2, --  and here's my prestige minimum!
})

Level Priority over Prestige

If you don't want to make a job only available from a level X from any prestige Y, add the variable has_level_priority = true, (default to false) to your job.

For instance, a job set to level 20 and prestige 2:

SQL Drivers

If you just want a basic saving system (default: SQLite), just ignore that part.

This level system is compatible with Gabyfle/gSQL library, which means that you can easily use a different SQL driver such as MySQLOO or tMySQL4 by downloading and installing theses systems on your server.

As said before, you have to install Gabyfle/gSQL and the SQL driver of your choice. Once it's done, configure the database file (at the top) of my system located at lua/guthlevelsystem/sv_data.lua (it's not located at sh_config.lua for security reasons).

Console Commands

For developpers

/!\ The API changed in the version 2.0.0, if you use my addon somehow, please check for incompatibilities & errors in your mod

Hooks

Since the version 1.3.0, customs hooks have been added:

Server

Shared

Contact

Feel free to propose update, functionnalities or report bugs and exploits on the issues page my Discord.