Jump to content

طلب مساعده


Recommended Posts

سلام عليكم 

 

انا عندي مود توب 5 للتكتيك

بس عندي مشكله وهي انو المود ما يشتغل الا اذا فيه 5 لاعبين بالسيرفر بس

 

انا ابيه يشتغل حتى لو فيه لاعب واحد بس

 

الأكواد

local damageTable = {}
----------------------
function getRoundTopFive()
	sortedTable = {}
	for player,damage in pairs(damageTable) do
		if isElement(player) then
			local team = getPlayerTeam(player)
			if team then
				table.insert(sortedTable, {player, damage})
			end
		end
	end
	table.sort(sortedTable, function(a,b) return a[2] > b[2] end)
	local t1, t2, t3, t4, t5 = {}, {}, {}, {}, {}
	t1 = {getPlayerName(sortedTable[1][1]), sortedTable[1][2]} or {"N/A", "0"}
	t2 = {getPlayerName(sortedTable[2][1]), sortedTable[2][2]} or {"N/A", "0"}
	t3 = {getPlayerName(sortedTable[3][1]), sortedTable[3][2]} or {"N/A", "0"}
	t4 = {getPlayerName(sortedTable[4][1]), sortedTable[4][2]} or {"N/A", "0"}
	t5 = {getPlayerName(sortedTable[5][1]), sortedTable[5][2]} or {"N/A", "0"}
	triggerClientEvent(root, "showRoundTop5", root, t1, t2, t3, t4, t5)
end

 

Link to comment
local damageTable = {}
----------------------
function getRoundTopFive()
    sortedTable = {}
    for player,damage in pairs(damageTable) do
        if isElement(player) then
            local team = getPlayerTeam(player)
            if team then
                table.insert(sortedTable, {player, damage})
            end
        end
    end
    table.sort(sortedTable, function(a,b) return a[2] > b[2] end)
    local top5 = {}
    for index = 1, 5 do
        top5[#top5+1] = sortedTable[index] and {getPlayerName(sortedTable[index][1]), sortedTable[index][2]} or {'N/A', '0'}
    end
    triggerClientEvent(root, "showRoundTop5", root, top5)
end

اذا تبي تجيب التوب 5 سو لوب للجدول

مثلا كذا

for index = 1, #top5 do
    outputChatBox(index..':'..top5[index][1]..' with '..top5[index][2]..' kills')
end

 

Link to comment
1 hour ago, #,xiRocKyz said:

local damageTable = {}
----------------------
function getRoundTopFive()
    sortedTable = {}
    for player,damage in pairs(damageTable) do
        if isElement(player) then
            local team = getPlayerTeam(player)
            if team then
                table.insert(sortedTable, {player, damage})
            end
        end
    end
    table.sort(sortedTable, function(a,b) return a[2] > b[2] end)
    local top5 = {}
    for index = 1, 5 do
        top5[#top5+1] = sortedTable[index] and {getPlayerName(sortedTable[index][1]), sortedTable[index][2]} or {'N/A', '0'}
    end
    triggerClientEvent(root, "showRoundTop5", root, top5)
end

اذا تبي تجيب التوب 5 سو لوب للجدول

مثلا كذا


for index = 1, #top5 do
    outputChatBox(index..':'..top5[index][1]..' with '..top5[index][2]..' kills')
end

 

ممكن تجي خاص

Link to comment

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...