- Initiateur de la discussion
- Banni
Razzer95
Geek suprême
- Messages
- 689
- Score réaction
- 158
- Points
- 150
Bonjour J'ai un gros problème , Les joueurs ex Lvl 10 Peuvent se mettre job lvl 15
Merci
Merci
Pastebin.comRazzer95 à dit:Celui Gratuit , Que tout le monde à avec la barre en haut .
Voici la Config
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, 540.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 = false // Only take away money / give XP if the killer is a lower level/same level than the victim. (Recommended:true)
LevelSystemConfiguration.TakeAwayMoneyAmount = 2 // 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 = 75 // Amount of XP to give when an NPC is killed
LevelSystemConfiguration.TimerModule = true // Give XP to everybody every howeverlong
LevelSystemConfiguration.Timertime = 300 // How much time (in seconds) until everybody gets given XP
LevelSystemConfiguration.TimerXPAmount = 125 // How much XP to give each time it goes off
LevelSystemConfiguration.YourServerName = "on This Server" // The notifcation text ish. "Vous recevez 150 XP Pour avoir Jouer sur le Serveur."
LevelSystemConfiguration.XPMult = 0.6 // How hard it is to level up. 2 would equire 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.
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.
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
DarkRP.createEntity(v.Name,{
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
})
end
end)
DarkRP.registerDarkRPVar("xp", net.WriteDouble, net.ReadDouble)
DarkRP.registerDarkRPVar("level", net.WriteDouble, net.ReadDouble)
DarkRP.registerDarkRPVar("prestige", net.WriteDouble, net.ReadDouble)
Voici le Fichier sh_levels
resource.AddSingleFile('materials/vrondakis/xp_bar.png')
resource.AddSingleFile('resource/fonts/FrancoisOne.ttf')
local meta = FindMetaTable("Player")
function meta:setLevel(level)
if not (level or self:IsPlayer()) then return end
return self:setDarkRPVar('level', level)
end
function meta:setXP(xp)
if not (xp or self:IsPlayer()) then return end
return self:setDarkRPVar('xp', xp)
end
function meta:addXP(amount, notify, carryOver)
local PlayerLevel = (self:getDarkRPVar('level'))
local PlayerXP = (self:getDarkRPVar('xp'))
amount = tonumber(amount)
if((not amount) or (not IsValid(self)) or (not PlayerLevel) or (not PlayerXP) or (PlayerLevel>=LevelSystemConfiguration.MaxLevel)) then return 0 end
if(not carryOver) then
if(self.VXScaleXP) then
amount=(amount*tonumber(self.VXScaleXP))
end
end
if not(notify) then
DarkRP.notify(self,0,4,'You got '..amount..' XP!')
end
local TotalXP = PlayerXP + amount
if(TotalXP>=self:getMaxXP()) then // Level up!
PlayerLevel = PlayerLevel + 1
DarkRP.notifyAll(0,3,self:Name() .. ' reached level '..PlayerLevel..'!')
hook.Call( "PlayerLevelChanged" )
local RemainingXP = (TotalXP-self:getMaxXP())
if(LevelSystemConfiguration.ContinueXP) then
if(RemainingXP>0) then
self:setXP(0)
self:setLevel(PlayerLevel)
return self:addXP(RemainingXP,true,true)
end
end
self:setLevel(PlayerLevel)
self:setXP(0)
DarkRP.storeXPData(self,PlayerLevel,0)
else
DarkRP.storeXPData(self,PlayerLevel,(TotalXP or 0))
self:setXP(math.max(0,TotalXP))
end
return (amount or 0)
end
function meta:AddXP(amount, notify)
self:addXP(amount, notify)
end
function meta:getLevel()
return self:getDarkRPVar('level')
end
function meta:getXP()
return self:getDarkRPVar('xp')
end
function meta:getMaxXP()
return (((10+(((self:getDarkRPVar('level') or 1)*((self:getDarkRPVar('level') or 1)+1)*90))))*LevelSystemConfiguration.XPMult)
end
function meta:addLevels(levels)
if(self:getDarkRPVar('level') == LevelSystemConfiguration.MaxLevel) then
return false
end
if((self:getDarkRPVar('level') +levels)>LevelSystemConfiguration.MaxLevel) then
local LevelsCan = (((self:getDarkRPVar('level')+levels))-LevelSystemConfiguration.MaxLevel)
if(LevelsCan==0) then
return 0
else
DarkRP.storeXPData(self, LevelSystemConfiguration.MaxLevel,0)
self:setDarkRPVar('xp',0)
self:setDarkRPVar('level', LevelSystemConfiguration.MaxLevel)
return LevelsCan
end
else
DarkRP.storeXPData(self,(self:getDarkRPVar('level') +levels),0)
self:setDarkRPVar('xp',0)
self:setDarkRPVar('level',(self:getDarkRPVar('level') +levels))
return levels
end
end
function meta:hasLevel(level)
return ((self:getDarkRPVar('level')) >= level)
end
concommand.Add("levels", function(ply)
DarkRP.notify(ply,0,10,"Leveling System by @vrondakis")
end)
??????????????SaisPasAirpé à dit:Pastebin.com
Mais tu as pas une idée ??SaisPasAirpé à dit:C'est un peux chiant de tout défiler , tu mes le code sur pastebin c'est plus facile à voir et sa prend pas toute la page