Jump to content

اصلاح توب


Recommended Posts

Posted

السلام عليكم ورحمه الله و بركاته

شباب انا كنت ابي اسوي توب للزومبي و ما اشتغل

ما ابي اطول عليكم الكودات

+

ابيه ما يقدر يحدد على اللسته

+

ابيه يتحدث

--- Client Side ---

addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), 
    function () 
        triggerServerEvent("onGetTop",getLocalPlayer()) 
    end 
) 
  
addEvent("onClient",true) 
addEventHandler("onClient",getRootElement(), 
    function (name,data) 
        local row = guiGridListAddRow(GUIEditor_Grid[1]) 
        guiGridListSetItemText(GUIEditor_Grid[1],row,nametop,name,false,false) 
        guiGridListSetItemText(GUIEditor_Grid[1],row,datatop,data,false,false) 
    end 
) 
  

--- Server Side ---

addEvent("onGetTop",true) 
addEventHandler("onGetTop",getRootElement(), 
    function () 
        top = {} 
        for i,v in ipairs(getElementsByType("player")) do 
            local name = getPlayerName(v) 
            local account = getPlayerAccount(v) 
            if account then 
                for s,a in ipairs(getAccounts()) do 
                    local data = getAccountData(a,"Zombie kills") 
                    table.insert(top,data) 
                    table.sort(top) 
                    triggerClientEvent(source,"onClient",source,name,top) 
                end 
            end 
        end 
    end 
) 

الي تعرفه قوله

Retired.

Posted
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), 
    function Timer() 
        triggerServerEvent("onGetTop",getLocalPlayer()) 
    end) 
setTimer(Timer,10000,0) 
  
addEvent("onClient",true) 
addEventHandler("onClient",getRootElement(), 
    function (name,data) 
        local row = guiGridListAddRow(GUIEditor_Grid[1]) 
        guiGridListSetItemText(GUIEditor_Grid[1],row,nametop,name,false,false) 
        guiGridListSetItemText(GUIEditor_Grid[1],row,datatop,data,false,false) 
    end) 
  

Posted

جرب

-- Client Side --

triggerServerEvent("onGetTop", localPlayer) 
  
addEvent("onClient",true) 
addEventHandler("onClient", root, 
function (top) 
     for i, data in ipairs(top) do 
          local row = guiGridListAddRow(GUIEditor_Grid[1]) 
          guiGridListSetItemText(GUIEditor_Grid[1], row, nametop, tostring(data.name), false, false) 
          guiGridListSetItemText(GUIEditor_Grid[1], row, datatop, tostring(data.kills), false, true) 
     end 
end) 

-- Server Side --

addEvent("onGetTop",true) 
addEventHandler("onGetTop", root, 
function() 
     top = {} 
     for s,a in ipairs(getAccounts()) do 
          local accName = getAccountName(a) 
          local Zkill = getAccountData(a, "Zombie kills") or 0 
          table.insert(top, {name = accName, kills = Zkill} ) 
     end 
     table.sort(top,function(a,b) return (tonumber(a.kills)or 0) > (tonumber(b.kills)or 0) end) 
     setTimer(function(player)  
          triggerClientEvent(player, "onClient", player, top) 
     end, 1000, 1, source) 
end) 

CiTLh.png
Posted
جرب

-- Client Side --

triggerServerEvent("onGetTop", localPlayer) 
  
addEvent("onClient",true) 
addEventHandler("onClient", root, 
function (top) 
     for i, data in ipairs(top) do 
          local row = guiGridListAddRow(GUIEditor_Grid[1]) 
          guiGridListSetItemText(GUIEditor_Grid[1], row, nametop, tostring(data.name), false, false) 
          guiGridListSetItemText(GUIEditor_Grid[1], row, datatop, tostring(data.kills), false, true) 
     end 
end) 

-- Server Side --

addEvent("onGetTop",true) 
addEventHandler("onGetTop", root, 
function() 
     top = {} 
     for s,a in ipairs(getAccounts()) do 
          local accName = getAccountName(a) 
          local Zkill = getAccountData(a, "Zombie kills") or 0 
          table.insert(top, {name = accName, kills = Zkill} ) 
     end 
     table.sort(top,function(a,b) return (tonumber(a.kills)or 0) > (tonumber(b.kills)or 0) end) 
     setTimer(function(player)  
          triggerClientEvent(player, "onClient", player, top) 
     end, 1000, 1, source) 
end) 

الكود شغال

بس ابي بدال اسم الحساب

اسم الاعب

Retired.

Posted
جرب هذا
guiGridListSetItemText(GUIEditor_Grid[1], row, getPlayerName(nametop), tostring(data.name), false, false) 

LoL?

CiTLh.png
Posted

كيف ذا يمشي الحال

مع التعديل الكود السابق

addEventHandler("onPlayerLogin",getRootElement(), 
    function () 
        local account = getPlayerAccount(source) 
        if not isGuestAccount(account) then 
            setAccountData(account,"PName",getPlayerName(source) or "N/A") 
        end 
    end 
) 

طيب باقي شي ما رديتوا عليه الي هو

كيف اخلي اللسته ما تنضغط

يعني اضغط ما يحدد في اللسته شي

Retired.

Posted
  
        guiGridListSetItemText(GUIEditor_Grid[1],row,nametop,name,true,true) 

خلاص مشكور حليتها

انا اشوف طريقه تجيب الاسم احسن من ذيك

Retired.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...