- Initiateur de la discussion
Jayce Arkania
Geek
- Messages
- 36
- Score réaction
- 1
- Points
- 65
Bonjour , depuis hier j'ai crée un serveur starwarsrp , j'ai mis les levels , mais comment ont se give des levels ?
Merci
Merci
Hee ...Feytone à dit:https://github.com/vrondakis/Leveling-System
ULX Support - Allows you to set levels and add/remove XP with ULX (optional)
En gros regarde dans ULX tu dois avoir quelque chose quand t'es superadmin ...
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.")
merci ton tuto est très clair ! je te remerciNardox à dit:Alors salut
Pour commencer copie ce code :
Ensuite direction ulx garrysmod --> addons --> ulx --> lua --> ulx --> modules --> sh --> un des fichiers [on va prendre le fichier teleport]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.")
Tu l'ouvre et tu colle le code du haut ↑ à la fin du dossier teleport comme ci-dessous ↓
Ensuite tu va en jeu et tu faitRegarde la pièce jointe 1531
!addxp TONNOM lenombre d'xp
!setlevel TONNOM le niveauhttps://prntscr.com/d6d5ch
Derien !Jayce Arkania à dit:merci ton tuto est très clair ! je te remerci