Problème Leveling Systeme vrondakris

  • Initiateur de la discussion
sony65

sony65

Geek
Messages
51
Score réaction
2
Points
95
Bonjour,

Lien de l'addon : https://github.com/vrondakis/Leveling-System

Je vous explique le problème :

Quand un joueur ce connecte (ou n'importe quel joueur d'un groupe) impossible d'exp.
Le seul moyen est que j'aille dans ulx -> levels -> set level -> sélectionne un joueur -> 1 -> setlevel
et la les joueurs prendront de l'exp mais si je ne fait pas cette manip rien ne ce passe alors est ce que le problème viendrais t-il du levels.lua ? je ne sait pas mais c'est le seul script qui a un rapport avec ulx je vous le met.

Code:
function ulx.addXP(calling_ply, target_ply, amount) if not amount then ULib.tsayError("Amount not specified!") return end if target_ply.DarkRPUnInitialized then return end target_ply:addXP(amount, true) DarkRP.notify(target_ply, 0,4,calling_ply:Nick() .. " gave you "..amount.."XP") ulx.fancyLogAdmin(calling_ply:Nick() .. ' gave '..target_ply:Nick()..' '..amount)
end
local addXPx = ulx.command("Levels", "ulx addxp", ulx.addXP, "!addxp")
addXPx:addParam{type=ULib.cmds.PlayerArg}
addXPx:addParam{type=ULib.cmds.NumArg, hint="xp"}
addXPx:defaultAccess(ULib.ACCESS_ADMIN)
addXPx:help("Add XP to a player.")
function ulx.setLevel(calling_ply, target_ply, level) if not level then ULib.tsayError("Level not specified!") return end if target_ply.DarkRPUnInitialized then return end DarkRP.storeXPData(target_ply,level,0) target_ply:setDarkRPVar('level',level) target_ply:setDarkRPVar('xp',0) DarkRP.notify(target_ply, 0,4,calling_ply:Nick() .. " set your level to "..level) ulx.fancyLogAdmin(calling_ply:Nick() .. ' set '..target_ply:Nick()..' level to '..level)
end
local setLevelx = ulx.command("Levels", "ulx setlevel", ulx.setLevel, "!setlevel")
setLevelx:addParam{type=ULib.cmds.PlayerArg}
setLevelx:addParam{type=ULib.cmds.NumArg, hint="level"}
setLevelx:defaultAccess(ULib.ACCESS_ADMIN)
setLevelx:help("Set a players level.")
Et je précise que j'ai modifier un truck dans gmod/addon/darkrpmodification/lua/darkrp_modules/levels/sh_config.lua car je ne voulais pas les printer vrondakris dans mes entités

Modifié :

Code:
/////////////////////////
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.XPBarYPos = 0 // Y position of the XP bar
LevelSystemConfiguration.DisplayLevel = true // Show player levels when you look at them
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.
LevelSystemConfiguration.PrinterSound = false // 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 = false // Can players collect from printers that are 5 levels above their level? (Recommended: false)
LevelSystemConfiguration.Epilepsy = false // If printers flash different colors when they have money in them.

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.Category) == 'string' then v.Category='' 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 local t = { ent = "vrondakis_printer", model = v.Model, category = v.Category, price = v.Price, prestige = (v.Prestige or 0), printer = true, level = v.Level, max = LevelSystemConfiguration.PrinterMax, cmd = 'buyvrondakis'..v.Type..'printer', allowed = v.Allowed, 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 } if(v.DParams) then for k,v in pairs(v.DParams) do t[k] = v end end DarkRP.createEntity(v.Name,t) end
end)
DarkRP.registerDarkRPVar("xp", net.WriteDouble, net.ReadDouble)
DarkRP.registerDarkRPVar("level", net.WriteDouble, net.ReadDouble)
DarkRP.registerDarkRPVar("prestige", net.WriteDouble, net.ReadDouble)
L'original :

Code:
/////////////////////////
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.XPBarYPos = 0 // Y position of the XP bar
LevelSystemConfiguration.DisplayLevel = true // Show player levels when you look at them
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.
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.

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)
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.Category) == 'string' then v.Category='' 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 local t = { ent = "vrondakis_printer", model = v.Model, category = v.Category, price = v.Price, prestige = (v.Prestige or 0), printer = true, level = v.Level, max = LevelSystemConfiguration.PrinterMax, cmd = 'buyvrondakis'..v.Type..'printer', allowed = v.Allowed, 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 } if(v.DParams) then for k,v in pairs(v.DParams) do t[k] = v end end DarkRP.createEntity(v.Name,t) end
end)
DarkRP.registerDarkRPVar("xp", net.WriteDouble, net.ReadDouble)
DarkRP.registerDarkRPVar("level", net.WriteDouble, net.ReadDouble)
DarkRP.registerDarkRPVar("prestige", net.WriteDouble, net.ReadDouble)
Voila peut être que en modifiant j'ai mal fait qqch et que sa a fait planté mais je voulais absolument pas que les printers apparaissent dans les entités donc je les ai supprimé..

Merci de votre aide.
 
OneSidious

OneSidious

Geek suprême
Messages
145
Score réaction
24
Points
140
J'ai le m^me problème, et le créa ne sait pas :)
 
  • Initiateur de la discussion
sony65

sony65

Geek
Messages
51
Score réaction
2
Points
95
merde c'est bizarre
 
chesiren

chesiren

Geek suprême
Messages
124
Score réaction
39
Points
160
Tu as pas de message d'erreur?
 
OneSidious

OneSidious

Geek suprême
Messages
145
Score réaction
24
Points
140
Non il n'y en a pas
 
  • Initiateur de la discussion
sony65

sony65

Geek
Messages
51
Score réaction
2
Points
95
Okay alors les gars j'ai trouvé le problème !!!
Il suffit tout simplement d'installer MySqloo sur le serveur car le script fonctionne avec ce dll. (Vous pouvez le télécharger depuis le dashboard mtx)
Une fois installer n'oubliez pas de configurer le mysql.lua
Par contre il faudra refaire tout les spawn des job !
 
  • J'aime
Réactions: VareK et OneSidious
OneSidious

OneSidious

Geek suprême
Messages
145
Score réaction
24
Points
140
ok mrc bg
 
VareK

VareK

Nouveau né
Messages
22
Score réaction
2
Points
20
sony65 à dit:
Okay alors les gars j'ai trouvé le problème !!!
Il suffit tout simplement d'installer MySqloo sur le serveur car le script fonctionne avec ce dll. (Vous pouvez le télécharger depuis le dashboard mtx)
Une fois installer n'oubliez pas de configurer le mysql.lua
Par contre il faudra refaire tout les spawn des job !
Comment installe t'on ce module sur un autre serv que mtx ?
 
Discord d'entraide
Rejoignz-nous sur Discord