uen / leveling-system Goto Github PK
View Code? Open in Web Editor NEWLeveling system in gLua (For DarkRP)
License: Other
Leveling system in gLua (For DarkRP)
License: Other
gamemodes/darkrp/gamemode/libraries/mysqlite/mysqlite.lua:264: Lost connection t o MySQL server during query (SELECT level,xp FROM darkrp_levels WHERE uid =
"4005534345";)
It always writes and does not use data recorded in mysql, linux debian 7. Used the latest darkrp
Currently I am trying to make a custom check to see if the player is a certain level, and if they are they can use that entity (not spawn it, interact with it)
I've tried it with ply:hasLevel ply:getLevel Level = , (With different capitalization)
Doesnt work with that, the entity with that, doesnt show up.
I am doing it with
if (custom check for level/plain level) then
(entity)
end
i seem to be getting these errors and would like and exsplanation on how to fix please :(
http://gyazo.com/6ecd13ab20e2d69464047a89e33a9f51
I used the workshop version and got this error
[ERROR] A runtime error has occurred in "lua/darkrp_modules/levels/sv_data.lua" on line 28.
The best help I can give you is this:
Warning! DarkRPVar 'xp' wasn't registered!
Please contact the author of the DarkRP Addon to fix this.
Until this is fixed you don't need to worry about anything. Everything will keep working.
It's just that registering DarkRPVars would make DarkRP faster.
Hints:
- No hints, sorry.
The responsibility for this error lies with (the authors of) one (or more) of these files:
1. lua/darkrp_modules/levels/sv_data.lua on line 28
2. lua/darkrp_modules/levels/sv_data.lua on line 14
3. gamemodes/darkrp/gamemode/libraries/mysqlite/mysqlite.lua on line 300
4. lua/darkrp_modules/levels/sv_data.lua on line 14
5. lua/darkrp_modules/levels/sv_data.lua on line 23
6. lua/darkrp_modules/levels/sh_core.lua on line 200
7. addons/ulib/lua/ulib/shared/hook.lua on line 179
------- End of Simplerr error -------
[ERROR] A runtime error has occurred in "lua/darkrp_modules/levels/sv_data.lua" on line 29.
The best help I can give you is this:
Warning! DarkRPVar 'level' wasn't registered!
Please contact the author of the DarkRP Addon to fix this.
Until this is fixed you don't need to worry about anything. Everything will keep working.
It's just that registering DarkRPVars would make DarkRP faster.
Hints:
- No hints, sorry.
The responsibility for this error lies with (the authors of) one (or more) of these files:
1. lua/darkrp_modules/levels/sv_data.lua on line 29
2. lua/darkrp_modules/levels/sv_data.lua on line 14
3. gamemodes/darkrp/gamemode/libraries/mysqlite/mysqlite.lua on line 300
4. lua/darkrp_modules/levels/sv_data.lua on line 14
5. lua/darkrp_modules/levels/sv_data.lua on line 23
6. lua/darkrp_modules/levels/sh_core.lua on line 200
7. addons/ulib/lua/ulib/shared/hook.lua on line 179
------- End of Simplerr error -------
I have your level system with your prestige. When I add books to the books.lua, It doesnt pop up. Many people are having problems with this. Help?
I have the lastest version. But for some reason I get these errors.
Couldn't include file 'config.lua' (File not found) (@addons/darkrpmodification/lua/darkrp_modules/levels/sh_custom.lua (line 42))
Couldn't include file 'books.lua' (File not found) (@addons/darkrpmodification/lua/darkrp_modules/levels/sh_custom.lua (line 48))
Couldn't include file 'printers.lua' (File not found) (@addons/darkrpmodification/lua/darkrp_modules/levels/sh_custom.lua (line 49))
the lua error is like this
There are 2 Lua problems!
Please check your console for more information!
[ERROR] A runtime error has occurred in "addons/levels/lua/darkrp_modules/levels/sv_data.lua" on line 28.
The best help I can give you is this:
Warning! DarkRPVar 'xp' wasn't registered!
Please contact the author of the DarkRP Addon to fix this.
Until this is fixed you don't need to worry about anything. Everything will keep working.
It's just that registering DarkRPVars would make DarkRP faster.
Hints:
- No hints, sorry.
The responsibility for this error lies with (the authors of) one (or more) of these files:
1. addons/levels/lua/darkrp_modules/levels/sv_data.lua on line 28
2. addons/levels/lua/darkrp_modules/levels/sv_data.lua on line 14
3. gamemodes/darkrp/gamemode/libraries/mysqlite/mysqlite.lua on line 291
4. addons/levels/lua/darkrp_modules/levels/sv_data.lua on line 14
5. addons/levels/lua/darkrp_modules/levels/sv_data.lua on line 23
6. addons/levels/lua/darkrp_modules/levels/sh_core.lua on line 200
7. addons/ulib/lua/ulib/shared/hook.lua on line 110
------- End of Simplerr error -------
[ERROR] A runtime error has occurred in "addons/levels/lua/darkrp_modules/levels/sv_data.lua" on line 29.
The best help I can give you is this:
Warning! DarkRPVar 'level' wasn't registered!
Please contact the author of the DarkRP Addon to fix this.
Until this is fixed you don't need to worry about anything. Everything will keep working.
It's just that registering DarkRPVars would make DarkRP faster.
Hints:
- No hints, sorry.
The responsibility for this error lies with (the authors of) one (or more) of these files:
1. addons/levels/lua/darkrp_modules/levels/sv_data.lua on line 29
2. addons/levels/lua/darkrp_modules/levels/sv_data.lua on line 14
3. gamemodes/darkrp/gamemode/libraries/mysqlite/mysqlite.lua on line 291
4. addons/levels/lua/darkrp_modules/levels/sv_data.lua on line 14
5. addons/levels/lua/darkrp_modules/levels/sv_data.lua on line 23
6. addons/levels/lua/darkrp_modules/levels/sh_core.lua on line 200
7. addons/ulib/lua/ulib/shared/hook.lua on line 110
------- End of Simplerr error -------
http://wiki.darkrp.com/index.php/Functions/darkrp/shared/registerdarkrpvar
Adding this will apparently speed up DarkRP and will stop the errors thrown in console for not registering the vars.
Hey ok i fixed the adjustment took time to read the config :) <3
But there is still this 1 tiny little problem. In the books.lua i remove the 2 lines that it tells me to remove for the xp books to be enabled and then i put the TEAM_SCHOLAR (name of the job) that is supposed to be selling xp books. And i restart the server and boom he doesnt sell xp books? But if i say change name to like TEAM_CITIZEN it will work for citizen. Here is a pastebin of the books.lua.
http://pastebin.com/0cu3vNcr
http://forum.darkrp.com/threads/darkrp-2-7-0.7547/
For the technical minded, this is the specific commit that breaks backwards compatibility:
FPtje/DarkRP@61fa0c2
Hello, I have a problem with your work, because of her terrible lags, lags occur because of the connection with mysql, the mysql load is very high, I checked on the script https://github.com/oubliette32/DBugR I niznayu what is the reason, but unfortunately, the whole process chews and play 6-10 hours is no longer possible, and the next day, eats half of the CPU hard if there is no lag. Can modify? Put it away I fell much load and no more problems. But your work is very good and I like it I wish I had.
When I made my custom books it didnt show up in game so i came on this website and saw it is disabled by default where would i enable it??
No error just printers wont add.
Hello Author,
When I was trying to create XP Books all i got was nothing but errors... I used the .lua file for the book as well but nothing showd up in the entities list. So i used the darkrp modification and thats where the error occurred so I just stopped. How does one setup XP Books?
So i cant get the xp books to work for my job called scholar.or any other job except citizen. i dont know why. And there is another issue. can you help me adjust my level hud? its to far down below the hud i am using and i want to adjust it perfectly. please help!
So I was trying to change the xp amounts for killing NPCs, could anyone help me? I went into sh_config and made the XP to 500, instead of 10, aaaand nothing changed
i removed the addon and the xp bar did'nt removed and f4 menu printer did'nt removed
sorry my english bad but i hope you understand me
Sometimes, a server of mine crashes and It seems like that the printers are number 1 source of it. Here's a picture that displays what the error(s) are.
http://i.imgur.com/WPpPPh3.png
Hi there,
I was wondering if there was a way to make the printers spawn money as an entity when used by the player, instead of adding it directly to your wallet.
Thanks in advance :)
I was trying to modify it so you get a set amount of EXP per human kill. I was editing in sv_addways.lua I tried to set the amount of EXP per kill to 1000, and make it so every level gets EXP if they make a kill.
My example.
When I go on my server, the addon works fine but the jobs change color (red or green) and say the level next to them. I wouldnt mind the level indication but the color really stands out and efects the game's quality.
Also, how can you set levels for certain people?
As the title states above when i edit the books.lua file and enter some books it doesnt show them in the entities tab. Do i have to put them in the entities.lua in darkrpmodifications/lua/customthings?
Is there a way to make the last 3 tiers of printers VIP only?
How would I go about that? had a snoop around couldn't find much apart from a lot of cussing whilst drawing the hud in the code :)
possible, add the amount of exp to Kill a player?
something like:
LevelSystemConfiguration.KillModule = False //Only module kill money
LevelSystemConfiguration.Friendly = true
LevelSystemConfiguration.TakeAwayMoneyAmount = 100
LevelSystemConfiguration.Expmodule = true //Only exp kill
LevelSystemConfiguration.Expammount = 150 //Amount of exp to kill.
I can't get rid of the printers from the entities menu in f4, how would I go about removing them?
Hi,
I know this question has been "answered" before, but the answer is of little use,
I've tried several different ways of restricting printers to certain ranks, but to no avail, I was wondering if you could help?
local Printer={}
Printer.Name = 'Ruby Printer'
Printer.Type = 'ruby'
Printer.XPPerPrint = 0
Printer.MoneyPerPrint = 250
Printer.Color = Color(185,0,0)
Printer.Model = 'models/props_lab/reciever01a.mdl'
Printer.Price = 12500
Printer.Level = 0
Printer.Prestige = 0
customCheck = function(ply) return table.HasValue({"vip_user", "vip_respected", "vip_moderator", "vip_senior_moderator", "vip_admin", "vip_sadmin", "vip_superadmin"}, ply:GetUserGroup() == "vip_user") end
customCheckFailMsg = "In order to use this printer, you must donate to become a VIP."
table.insert(Printers,Printer)
That custom check doesnt work... Can you tell me a WORKING way to do this?
Thanks
When I spawn any type of printer it crashes the server, it gives no lua error. I've been trying to fix it for a couple hours, but I can't find the issue.I'm using the most updated version of this module.
I would like the script to merge with the current pocket script I have, but it always see it switching to the default pocket. I preferably would just like to disable the pocket that comes with your script due to it semi deleting everyone's hard earned stuff
[ERROR] addons/ulx/lua/ulx/modules/sh/levels.lua:34: attempt to concatenate local 'calling_ply' (a userdata value)
I have searched my addon up and down and there is not a true/false thing to enable or disable the green and red job colour. Please help!
-snip-
I recently added the DarkRP-Leveling-System to my Gmod DarkRP server (Im paying) and I was wondering if you could help me with the Purple and Black XP Bar, at the top of the screen!
Here is the image: http://steamcommunity.com/sharedfiles/filedetails/?id=372990856
Please help me, if you can!
Everytime our server restarts, every players level is reset to 0 and an error also pops up into console.
[ERROR] gamemodes/darkrp/gamemode/modules/base/sh_entityvars.lua:80: attempt to index local 'DarkRPVar' (a nil value)
1. readNetDarkRPVar - gamemodes/darkrp/gamemode/modules/base/sh_entityvars.lua:80
2. func - gamemodes/darkrp/gamemode/modules/base/cl_entityvars.lua:37
3. unknown - lua/includes/modules/net.lua:32
And for some reason the XP books do not seem to appear in the F4 menu. This is our sh_custom.lua
// Love Manolis Vrondakis - @vrondakis - manolisvrondakis.com
// This is the configuration file, believe it or not.
// If you like this script, you can support me by buying my prestige system - http://coderhire.com/scripts/view/1082
// Or donating through Paypal: manolisvrondakis@gmail.com
// You may do what you want with this code, as long as you do not sell it and credit the original author (me)
LevelSystemConfiguration = {} // Leave this :)
local Printers = {} // This too
local XPBooks = {} // And this
TEAM_madscientist = DarkRP.createJob("Mad scientist", {
color = Color(238, 118, 176, 255),
model = {"models/player/aphaztech.mdl"},
description = [[Lvl 1 Needed. You are the only person that sells xp books.]],
weapons = {"weapon_empty_hands", "weapon_fists"},
command = "madscientist",
max = 6,
salary = 800,
admin = 0,
vote = false,
hasLicense = false,
level = 1
})
// Okay so, clientside settings first, such as the HUD.
LevelSystemConfiguration.EnableHUD = true // Is the HUD enabled?
LevelSystemConfiguration.LevelColor = Color(255,255,255,255) // The color of the "Level: 1" HUD element. White looks best. (This setting is nullified if you have the prestige system)
LevelSystemConfiguration.XPTextColor = Color(255,255,255,255) // The color of the XP percentage HUD element.
LevelSystemConfiguration.LevelBarColor = {6,116,255} // The color of the XP bar. (Sorry this one is different. It is still RGB)
LevelSystemConfiguration.LevelTextPos = {1.5, 200.0} // The position of the LevelText. Y starts from bottom. Fiddle with it
LevelSystemConfiguration.GreenJobBars = true // Are the green bars at the bottom of jobs enabled? KEEP THIS TRUE!
LevelSystemConfiguration.GreenAllBars = true // Are the green bars at the bottom of everything but jobs enabled? I WOULD VERY MUCH RECCOMEND THIS TO BE TRUE.
//Now, let us configure the ways (other than printers) that players get XP
LevelSystemConfiguration.KillModule = true // Give XP + Money for kills! // Next 2 settings control this.
LevelSystemConfiguration.Friendly = true // Only take away money / give XP if the killer is a lower level/same level than the victim. KEEP THIS TO TRUE UNLESS YOU WANT A STUPID RDM MINGEFEST SERVER.
LevelSystemConfiguration.TakeAwayMoneyAmount = 100 // How much money to take away from players when they are killed and add to the killer. You can change this to 0 if none. The XP amount is dynamic.
LevelSystemConfiguration.NPCXP = true // Give XP when an NPC is killed?
LevelSystemConfiguration.NPCXPAmount = 10 // Amount of XP to give when an NPC is killed
LevelSystemConfiguration.TimerModule = true // Give XP to everybody every howeverlong
LevelSystemConfiguration.Timertime = 100 // How much time (in seconds) until everybody gets given XP
LevelSystemConfiguration.TimerXPAmount = 100 // How much XP to give each time it goes off
LevelSystemConfiguration.YourServerName = "on Rave Gaming" // The notifcation text ish. "You got 100XP for playing on this sexy server"
//Next, general settings
LevelSystemConfiguration.XPMult = 5 // How hard it is to level up. 2 would require twice as much XP, ect.
LevelSystemConfiguration.MaxLevel = 100 // The max level
LevelSystemConfiguration.ContinueXP = false // If remaining XP continues over to next levels. I recommend this to be false. Seriously. What if a level 1 gets 99999999 XP somehow? He is level 99 so quickly.
//Printer settings
LevelSystemConfiguration.PrinterSound = true // Give the printers sounds?
LevelSystemConfiguration.PrinterMaxP = 4 // How many times a printer can print before stopping. Change this to 0 if you want infine.
LevelSystemConfiguration.PrinterMax = 4 // How many printers of a certain type a player can own at any one time
LevelSystemConfiguration.PrinterOverheat = false // Can printers overheat?
LevelSystemConfiguration.PrinterTime = 120 // How long it takes printers to print
LevelSystemConfiguration.KeepThisToTrue = true // Can players collect from printers that are 5 levels above their level? PLEASE KEEP THIS TRUE FOR GOD SAKE
LevelSystemConfiguration.Epilepsy = true // If printers flash different colors when they have money in them. (This is only added because somebody will complain about the removal of the green printers.)
//Let us add/change printers! Super easily!
/*TEMPLATE CODE/*
local Printer= {} // Leave this line
Printer.Name = 'Your Printer Name'
Printer.Type = 'yourprintername' // A UNIQUE identifier STRING, can be anything. NO SPACES! The player does not see this.
Printer.XPPerPrint = 10 // How much XP to give a player every time they print.
Printer.MoneyPerPrint = 50 // How much money to give a player every time they print.
Printer.Color = Color(255,255,255,255) // The color of the printer. Setting it to (255,255,255,255) will make it the normal prop color.
Printer.Model = 'models/props_lab/reciever01b.mdl' // The model of the printer. To find the path of a model, right click it in the spawn menu and click "Copy to Clipboard"
Printer.Prestige = 0 // The prestige you have to be to buy the printer. Only works with the prestige DLC.
table.insert(Printers,Printer) // Leave this line
*/
// Here are the default printers:
local Printer={}
Printer.Name = 'Regular Printer - Lvl 1'
Printer.Type = 'regularprinter'
Printer.XPPerPrint = 65
Printer.MoneyPerPrint = 100
Printer.Color = Color(255,255,255,255)
Printer.Model = 'models/props_lab/reciever01b.mdl'
Printer.Price = 1000
Printer.Level = 1
Printer.Prestige = 0
table.insert(Printers,Printer)
local Printer={}
Printer.Name = 'Golden Money Printer - Lvl 10'
Printer.Type = 'goldenprinter'
Printer.XPPerPrint = 300
Printer.MoneyPerPrint = 300
Printer.Color = Color(255,215,0)
Printer.Model = 'models/props_lab/reciever01b.mdl'
Printer.Price = 3000
Printer.Level = 10
Printer.Prestige = 0
table.insert(Printers,Printer)
local Printer={}
Printer.Name = 'Ruby Money Printer - Lvl 20'
Printer.Type = 'rubyprinter'
Printer.XPPerPrint = 1069
Printer.MoneyPerPrint = 1200
Printer.Color = Color(255,0,0)
Printer.Model = 'models/props_lab/reciever01a.mdl'
Printer.Price = 5000
Printer.Level = 20
Printer.Prestige = 0
table.insert(Printers,Printer)
local Printer={}
Printer.Name = 'Platinum Money Printer - Lvl 30'
Printer.Type = 'platprinter'
Printer.XPPerPrint = 1800
Printer.MoneyPerPrint = 1500
Printer.Color = Color(255,255,255)
Printer.Model = 'models/props_c17/consolebox03a.mdl'
Printer.Price = 10000
Printer.Level = 30
Printer.Prestige = 0
table.insert(Printers,Printer)
local Printer={}
Printer.Name = 'Diamond Money Printer - Lvl 40'
Printer.Type = 'diamondprinter'
Printer.XPPerPrint = 2500
Printer.MoneyPerPrint = 5000
Printer.Color = Color(135,200,250)
Printer.Model = 'models/props_c17/consolebox01a.mdl'
Printer.Price = 50000
Printer.Level = 40
Printer.Prestige = 0
table.insert(Printers,Printer)
local Printer={}
Printer.Name = 'Emerald Money Printer - Lvl 50'
Printer.Type = 'emeraldprinter'
Printer.XPPerPrint = 3550
Printer.MoneyPerPrint = 10000
Printer.Color = Color(0,100,0)
Printer.Model = 'models/props_c17/consolebox01a.mdl'
Printer.Price = 100000
Printer.Level = 50
Printer.Prestige = 0
table.insert(Printers,Printer)
local Printer={}
Printer.Name = 'Unubtainium Money Printer - Lvl 60'
Printer.Type = 'unubprinter'
Printer.XPPerPrint = 3500
Printer.MoneyPerPrint = 15000
Printer.Color = Color(255,255,255)
Printer.Model = 'models/props_lab/harddrive01.mdl'
Printer.Price = 120000
Printer.Level = 60
Printer.Prestige = 0
table.insert(Printers,Printer)
//XP books! PLEASE DO NOT HAVE THESE. THEY LINK MONEY DIRECTLY TO XP WHICH IS VERY BAD! IF YOU WANT A GOOD SERVER, KEEP IT OFF. Some people wanted them. For some reason.
// Also, do not allow people to donate for a free prestige. That is retarded. Also, buy my prestige system.
// They are books that you can purchase from the F4 menu that give you XP. (Love you Xeviax)
//If you are having trouble with books, aka them not showing up in the F4 menu, then put the code for the job at the top of this file.
/*TEMPLATE CODE/*
local Book={}
Book.Name = 'Your Book Name'
Book.XPOnUse = 1000 // The amount of XP to give when E is pressed on the book
Book.Model = "models/props_lab/bindergraylabel01a.mdl" // The model of the book
Book.Level = 1 // The level required to purchase it
Book.Price = 10000 // The price of the book
Book.Allowed = {} // The teams allowed to purchase the book.
Book.Type = 'yourbookname' // A unique identifier (NO SPACES!)
Book.CustomCheck = function() end // Some custom check here. For VIP books and stuff.
Book.Prestige = 0 // The prestige required to purchase the book. Only works with my prestige DLC.
table.insert(XPBooks,Book) // Leave this :)
*/
// A sample book: (Remove the /* and */ if you want to use this one.)
local Book={}
Book.Name = '1000XP Book'
Book.XPOnUse = 1000
Book.Model = "models/props_lab/bindergraylabel01a.mdl"
Book.Level = 1
Book.Price = 10000
Book.Allowed = {TEAM_madscientist}
Book.Type = '1000xpbookxoxo'
table.insert(XPBooks,Book)
// Leave this. Seriously, if you edit this and break it some how, I am not going to help you.
for k,v in pairs(XPBooks) do
local Errors = {}
if not type(v.Name) == 'string' then table.insert(Errors, 'The name of an XP Book is INVALID!') end
if not type(v.Type) == 'string' then table.insert(Errors, 'The name of an XP Book is INVALID!') end
if not type(v.Model) == 'string' then table.insert(Errors, 'The model of an XP Book is INVALID!') end
if not type(v.XPOnUse) == 'number' then table.insert(Errors, 'The XPOnUse of an XP Book is INVALID!') end
if not type(v.Level) == 'number' then table.insert(Errors, 'The level of an XP Book is INVALID!') end
if not type(v.Allowed) == 'table' then table.insert(Errors, 'The allowed of an XP Book is INVALID!') end
if not type(v.Price) == 'number' then table.insert(Errors, 'The price of an XP Book is INVALID!') end
local ErrorCount = 0
for k,v in pairs(Errors) do
error(v)
ErrorCount = ErrorCount + 1
end
if not(ErrorCount==0) then return false end
DarkRP.createEntity(v.Name,{
ent="vrondakis_book",
model=v.Model,
price=v.Price,
level=v.Level,
allowed=v.Allowed,
cmd=v.Type,
max = 4,
prestige=(v.Prestige or 0),
customCheck = (v.CustomCheck or function() end),
GiveXPAmountOnUse = v.XPOnUse,
})
end
for k,v in pairs(Printers) do
local Errors = {}
if not type(v.Name) == 'string' then table.insert(Errors, 'The name of a printer is INVALID!') end
if not type(v.Type) == 'string' then table.insert(Errors, 'The type of a printer is INVALID!') end
if not type(v.XPPerPrint) == 'number' then table.insert(Errors, 'The XP of a printer is INVALID!') end
if not type(v.MoneyPerPrint) == 'number' then table.insert(Errors, 'The money of a printer is INVALID!') end
if not type(v.Color) == 'table' then table.insert(Errors, 'The color of a printer is INVALID!') end
if not type(v.Model) == 'string' then table.insert(Errors, 'The model of a printer is INVALID!') end
if not type(v.Price) == 'number' then table.insert(Errors, 'The price of a printer is INVALID!') end
if not type(v.Level) == 'number' then table.insert(Errors, 'The level of a printer is INVALID!') end
local ErrorCount = 0
for k,v in pairs(Errors) do
error(v)
ErrorCount = ErrorCount + 1
end
if not(ErrorCount==0) then return false end
DarkRP.createEntity(v.Name,{
ent = "vrondakis_printer",
model = v.Model,
price = v.Price,
prestige = (v.Prestige or 0),
printer = true,
level = v.Level,
max = LevelSystemConfiguration.PrinterMax,
cmd = 'buyvrondakis'..v.Type..'printer',
vrondakisName = v.Name,
vrondakisType = v.Type,
vrondakisXPPerPrint = v.XPPerPrint,
vrondakisMoneyPerPrint = v.MoneyPerPrint,
vrondakisColor = v.Color,
vrondakisModel = v.Model,
vrondakisOverheat = LevelSystemConfiguration.PrinterOverheat,
PrinterMaxP = LevelSystemConfiguration.PrinterMaxP,
vrondakisPrinterTime = LevelSystemConfiguration.PrinterTime,
vrondakisIsBuyerRetarded = LevelSystemConfiguration.KeepThisToTrue,
vrondakisEpileptic = LevelSystemConfiguration.Epilepsy
})
end
/*
and i even added this entity to entities
DarkRP.createEntity("1000XP Book - Lvl 1", {
ent = "1000xpbookxoxo",
model = "models/props_lab/bindergraylabel01a.mdl",
price = 10000,
max = 1,
cmd = "buyxpbook1000",
level = 1,
allowed = {TEAM_madscientist}
*/
})
Also, we're experiencing a minor bug with the XP Bar, it goes over.
We also have the Prestige DLC if that helps.
Thanks in advance for the help!
Every time I installed the mod when I go to the game I do not see the jobs or the shipments. I see nothing in F4, the install it was good. Help
i try to re install and fix but nothing its not giving out XP
sh_config.lua
/////////////////////////
// Configuration file //
/////////////////////////
LevelSystemConfiguration = {} // Ignore
Printers = {} // Ignore
LevelSystemConfiguration.EnableHUD = true // Is the HUD enabled?
LevelSystemConfiguration.LevelColor = Color(255,255,255,255) // The color of the "Level: 1" HUD element. White looks best. (This setting is nullified if you have the prestige system)
LevelSystemConfiguration.XPTextColor = Color(255,255,255,255) // The color of the XP percentage HUD element.
LevelSystemConfiguration.LevelBarColor = {6,116,255} // The color of the XP bar. (Sorry this one is different. It is still {R,G,B})
LevelSystemConfiguration.LevelTextPos = {1.5, 180.0} // The position of the LevelText. Y starts from bottom. Fiddle with it
LevelSystemConfiguration.GreenJobBars = true // Are the green bars at the bottom of jobs enabled? KEEP THIS TRUE!
LevelSystemConfiguration.GreenAllBars = true // Are the green bars at the bottom of everything but jobs enabled? Recommended(true)
LevelSystemConfiguration.KillModule = true // Give XP + Money for kills! // Next 2 settings control this.
LevelSystemConfiguration.Friendly = true // Only take away money / give XP if the killer is a lower level/same level than the victim. (Recommended:true)
LevelSystemConfiguration.TakeAwayMoneyAmount = 100 // How much money to take away from players when they are killed and add to the killer. You can change this to 0 if none. The XP amount is dynamic.
LevelSystemConfiguration.NPCXP = true // Give XP when an NPC is killed?
LevelSystemConfiguration.NPCXPAmount = 10 // Amount of XP to give when an NPC is killed
LevelSystemConfiguration.TimerModule = true // Give XP to everybody every howeverlong
LevelSystemConfiguration.Timertime = 100 // How much time (in seconds) until everybody gets given XP
LevelSystemConfiguration.TimerXPAmount = 100 // How much XP to give each time it goes off
LevelSystemConfiguration.YourServerName = "on the server" // The notifcation text ish. "You got 100XP for playing on the server."
LevelSystemConfiguration.XPMult = 1 // How hard it is to level up. 2 would require twice as much XP, ect.
LevelSystemConfiguration.MaxLevel = 99 // The max level
LevelSystemConfiguration.ContinueXP = false // If remaining XP continues over to next levels. I recommend this to be false. Seriously. What if a level 1 gets 99999999 XP somehow? He is level 99 so quickly.
//Printer settings
LevelSystemConfiguration.PrinterSound = true // Give the printers sounds?
LevelSystemConfiguration.PrinterMaxP = 4 // How many times a printer can print before stopping. Change this to 0 if you want infine.
LevelSystemConfiguration.PrinterMax = 4 // How many printers of a certain type a player can own at any one time
LevelSystemConfiguration.PrinterOverheat = false // Can printers overheat?
LevelSystemConfiguration.PrinterTime = 120 // How long it takes printers to print
LevelSystemConfiguration.KeepThisToTrue = true // Can players collect from printers that are 5 levels above their level? (Recommended: false)
LevelSystemConfiguration.Epilepsy = true // If printers flash different colors when they have money in them.
/Template Code/
local Printer= {} // Leave this line
Printer.Name = 'Your Printer Name'
Printer.Type = 'yourprintername' // A UNIQUE identifier STRING, can be anything. NO SPACES! The player does not see this.
Printer.XPPerPrint = 10 // How much XP to give a player every time they print.
Printer.MoneyPerPrint = 50 // How much money to give a player every time they print.
Printer.Color = Color(255,255,255,255) // The color of the printer. Setting it to (255,255,255,255) will make it the normal prop color.
Printer.Model = 'models/props_lab/reciever01b.mdl' // The model of the printer. To find the path of a model, right click it in the spawn menu and click "Copy to Clipboard"
Printer.Prestige = 0 // The prestige you have to be to buy the printer. Only works with the prestige DLC.
table.insert(Printers,Printer) // Leave this line
*/
// Default printers:
local Printer={}
Printer.Name = 'Regular Printer'
Printer.Type = 'regularprinter'
Printer.XPPerPrint = 65
Printer.MoneyPerPrint = 100
Printer.Color = Color(255,255,255,255)
Printer.Model = 'models/props_lab/reciever01b.mdl'
Printer.Price = 1000
Printer.Level = 1
Printer.Prestige = 0
table.insert(Printers,Printer)
local Printer={}
Printer.Name = 'Golden Money Printer'
Printer.Type = 'goldenprinter'
Printer.XPPerPrint = 300
Printer.MoneyPerPrint = 300
Printer.Color = Color(255,215,0)
Printer.Model = 'models/props_lab/reciever01b.mdl'
Printer.Price = 3000
Printer.Level = 10
Printer.Prestige = 0
table.insert(Printers,Printer)
local Printer={}
Printer.Name = 'Ruby Money Printer'
Printer.Type = 'rubyprinter'
Printer.XPPerPrint = 1069
Printer.MoneyPerPrint = 1200
Printer.Color = Color(255,0,0)
Printer.Model = 'models/props_lab/reciever01a.mdl'
Printer.Price = 5000
Printer.Level = 20
Printer.Prestige = 0
table.insert(Printers,Printer)
local Printer={}
Printer.Name = 'Platinum Money Printer'
Printer.Type = 'platprinter'
Printer.XPPerPrint = 1800
Printer.MoneyPerPrint = 1500
Printer.Color = Color(255,255,255)
Printer.Model = 'models/props_c17/consolebox03a.mdl'
Printer.Price = 10000
Printer.Level = 30
Printer.Prestige = 0
table.insert(Printers,Printer)
local Printer={}
Printer.Name = 'Diamond Money Printer'
Printer.Type = 'diamondprinter'
Printer.XPPerPrint = 2500
Printer.MoneyPerPrint = 5000
Printer.Color = Color(135,200,250)
Printer.Model = 'models/props_c17/consolebox01a.mdl'
Printer.Price = 50000
Printer.Level = 40
Printer.Prestige = 0
table.insert(Printers,Printer)
local Printer={}
Printer.Name = 'Emerald Money Printer'
Printer.Type = 'emeraldprinter'
Printer.XPPerPrint = 3550
Printer.MoneyPerPrint = 10000
Printer.Color = Color(0,100,0)
Printer.Model = 'models/props_c17/consolebox01a.mdl'
Printer.Price = 100000
Printer.Level = 50
Printer.Prestige = 0
table.insert(Printers,Printer)
local Printer={}
Printer.Name = 'Unubtainium Money Printer'
Printer.Type = 'unubprinter'
Printer.XPPerPrint = 3500
Printer.MoneyPerPrint = 15000
Printer.Color = Color(255,255,255)
Printer.Model = 'models/props_lab/harddrive01.mdl'
Printer.Price = 120000
Printer.Level = 60
Printer.Prestige = 0
table.insert(Printers,Printer)
// Ignore everything under this line.
hook.Add("loadCustomDarkRPItems", "manolis:MVLevels:CustomLoad", function()
for k,v in pairs(Printers) do
local Errors = {}
if not type(v.Name) == 'string' then table.insert(Errors, 'The name of a printer is INVALID!') end
if not type(v.Type) == 'string' then table.insert(Errors, 'The type of a printer is INVALID!') end
if not type(v.XPPerPrint) == 'number' then table.insert(Errors, 'The XP of a printer is INVALID!') end
if not type(v.MoneyPerPrint) == 'number' then table.insert(Errors, 'The money of a printer is INVALID!') end
if not type(v.Color) == 'table' then table.insert(Errors, 'The color of a printer is INVALID!') end
if not type(v.Model) == 'string' then table.insert(Errors, 'The model of a printer is INVALID!') end
if not type(v.Price) == 'number' then table.insert(Errors, 'The price of a printer is INVALID!') end
if not type(v.Level) == 'number' then table.insert(Errors, 'The level of a printer is INVALID!') end
local ErrorCount = 0
for k,v in pairs(Errors) do
error(v)
ErrorCount = ErrorCount + 1
end
if not(ErrorCount==0) then return false end
DarkRP.createEntity(v.Name,{
ent = "vrondakis_printer",
model = v.Model,
price = v.Price,
prestige = (v.Prestige or 0),
printer = true,
level = v.Level,
max = LevelSystemConfiguration.PrinterMax,
cmd = 'buyvrondakis'..v.Type..'printer',
vrondakisName = v.Name,
vrondakisType = v.Type,
vrondakisXPPerPrint = v.XPPerPrint,
vrondakisMoneyPerPrint = v.MoneyPerPrint,
vrondakisColor = v.Color,
vrondakisModel = v.Model,
customCheck = (v.CustomCheck or function() return true end),
vrondakisOverheat = LevelSystemConfiguration.PrinterOverheat,
PrinterMaxP = LevelSystemConfiguration.PrinterMaxP,
vrondakisPrinterTime = LevelSystemConfiguration.PrinterTime,
vrondakisIsBuyerRetarded = LevelSystemConfiguration.KeepThisToTrue,
vrondakisEpileptic = LevelSystemConfiguration.Epilepsy
})
end
end)
DarkRP.registerDarkRPVar("xp", net.WriteDouble, net.ReadDouble)
DarkRP.registerDarkRPVar("level", net.WriteDouble, net.ReadDouble)
DarkRP.registerDarkRPVar("prestige", net.WriteDouble, net.ReadDouble)
Ok i have it so every so often the addon gives out 200 XP For Playing said server and what not right. so i updated it and now it say's "0XP for playing on Server Name" and the printers shoot money out correctly but not xp it gives 0 XP out can you help me figure this out i have not touched the printer text ether
How do I reset everyones level? and if its Mysql how do I connect to it?
I put the Addons in, But It still does not work, and it's not my server, I think it's me just being dumb, But Help would be thanked alot
I have a slight issue with installing this script, this is the file directory i did with it : C:\GMOD\garrysmod\addons and ive tried : C:\GMOD\garrysmod\addons\darkrpmodification\lua\darkrp_modules
im sure you are very busy so if you could help me with this very small issue i would appreciate it thx
How do I get the hud "level" to look like this http://i.imgur.com/t8nK19g.png
Mine currently looks like this: http://i.imgur.com/CuEAyp1.jpg
From what I can see, it cant be edited through the use of the X/Y coordinates, so I was wondering if there was an option somewhere to change that.
When a player disconnects, their printer stays. I added this to try and fix that, but it hasn't worked. I don't know if something is conflicting or what, I just need some help with this one.
function ENT:PlayerDisconnect()
self:Destruct()
self:Remove()
end
hook.Add("PlayerDisconnected", "OnPlayerDisconnect1234", PlayerDisconnect)
The addon works flawlessly, however, I noticed for some reason, it makes all jobs in the F4 menu green (or the Citizen's default color), I already tested it without the addon and this doesn't happen, so it's definitely this addon what's causing it. I'm running DarkRP 2.6.1, and it shows no lua/script errors when opening the server, when joining it, or when pressing F4, so I have no clue of what the cause is. Please take a look at this.
How can you disable this "level" bar above your head? Its annoying, please help.
Is there any way that I can put in a setOrder for F4 menu? I've tried so many different ways, it's not working.
I do not mean to bother but i am sure that this new update does not solve this issue. i have re installed the add-on multiple times and i still run into this error please get back to me as soon as possible. here is the whole error
There is 1 Lua problem!
Please check your console for more information!
[ERROR] A runtime error has occurred in "addons/darkrpmodification/lua/darkrp_modules/levels/sh_config.lua" on line 170.
The best help I can give you is this:
Corrupt entity: Regular Printer!
This entity does not have a unique value for 'cmd'.
Hints:
- There must be some other entity that has the value 'buyvrondakisregularprinterprinter' for 'cmd'.
The responsibility for this error lies with (the authors of) one (or more) of these files:
1. addons/darkrpmodification/lua/darkrp_modules/levels/sh_config.lua on line 170
2. addons/ulib/lua/ulib/shared/hook.lua on line 184
3. gamemodes/darkrp/gamemode/libraries/modificationloader.lua on line 141
4. addons/ulib/lua/ulib/shared/hook.lua on line 184
5. gamemodes/darkrp/gamemode/init.lua on line 81
------- End of Simplerr error -------
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.