Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. tu dois aller dans /addons/ULX/lua/ulx/modules/sh/ Puis creer un fichiers genre " levels" ( ou niveau ) .lua et tu met dedans
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. function ulx.addXP(calling_ply, target_ply, amount)
  26. if not amount then ULib.tsayError("Amount not specified!") return end
  27. if target_ply.DarkRPUnInitialized then return end
  28. target_ply:addXP(amount, true)
  29. DarkRP.notify(target_ply, 0,4,calling_ply:Nick() .. " Vous a donné "..amount.."XP")
  30. ulx.fancyLogAdmin(calling_ply:Nick() .. ' gave '..target_ply:Nick()..' '..amount)
  31. end
  32. local addXPx = ulx.command("Levels", "ulx addxp", ulx.addXP, "!addxp")
  33. addXPx:addParam{type=ULib.cmds.PlayerArg}
  34. addXPx:addParam{type=ULib.cmds.NumArg, hint="xp"}
  35. addXPx:defaultAccess(ULib.ACCESS_ADMIN)
  36. addXPx:help("Add XP to a player.")
  37.  
  38. function ulx.setLevel(calling_ply, target_ply, level)
  39. if not level then ULib.tsayError("Level not specified!") return end
  40. if target_ply.DarkRPUnInitialized then return end
  41. DarkRP.storeXPData(target_ply,level,0)
  42. target_ply:setDarkRPVar('level',level)
  43. target_ply:setDarkRPVar('xp',0)
  44. DarkRP.notify(target_ply, 0,4,calling_ply:Nick() .. " a mit votre niveau à "..level)
  45. ulx.fancyLogAdmin(calling_ply:Nick() .. ' set '..target_ply:Nick()..' level to '..level)
  46. end
  47. local setLevelx = ulx.command("Levels", "ulx setlevel", ulx.setLevel, "!setlevel")
  48. setLevelx:addParam{type=ULib.cmds.PlayerArg}
  49. setLevelx:addParam{type=ULib.cmds.NumArg, hint="level"}
  50. setLevelx:defaultAccess(ULib.ACCESS_ADMIN)
  51. setLevelx:help("Set a players level.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement