Sijar Posted July 19, 2018 Share Posted July 19, 2018 سلام عليكم روحمة الله وبركاتة بدي حل مشكلة دي بشغل لفل سيستم انا مسوية بمساعدة شخص صممت شريط الاكس بي ومش بيظهر وللعلم مود كامل ,, قولولي فين الخطاء 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> ليه بقي مش بيظهر شريط الا كس بي اي مشكلة شايفينها قولولي بحلة او ساعدوني بحلة Link to comment
,#Savage Posted July 19, 2018 Share Posted July 19, 2018 ياخي انت قررت الموضوع 6000 مره @!#NssoR_) Link to comment
Sijar Posted July 19, 2018 Author Share Posted July 19, 2018 دي مشكلة جديد طب اعمل ايه ,, والله مش بزيد عدد البوستات انا عايز احل مشكلة -__- اي مساعدة بليز شباب Link to comment
#Sn[i]pêŘ Posted July 19, 2018 Share Posted July 19, 2018 (edited) هاذ كل ساعه يجيب موضوع + يكرر يرجى التدخل @!#NssoR_) Edited July 19, 2018 by #Sn[i]pêŘ 1 Link to comment
SycroX Posted July 19, 2018 Share Posted July 19, 2018 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 then 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 ) صراحه لو ما تعرف وش الفرق بين كلنت سايد و سيرفر سايد اسف بتركك هيك هنا انت هيك ما وصلت لنسبه 0.001% حتي اذا ما تعرف الفرق بين الملفين Link to comment
Sijar Posted July 19, 2018 Author Share Posted July 19, 2018 تقدر تكلمني خاص , اشرحلك مشكلتي %_% كلاينت سايد الاوامر المتعلقة بلاعب علي ما احسب في الويكي والسيرفر سايد الامور الخاصة بلاعب وسيرفر صح ؟ Link to comment
SycroX Posted July 20, 2018 Share Posted July 20, 2018 --#من هنا تحطو في كلنت سايد ملف كلنت | c.lua 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 then 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 ) --#و هنا تحطو في ملف settings.lua 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 ) Link to comment
Sijar Posted July 20, 2018 Author Share Posted July 20, 2018 وكده راح يظهر شريط الاكس دي Link to comment
SycroX Posted July 20, 2018 Share Posted July 20, 2018 يب + اسمو اكس بي مو اكس دي اختصار كلمه experience Link to comment
Sijar Posted July 20, 2018 Author Share Posted July 20, 2018 طيب ما ظهر محتوي كلاينت سايد c.lua addEventHandler("onClientRender", root, function() local level = getElementData(localPlayer, "level") or 1 local xp = getElementData(localPlayer, "xp") or 0 if level and xp false dxDrawLine(40 - 1, 827 - 1, 40 - 1, 854, tocolor(1, 251, 236, 255), 1, false) dxDrawLine(249, 827 - 1, 40 - 1, 827 - 1, tocolor(1, 251, 236, 255), 1, false) dxDrawLine(40 - 1, 854, 249, 854, tocolor(1, 251, 236, 255), 1, false) dxDrawLine(249, 854, 249, 827 - 1, tocolor(1, 251, 236, 255), 1, false) local precentage = ((xp/level)*100)*100 if precentage >= 100 then precentage = 0 end local bar = precentage*2.75 dxDrawRectangle(40, 827, 209, 27, tocolor(127, 126, 126, 255), false) dxDrawText(" Level: "..level.." - XP : "..xp.." / "..(level*100), 45, 832, 239, 850, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) end end ) محتوي سيستنج ليو Settings.lua 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 ) محتوي meta.lua <meta> <info author="black" version="1.0" type="script" name="level" description="levelsystem" /> <script src="c.lua" type="client" /> <script src="Settings.lua" type="server" /> </meta> شو المشكلة ليه ما يظهر شريط الاكس بي Link to comment
Sijar Posted July 21, 2018 Author Share Posted July 21, 2018 حد يحل لي مشكلة حق شريط الاكس بي مش بيظهر Link to comment
Trefeor Posted July 21, 2018 Share Posted July 21, 2018 addEventHandler("onClientRender", root, function() local level = getElementData(localPlayer, "level") or 1 local xp = getElementData(localPlayer, "xp") or 0 if level and xp then dxDrawLine(40 - 1, 827 - 1, 40 - 1, 854, tocolor(1, 251, 236, 255), 1, false) dxDrawLine(249, 827 - 1, 40 - 1, 827 - 1, tocolor(1, 251, 236, 255), 1, false) dxDrawLine(40 - 1, 854, 249, 854, tocolor(1, 251, 236, 255), 1, false) dxDrawLine(249, 854, 249, 827 - 1, tocolor(1, 251, 236, 255), 1, false) local precentage = ((xp/level)*100)*100 if precentage >= 100 then precentage = 0 end local bar = precentage*2.75 dxDrawRectangle(40, 827, 209, 27, tocolor(127, 126, 126, 255), false) dxDrawText(" Level: "..level.." - XP : "..xp.." / "..(level*100), 45, 832, 239, 850, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) end end ) جرب هذا لو م زبط تاكد من الاحداثيات حقت المستطيل :] Link to comment
SycroX Posted July 21, 2018 Share Posted July 21, 2018 معلش حسبت ذي غلط local precentage = ((xp/level)*100)*100 حولها لهيك local precentage = (xp/level*100)*100 Link to comment
Sijar Posted July 21, 2018 Author Share Posted July 21, 2018 زي الفل يا تريفور بس بقتل زومبي الفل مو يعلي زي ما هو ما بحصل اكس بي Link to comment
TheOtherSide Posted July 21, 2018 Share Posted July 21, 2018 server addEventHandler("onResourceStart", resourceRoot, function() for _,player in ipairs(getElementsByType("player")) do local account = getPlayerAccount(player) if account and not isGuestAccount(account) then 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("onPedWasted", root, function(_,killer) if killer and getElementType(killer) == "player" then setElementData(killer, "xp", (getElementData(killer, "xp") or 0) + 10) checkNextLevel(killer) saveDataIntoAcc(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 then 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() saveDataIntoAcc(source) end ) function saveDataIntoAcc(plr) local account = getPlayerAccount(plr) if not isGuestAccount(account) then local level, xp = getElementData(plr, "level"), getElementData(plr, "xp") setAccountData(account, "xp", xp) setAccountData(account, "level", level) end end client local sw,sh = guiGetScreenSize() addEventHandler("onClientRender", root, function() local level = getElementData(localPlayer, "level") or 1 local xp = getElementData(localPlayer, "xp") or 0 if level and xp then dxDrawLine(40 - 1, 827 - 1, 40 - 1, 854, tocolor(1, 251, 236, 255), 1, false) dxDrawLine(249, 827 - 1, 40 - 1, 827 - 1, tocolor(1, 251, 236, 255), 1, false) dxDrawLine(40 - 1, 854, 249, 854, tocolor(1, 251, 236, 255), 1, false) dxDrawLine(249, 854, 249, 827 - 1, tocolor(1, 251, 236, 255), 1, false) local precentage = ((xp/level)*100)*100 if precentage >= 100 then precentage = 0 end local bar = precentage*2.75 dxDrawRectangle(40, 827, 209, 27, tocolor(127, 126, 126, 255), false) dxDrawText(" Level: "..level.." - XP : "..xp.." / "..(level*100), 45, sh-30, 239, sh-30, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)--832 end end ) Link to comment
Sijar Posted July 22, 2018 Author Share Posted July 22, 2018 عم اقتل زومبي وما بحصل اكس بي شو الحل ؟ Link to comment
MrBiG Posted July 22, 2018 Share Posted July 22, 2018 55 minutes ago, Mr.BLack said: عم اقتل زومبي وما بحصل اكس بي شو الحل ؟ addEventHandler ( "onPedWasted", root , function ( _ , killer ) if ( killer ) and ( getElementType ( killer ) == "player" ) then setElementData ( killer , "xp" , ( getElementData ( killer , "xp" ) or 0) + 10 ) checkNextLevel ( killer ) end end ) Link to comment
TheOtherSide Posted July 22, 2018 Share Posted July 22, 2018 1 hour ago, Mr.BLack said: عم اقتل زومبي وما بحصل اكس بي شو الحل ؟ الكود الي عطيتك المفروض يشتغل استخدم debugscript 3 واقتل زومبي وقولي وش يطلع لك ان كان فيه خطأ Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now