The moVer Posted May 5, 2015 Share Posted May 5, 2015 السلام عليكم ورحمة الله وبركاته لوتكرمتم تشوفون مشكلة ذا الكود addEventHandler ("onPlayerWasted", root, function (_, killer) if (killer and getElementType (killer) == "player") then local checkGuest = getPlayerAccount ( killer ) if ( not isGuestAccount ( checkGuest ) ) then setAccountData (checkGuest , "kills", (getAccountData (checkGuest , "kills") or 0) + 1) local chkills = getAccountData (checkGuest , "kills") if (chkills == 50) then setAccountData (checkGuest , "kills", 0) setAccountData (checkGuest , "Level",(getAccountData (checkGuest , "Level") or 0) + 1) for i,account in pairs(getAccounts()) do rowdata = { account = account, level = getAccountData(account,"Level") or "N/A", } table.sort (rowdata) for k,v in ipairs(rowdata) do outputChatBox(v) end end end end end end ) function aa (player) outputChatBox(""..levell.."") local levell = getAccountData(account,"Level") addCommandHandler ( "chl", aa ) end وشكرا والسلام خير ختام Link to comment
ALw7sH Posted May 5, 2015 Share Posted May 5, 2015 وش الخطا في الكود عشان نصلحه لول debugscript Link to comment
The moVer Posted May 5, 2015 Author Share Posted May 5, 2015 ما شتغل المود ما يطلع شي Link to comment
TAPL Posted May 5, 2015 Share Posted May 5, 2015 الله يهديك حاط بكودك هريس حق يزن و تبيه يشتغل Link to comment
yazan Posted May 5, 2015 Share Posted May 5, 2015 الله يهديك حاط بكودك هريس حق يزن و تبيه يشتغل ههههههههههههههههههههههههههههههههههههههههههههههههههه مستحيل Link to comment
The moVer Posted May 5, 2015 Author Share Posted May 5, 2015 ههههههه وش اسوي ما اعرف كثير بالجداول Link to comment
yazan Posted May 5, 2015 Share Posted May 5, 2015 شوف ذا الموضوع فيه مثل طلبك بس شوف الاكواد يلي فيه اول شي قبل لا تتعدل viewtopic.php?f=160&t=77320&hilit=rowdata&start=15 Link to comment
The moVer Posted May 5, 2015 Author Share Posted May 5, 2015 يخي ما فادني بشي هذيك حقت الزومبي وفيها اكس بي ومدري ايش انا ابي اعرف وش المشكلة عشان اصلحها وبس وشكرا للجميع Link to comment
yazan Posted May 5, 2015 Share Posted May 5, 2015 لا في فوق مو حق زومبي قبل تعديل الموضوع Link to comment
The moVer Posted May 5, 2015 Author Share Posted May 5, 2015 Plusexp هاذا فنكشن بمود العقرب اعتقد ياخي قلي وش المشكلة احسن وشكرا لمجهودك Link to comment
yazan Posted May 5, 2015 Share Posted May 5, 2015 server function OnPlayerKill (_, killer) if killer then if getElementType ( killer ) == "player" then if killer ~= source then if not isGuestAccount(getPlayerAccount(killer)) then local experience = tonumber(getElementData(killer,"experience")) local SourceLevel = getElementData(killer,"level") if ( not SourceLevel ) then SourceLevel = 1 setElementData(killer,"level",1) end if ( levels[SourceLevel+1] ) then local randomExperience = math.random(unpack(ExpRewardForKill)) if (experience) then setElementData(killer,"experience",experience+tonumber(randomExperience)) else setElementData(killer,"experience",randomExperience) end else setElementData(killer,"experience",tonumber(levels[SourceLevel]["experienceRequired"])) end end end end end end addEventHandler ("onPlayerWasted", root, OnPlayerKill) كلنت# local sx, sy = guiGetScreenSize() function drawExperience() dxDrawRectangle((310/1024)*sx,(698/768)*sy,(481/1024)*sx,(36/768)*sy,tocolor(255,255,255,35),false) dxDrawRectangle((315/1024)*sx,(703/768)*sy,(472/1024)*sx,(26/768)*sy,tocolor(0,0,0,255),false) local experience = getElementData(localPlayer,"experience") or 0 local experience_n = getElementData(localPlayer,"experience_n") or 0 local level = getElementData(localPlayer,"level") or 1 local percent = (experience / experience_n * 100) if (percent >= 100) then percent = 100 elseif (experience_n < 1) then percent = 0 end dxDrawRectangle((320/1024)*sx,(706/768)*sy,(tonumber(percent)*4.64/1024)*sx,(20/768)*sy,tocolor(255,255,255,75),false) dxDrawBorderedText("Level: ".. tostring(level) .." | Experience Points: ".. tostring(experience) .." > ".. tostring(experience_n),(430/1024)*sx,(707/768)*sy,(667/1024)*sx,(724/768)*sy,tocolor(0,0,0,255),(sx/1024)*0.6,"bankgothic","center","center",false,false,false) end addEventHandler("onClientRender",root,drawExperience) function dxDrawBorderedText( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) dxDrawText ( text, x - 1, y - 1, w - 1, h - 1, tocolor ( 255, 255, 255, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) -- black dxDrawText ( text, x + 1, y - 1, w + 1, h - 1, tocolor ( 255, 255, 255, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y + 1, w - 1, h + 1, tocolor ( 255, 255, 255, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y + 1, w + 1, h + 1, tocolor ( 255, 255, 255, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y, w - 1, h, tocolor ( 255, 255, 255, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y, w + 1, h, tocolor ( 255, 255, 255, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y - 1, w, h - 1, tocolor ( 255, 255, 255, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y + 1, w, h + 1, tocolor ( 255, 255, 255, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) end addEvent ( "LevelUpEffect", true ) addEventHandler ( "LevelUpEffect", root, function ( ) PlayerLevelUpSound() addEventHandler("onClientRender",root,DrawLevelUp) setTimer(function() removeEventHandler("onClientRender",root,DrawLevelUp) end, 4000, 1) end ) function PlayerLevelUpSound() local sound = playSound("levelup.mp3") setSoundVolume(sound, 1) end function DrawLevelUp() dxDrawBorderedText( "LEVEL UP!!!", sx/2, sy/15, sx/2, sx/2, tocolor(255,144,0,255),(sx/1024)*2.5,"bankgothic","center","center",false,false,false ) end Link to comment
The moVer Posted May 6, 2015 Author Share Posted May 6, 2015 اولا الكود غلط ثانية مع احترامي الك انا ابي اعرف وش المشكلة وبس ويعطيك العافية على مجهودك Link to comment
The moVer Posted May 7, 2015 Author Share Posted May 7, 2015 وش صار بس قولولي وش المشكلة انا احلها ان شاء الله Link to comment
Simple. Posted May 7, 2015 Share Posted May 7, 2015 بما انك انت تبي تحلها شوف وش المشكله وحلها ! جاي تسألنا عن المشكله الي بكودك ؟ Link to comment
The moVer Posted May 7, 2015 Author Share Posted May 7, 2015 ما اعرف وين المشكلة لو اعرف ما طرحت الموضوع Link to comment
The moVer Posted May 7, 2015 Author Share Posted May 7, 2015 الحين انا سويت كود اذا صح شلون اضيفه على كودي الي طرحته واذا غلط وش الخطأ addEvent("Sort", true) addEventHandler("Sort", root, Sort) function() local Killdata = {} for key,acc in pairs(getAccounts()) do local kill = {} kill.account = acc kill.level = getAccountData(acc, "Level") Killdata[key] = kill end do table.sort(Killdata) end return Killdata end Link to comment
ALw7sH Posted May 7, 2015 Share Posted May 7, 2015 حنا مابنجرب كل كود انت تسويه لول debugscript خش اللوكال سيرفر وجرب الكود وانت فاك اذا لقيت مشكله حاول تصلحها ماقدر تعال هنا حط المشكله والكود Link to comment
The moVer Posted May 8, 2015 Author Share Posted May 8, 2015 ياخي انا ما قلتلك جربو انا قلت اذا في اخطاء يعني انت لما تشوف الكود يمديك تطلع اخطاء بعدين الكود لازمه 2 بس اتوقع يمدي اني افجر حالي لاني مو حاطط if killer ~= source صح؟؟ Link to comment
The Killer Posted May 8, 2015 Share Posted May 8, 2015 ابي افهم انت الحين وش تبي تسوي بكودك ذا ؟ Link to comment
TAPL Posted May 8, 2015 Share Posted May 8, 2015 addEventHandler("onPlayerWasted", root, function(_, killer) if killer and getElementType(killer) == "player" and killer ~= source then local checkGuest = getPlayerAccount(killer) if checkGuest and not isGuestAccount(checkGuest) then local Tkill = tonumber(getAccountData(checkGuest, "kills") or 0) if (Tkill+1 >= 50) then setAccountData(checkGuest, "kills", 0) setAccountData(checkGuest, "Level", (getAccountData(checkGuest, "Level") or 0) + 1) else setAccountData(checkGuest, "kills", Tkill+1) end end end end) function aa(player) local TopTable = {} for i, account in ipairs(getAccounts()) do table.insert(TopTable, {account, (getAccountData(account, "Level") or 0)}) end table.sort(TopTable, function(a, b) return a[2] > b[2] end) for i, value in ipairs(TopTable) do outputChatBox("AccountName: "..getAccountName(value[1]).." | Level: "..value[2], player, 255, 255, 255) end end addCommandHandler("chl", aa) Link to comment
The moVer Posted May 8, 2015 Author Share Posted May 8, 2015 شكرا تابل الله يخليك ويوفقك شكرا ما قصرت Link to comment
The moVer Posted May 8, 2015 Author Share Posted May 8, 2015 بس اذا ابي اخليه بس الاول يبين بالشات مو كل لحسابات Link to comment
TAPL Posted May 8, 2015 Share Posted May 8, 2015 function aa(player) local TopTable = {} for i, account in ipairs(getAccounts()) do table.insert(TopTable, {account, (getAccountData(account, "Level") or 0)}) end table.sort(TopTable, function(a, b) return a[2] > b[2] end) outputChatBox("AccountName: "..getAccountName(TopTable[1][1]).." | Level: "..TopTable[1][2], player, 255, 255, 255) end addCommandHandler("chl", aa) Link to comment
The moVer Posted May 8, 2015 Author Share Posted May 8, 2015 جزاك الله خير الله يخليك وشكرا 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