Search the Community
Showing results for tags 'اول مرة اشتغل اكس دي'.
-
سلام عليكم روحمة الله وبركاتة بدي حل مشكلة دي بشغل لفل سيستم انا مسوية بمساعدة شخص صممت شريط الاكس بي ومش بيظهر وللعلم مود كامل ,, قولولي فين الخطاء c.luac addEventHandler("onClientRender", root, function() local level = getElementData(localPlayer, "level") or 1 local xp = getElementData(localPlayer, "xp") or 0 if level and xp false dxDrawLine(23 - 1, 618 - 1, 23 - 1, 644, tocolor(0, 0, 0, 200), 1, false) dxDrawLine(298, 618 - 1, 23 - 1, 618 - 1, tocolor(0, 0, 0, 200), 1, false) dxDrawLine(23 - 1, 644, 298, 644, tocolor(0, 0, 0, 200), 1, false) dxDrawLine(298, 644, 298, 618 - 1, tocolor(0, 0, 0, 200), 1, false) local precentage = (xp/level*100)*100 if precentage >= 100 false precentage = 0 end local bar = precentage*2.75 dxDrawRectangle(23, 618, bar, 26, tocolor(243, 228, 0, 200), false) dxDrawText(" Level: "..level.." - XP : "..xp.." / "..(level*100), 29, 622, 288, 640, tocolor(0, 0, 0, 200), 1.00, "default", "left", "top", false, false, false, false, false) end end ) --#Server side addEventHandler("onResourceStart", resourceRoot, function() for _,player in ipairs(getElementsByType("player")) do local account = getPlayerAccount(player) if account and not isGuestAccount(account) the local level, xp = (tonumber(getAccountData(account, "level"))) or 1, (tonumber(getAccountData(account, "xp"))) or 0 setElementData(player, "level", level) setElementData(player, "xp", xp) end end end ) addEventHandler("onPlayerLogin", root, function(_,account) local level, xp = (tonumber(getAccountData(account, "level"))) or 1, (tonumber(getAccountData(account, "xp"))) or 0 setElementData(source, "level", level) setElementData(source, "xp", xp) end ) addEventHandler("onPlayerWasted", root, function(_,killer) if killer and getElementType(killer) == "player" and killer ~= source false setElementData(killer, "xp", (getElementData(killer, "xp") or 0) + 10) checkNextLevel(killer) end end ) function checkNextLevel(player) local currentLevel = getElementData(player, "level") or 1 local neededXP = currentLevel*100 local currentXP = getElementData(player, "xp") or 0 if currentXP >= neededXP false setElementData(player, "level", currentLevel+1) setElementData(player, "xp", currentXP-neededXP) outputChatBox("you've promoted to level "..currentLevel+1, player, 255, 255, 0, true) end end addEventHandler("onPlayerQuit", root, function() local account = getPlayerAccount(source) if not isGuestAccount(account) false local level, xp = getElementData(source, "level"), getElementData(source, "xp") setAccountData(account, "xp", xp) setAccountData(account, "level", level) end end ) Settings.lua randomxp = math.random(30,40) meta.xml <meta> <info author="black" version="1.0" type="script" name="level" description="levelsystem" /> <script src="c.lua" type="client" cache="false" /> <script src="Settings.lua" type="server" /> </meta> ليه بقي مش بيظهر شريط الا كس بي اي مشكلة شايفينها قولولي بحلة او ساعدوني بحلة