0 Üye ve 1 Ziyaretçi konuyu incelemekte.
local sX,sY = guiGetScreenSize()local g_Me = getLocalPlayer()local root = getRootElement()local players = getElementsByType("player")scoreboard = {}local scrolldownby = 2local lastscrolldown = 0local scrollupby = 1local scrollbarWidth = 1local ServerMaxPlayer = 80local showedScoreboard = falselocal rowsCount = math.floor(sY/21) - 2local start = 3local rotateimage= 0bindKey("mouse_wheel_down", "down", function() if rowsCount > #scoreboard then return end local time = getTickCount() if time - lastscrolldown < 60 then scrolldownby = math.min(scrolldownby + 3, 16) else if time - lastscrolldown < 120 then scrolldownby = math.min(scrolldownby + 2, 16) end scrolldownby = 1 end lastscrolldown = time local rCount = math.min(#scoreboard, rowsCount - 1) start = math.min(#scoreboard - rCount, start + scrolldownby)end)bindKey("mouse_wheel_up", "down", function() if rowsCount > #scoreboard then return end local time = getTickCount() if time - lastscrolldown < 100 then scrollupby = math.min(scrollupby + 2, 16) else scrollupby = 1 end lastscrolldown = time start = math.max(1, start - scrollupby)end)local uptadePlayers = function() scoreboard = {} table.insert(scoreboard,{}) players = getElementsByType("player") local teams = getElementsByType("team") local teamID = {} for id,team in ipairs(teams) do teamID[getTeamName(team)] = id end local playersOrderedByTeams = {} for i = 1, #teams + 1 do playersOrderedByTeams[i] = {} end for id,player in ipairs(players) do local pTeam = getPlayerTeam(player) if pTeam then pTeam = teamID[getTeamName(pTeam)] + 1 else pTeam = 1 end table.insert(playersOrderedByTeams[pTeam], player) end for tID,playersInTeam in ipairs(playersOrderedByTeams) do if tID-1 >= 1 then if #getPlayersInTeam(teams[tID - 1]) >= 1 then table.insert(scoreboard, {"team", teams[tID-1]}) end end for id,player in ipairs(playersInTeam) do table.insert(scoreboard, {"player", player,getPlayerName(player)}) end endenduptadePlayers()setTimer(uptadePlayers,2500,0)local drawScoreboard = function() local rCount = math.min(#scoreboard-1, rowsCount -1) start = math.min(#scoreboard - rCount, start) local c = 0 local cx, cy = 0,0 if isCursorShowing() then cx, cy = getCursorPosition() cx = cx * sX cy = cy * sY end local x, y = sX / 2 - 370, sY / 2 - rCount * 20 / 2+14 --dxDrawRectangle(x, y, 35, rCount * 20+2, tocolor(0, 0, 0, 70)) dxDrawRectangle(x, y, 730, rCount * 20+2, tocolor(0, 0, 0, 75)) --dxDrawLinedRectangle(x, y - 65, 730, 30,tocolor(r,g,b,255)) dxDrawRectangle(x, y - 65, 730, 30, tocolor(56,83,68,0)) --xDrawRectangle(x, y - 19, 730, 2, tocolor(0,150,255,255)) --dxDrawText("BELLİ DEĞİL", x + 250, y - 85, x + 730, y-18, tocolor(22,220,220, math.abs(math.sin(getTickCount()/999))*255),1.5,"default-bold", "left", "center",false,false,false,true) -- dxDrawRectangle(x, y-17, 730, 17, tocolor(0,0,0,155)) --dxDrawText(#getElementsByType("player") .." / "..ServerMaxPlayer, x + 5, y - 17, x + 640, y-18, tocolor(255, 255, 255, 255), 1.3,"default-bold", "right", "center",false,false,false,true) -- OYUNCUNUN SIRASI -- --dxDrawText("Sıra", x+15 , y-17, x + 640, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") -- OYUNCU ADI -- dxDrawText("Oyuncu", x +90, y-17, x + 640, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") -- FPS -- dxDrawText("FPS", x +540, y-17, x + 640, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") -- DURUM -- dxDrawText("Durum", x +380, y-17, x + 640, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") -- ZAMAN -- dxDrawText("Zaman", x +460, y-17, x + 640, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") -- PARA -- dxDrawText("Para", x +300, y-17, x + 640, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") -- PİNG -- dxDrawText("Ping", x +623, y-17, x + 640, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") for id,element in ipairs(scoreboard) do if start < id and id <= start + rCount then c = c + 1 if element[1] == "player" and isElement(element[2]) then if isCursorShowing() and x <= cx and cx < x + 640 and y + (c - 1) * 20 <= cy and cy < y + (c) * 20 then end local r, g, b = 255, 255, 255 local playerName = element[3] local specialPlayer = getElementData(localPlayer,"SPECIALTEAM_TAG") local specialTeamTag = getElementData(localPlayer,"SPECIALTEAM_CLANTAG") if getPlayerTeam(element[2]) then r, g, b = getTeamColor(getPlayerTeam(element[2])) end if getPlayerTeam(element[2]) and getTeamName(getPlayerTeam(element[2])) == getElementData(localPlayer,"SPECIALTEAM_CLANNAME") then if string.find(playerName,specialTeamTag) then playerName = playerName:gsub(specialTeamTag,specialPlayer) end end if not getElementData(element[2], "AFK") then dxDrawText(playerName, x + 90, y-5 + (c - 1) * 20, x + 200, y + (c) * 20, tocolor(r, g, b, 255), 1, "default-bold", "left", "center", false, false, false, true) else dxDrawText(playerName, x + 90, y-5 + (c - 1) * 20, x + 200, y + (c) * 20, tocolor(r, g, b, 255), 1, "default-bold", "left", "center", false, false, false, true) dxDrawText("#ffa500AFK", x + 60, y-5 + (c - 1) * 20, x + 200, y + (c) * 20, tocolor(r, g, b, 255), 1, "default-bold", "left", "center", false, false, false, true) end --ID --dxDrawText(getElementData(element[2],"id") or "?", x + 15, y + (c - 1) * 20, x + 35, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center") --FPS dxDrawText(getElementData(element[2],"FPS") or "?", x+535, y-5 + (c - 1) * 20, x + 535+34, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center") --Ping dxDrawText(getPlayerPing(element[2]), x+635, y-5 + (c - 1) * 20, x + 595+40, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center") -- local para_datasi if getElementData(element[2],"Para") then para_datasi = ""..getElementData(element[2],"Para") else para_datasi = "Ziyaretci" end dxDrawText(para_datasi, x+300, y-5 + (c - 1) * 20, x+275+45, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center") local mb_datasi if getElementData(element[2],"MB") then mb_datasi = ""..getElementData(element[2],"MB") else mb_datasi = "Belirsiz" end dxDrawText(mb_datasi, x+480, y-5 + (c - 1) * 20, x+275+45, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center") local ulke_datasi if getElementData(element[2],"Home") then ulke_datasi = ""..getElementData(element[2],"Home") else ulke_datasi = "Belirsiz" end local zaman_datasi if getElementData(element[2],"Zaman") then zaman_datasi = ""..getElementData(element[2],"Zaman") else end dxDrawText(zaman_datasi, x+640, y-5 + (c - 1) * 20, x+275+45, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center") elseif element[1] == "team" and isElement(element[2]) then local team_name = getTeamName(element[2]) if team_name == getElementData(localPlayer,"SPECIALTEAM_CLANNAME") then team_name = getElementData(localPlayer,"SPECIALTEAM_NAME") end local r, g, b = getTeamColor(element[2]) dxDrawRectangle(x+35, y + (c - 1) * 20, 605, 19, tocolor(0,0,0, 200)) dxDrawText(team_name, x + 38, y + (c - 1) * 20, x + 150, y + (c) * 20, tocolor(r, g, b, 255), 1, "default-bold", "left", "center", false, false, false, true) end end end --dxDrawRectangle(x, y +rCount * 20, 730, 2, tocolor(0,150,255,255)) --dxDrawText("Oyuncu Listesi", x, y + rCount * 20, x + 640, y +rCount * 20+22, tocolor(255, 255, 255, 255), 1, "default-bold", "center", "center", false, false, false, true) endfunction raceGetElementSpeed(element) if (isElement(element)) then local x,y,z = getElementVelocity(element) return math.ceil((x^2 + y^2 + z^2) ^ 0.5 * 1.61 * 100) else return 0 endendcomma_value = function(n) local left, num, right = string.match(n, "^([^%d]*%d)(%d*)(.-)$") return left .. num:reverse():gsub("(%d%d%d)", "%1,"):reverse() .. rightendgetOrdinalSuffix = function(rank) rank = tonumber(rank) return (rank < 10 or rank > 20) and ({[1] = "st", [2] = "nd", [3] = "rd"})[rank % 10] or "th"end--// Kenar Çizgiler //--setTimer(function()r,g,b = math.random(0,255),math.random(0,255),math.random(0,255)end,500,0)function dxDrawLinedRectangle(x, y, width, height, color, postGUI)local _width = 1dxDrawLine ( x, y, x+width, y, color, _width, postGUI ) -- TopdxDrawLine ( x, y, x, y+height, color, _width, postGUI ) -- LeftdxDrawLine ( x, y+height, x+width, y+height, color, _width, postGUI ) -- BottomdxDrawLine ( x+width, y, x+width, y+height, color, _width, postGUI ) -- RightendaddEventHandler("onClientMinimize", root, function() setElementData(g_Me, "AFK", true)end)addEventHandler("onClientRestore", root, function() setElementData(g_Me, "AFK", false)end)startDrawing = function()showedScoreboard = trueaddEventHandler("onClientRender",root,drawScoreboard)endstopDrawing = function()showedScoreboard = falseremoveEventHandler("onClientRender",root,drawScoreboard)endbindKey("tab", "down", startDrawing)bindKey("tab", "up", stopDrawing)startCursor = function()if showedScoreboard thenshowCursor(true)endend------------------------ FPSlocal fps = 0local fpstick = niladdEventHandler("onClientRender",root,function() fps = fps + 1 if not fpstick then fpstick = getTickCount() end fpscountertick = getTickCount() if fpscountertick - fpstick >= 1000 then setElementData(localPlayer,"FPS",fps) fps = 0 fpstick = false endend)stopCursor = function() showCursor(false)endbindKey("mouse2", "down", startCursor)bindKey("mouse2", "up", stopCursor)showCursor(getKeyState("mouse2"))-- KOD --addEventHandler("onClientResourceStart",root,function()triggerServerEvent("onDownloadFinish",localPlayer) end)
local sX,sY = guiGetScreenSize()local g_Me = getLocalPlayer()local root = getRootElement()local players = getElementsByType("player")scoreboard = {}local scrolldownby = 2local lastscrolldown = 0local scrollupby = 1local scrollbarWidth = 1local ServerMaxPlayer = 80local showedScoreboard = falselocal rowsCount = math.floor(sY/21) - 2local start = 3local rotateimage= 0bindKey("mouse_wheel_down", "down", function() if rowsCount > #scoreboard then return end local time = getTickCount() if time - lastscrolldown < 60 then scrolldownby = math.min(scrolldownby + 3, 16) else if time - lastscrolldown < 120 then scrolldownby = math.min(scrolldownby + 2, 16) end scrolldownby = 1 end lastscrolldown = time local rCount = math.min(#scoreboard, rowsCount - 1) start = math.min(#scoreboard - rCount, start + scrolldownby)end)bindKey("mouse_wheel_up", "down", function() if rowsCount > #scoreboard then return end local time = getTickCount() if time - lastscrolldown < 100 then scrollupby = math.min(scrollupby + 2, 16) else scrollupby = 1 end lastscrolldown = time start = math.max(1, start - scrollupby)end)local uptadePlayers = function() scoreboard = {} table.insert(scoreboard,{}) players = getElementsByType("player") local teams = getElementsByType("team") local teamID = {} for id,team in ipairs(teams) do teamID[getTeamName(team)] = id end local playersOrderedByTeams = {} for i = 1, #teams + 1 do playersOrderedByTeams[i] = {} end for id,player in ipairs(players) do local pTeam = getPlayerTeam(player) if pTeam then pTeam = teamID[getTeamName(pTeam)] + 1 else pTeam = 1 end table.insert(playersOrderedByTeams[pTeam], player) end for tID,playersInTeam in ipairs(playersOrderedByTeams) do if tID-1 >= 1 then if #getPlayersInTeam(teams[tID - 1]) >= 1 then table.insert(scoreboard, {"team", teams[tID-1]}) end end for id,player in ipairs(playersInTeam) do table.insert(scoreboard, {"player", player,getPlayerName(player)}) end endenduptadePlayers()setTimer(uptadePlayers,2500,0)local drawScoreboard = function() local rCount = math.min(#scoreboard-1, rowsCount -1) start = math.min(#scoreboard - rCount, start) local c = 0 local cx, cy = 0,0 if isCursorShowing() then cx, cy = getCursorPosition() cx = cx * sX cy = cy * sY end local x, y = sX / 2 - 370, sY / 2 - rCount * 20 / 2+14 --dxDrawRectangle(x, y, 35, rCount * 20+2, tocolor(0, 0, 0, 70)) dxDrawImage(x+170,y/2-100,400,200,'10.jpg',0,0,0) -- RESİM DOSYANIN ADI ! METAYA EKLEMEYİ UNUTMA dxDrawRectangle(x, y-90, 730, rCount * 20+2 + 300, tocolor(0, 0, 0,110)) -- SİYAH ARKA PLAN dxDrawLinedRectangle(x, y-90, 730, rCount * 20+2 + 300, tocolor(255, 0, 0,110)) -- ŞERİTLER RENKLERİ İÇİN TOCOLOR İÇERİSİNDEKİLERİ DOLDUR dxDrawRectangle(x, y-90, 730, rCount * 20+2, tocolor(0, 0, 0, 150)) dxDrawText("Oyuncu", x+90, y-135, x + 640, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") -- FPS -- dxDrawText("FPS", x +540, y-135, x + 640, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") -- DURUM -- dxDrawText("Durum", x +380, y-135, x + 640, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") -- ZAMAN -- dxDrawText("Zaman", x +460, y-135, x + 640, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") -- PARA -- dxDrawText("Para", x +300, y-135, x + 640, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") -- PİNG -- dxDrawText("Ping", x +623, y-135, x + 640, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") for id,element in ipairs(scoreboard) do if start < id and id <= start + rCount then c = c + 1 if element[1] == "player" and isElement(element[2]) then if isCursorShowing() and x <= cx and cx < x + 640 and y + (c - 1) * 20 <= cy and cy < y + (c) * 20 then end local r, g, b = 255, 255, 255 local playerName = element[3] local specialPlayer = getElementData(localPlayer,"SPECIALTEAM_TAG") local specialTeamTag = getElementData(localPlayer,"SPECIALTEAM_CLANTAG") if getPlayerTeam(element[2]) then r, g, b = getTeamColor(getPlayerTeam(element[2])) end if getPlayerTeam(element[2]) and getTeamName(getPlayerTeam(element[2])) == getElementData(localPlayer,"SPECIALTEAM_CLANNAME") then if string.find(playerName,specialTeamTag) then playerName = playerName:gsub(specialTeamTag,specialPlayer) end end if not getElementData(element[2], "AFK") then dxDrawText(playerName, x + 90, y-110 + (c - 1) * 20, x + 200, y + (c) * 20, tocolor(r, g, b, 255), 1, "default-bold", "left", "center", false, false, false, true) else dxDrawText(playerName, x + 90, y-110 + (c - 1) * 20, x + 200, y + (c) * 20, tocolor(r, g, b, 255), 1, "default-bold", "left", "center", false, false, false, true) dxDrawText("#ffa500AFK", x + 60, y-110 + (c - 1) * 20, x + 200, y + (c) * 20, tocolor(r, g, b, 255), 1, "default-bold", "left", "center", false, false, false, true) end --ID --dxDrawText(getElementData(element[2],"id") or "?", x + 15, y + (c - 1) * 20, x + 35, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center") --FPS dxDrawText(getElementData(element[2],"FPS") or "?", x+535, y-110 + (c - 1) * 20, x + 535+34, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center") --Ping dxDrawText(getPlayerPing(element[2]), x+635, y-110 + (c - 1) * 20, x + 595+40, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center") -- local para_datasi if getElementData(element[2],"Para") then para_datasi = ""..getElementData(element[2],"Para") else para_datasi = "Ziyaretci" end dxDrawText(para_datasi, x+300, y-110 + (c - 1) * 20, x+275+45, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center") local mb_datasi if getElementData(element[2],"MB") then mb_datasi = ""..getElementData(element[2],"MB") else mb_datasi = "Belirsiz" end dxDrawText(mb_datasi, x+480, y-110 + (c - 1) * 20, x+275+45, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center") local ulke_datasi if getElementData(element[2],"Home") then ulke_datasi = ""..getElementData(element[2],"Home") else ulke_datasi = "Belirsiz" end local zaman_datasi if getElementData(element[2],"Zaman") then zaman_datasi = ""..getElementData(element[2],"Zaman") else end dxDrawText(zaman_datasi, x+640, y-110 + (c - 1) * 20, x+275+45, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center") elseif element[1] == "team" and isElement(element[2]) then local team_name = getTeamName(element[2]) if team_name == getElementData(localPlayer,"SPECIALTEAM_CLANNAME") then team_name = getElementData(localPlayer,"SPECIALTEAM_NAME") end local r, g, b = getTeamColor(element[2]) dxDrawRectangle(x+35, y-35 + (c - 1) * 20, 605, 19, tocolor(0,0,0, 200)) dxDrawText(team_name, x + 38, y-70 + (c - 1) * 20, x + 150, y + (c) * 20, tocolor(r, g, b, 255), 1, "default-bold", "left", "center", false, false, false, true) end end end --dxDrawRectangle(x, y +rCount * 20, 730, 2, tocolor(0,150,255,255)) --dxDrawText("Oyuncu Listesi", x, y + rCount * 20, x + 640, y +rCount * 20+22, tocolor(255, 255, 255, 255), 1, "default-bold", "center", "center", false, false, false, true) endfunction raceGetElementSpeed(element) if (isElement(element)) then local x,y,z = getElementVelocity(element) return math.ceil((x^2 + y^2 + z^2) ^ 0.5 * 1.61 * 100) else return 0 endendcomma_value = function(n) local left, num, right = string.match(n, "^([^%d]*%d)(%d*)(.-)$") return left .. num:reverse():gsub("(%d%d%d)", "%1,"):reverse() .. rightendgetOrdinalSuffix = function(rank) rank = tonumber(rank) return (rank < 10 or rank > 20) and ({[1] = "st", [2] = "nd", [3] = "rd"})[rank % 10] or "th"end--// Kenar Çizgiler //--setTimer(function()r,g,b = math.random(0,255),math.random(0,255),math.random(0,255)end,500,0)function dxDrawLinedRectangle(x, y, width, height, color, postGUI)local _width = 1dxDrawLine ( x, y, x+width, y, color, _width, postGUI ) -- TopdxDrawLine ( x, y, x, y+height, color, _width, postGUI ) -- LeftdxDrawLine ( x, y+height, x+width, y+height, color, _width, postGUI ) -- BottomdxDrawLine ( x+width, y, x+width, y+height, color, _width, postGUI ) -- RightendaddEventHandler("onClientMinimize", root, function() setElementData(g_Me, "AFK", true)end)addEventHandler("onClientRestore", root, function() setElementData(g_Me, "AFK", false)end)startDrawing = function()showedScoreboard = trueaddEventHandler("onClientRender",root,drawScoreboard)endstopDrawing = function()showedScoreboard = falseremoveEventHandler("onClientRender",root,drawScoreboard)endbindKey("tab", "down", startDrawing)bindKey("tab", "up", stopDrawing)startCursor = function()if showedScoreboard thenshowCursor(true)endend------------------------ FPSlocal fps = 0local fpstick = niladdEventHandler("onClientRender",root,function() fps = fps + 1 if not fpstick then fpstick = getTickCount() end fpscountertick = getTickCount() if fpscountertick - fpstick >= 1000 then setElementData(localPlayer,"FPS",fps) fps = 0 fpstick = false endend)stopCursor = function() showCursor(false)endbindKey("mouse2", "down", startCursor)bindKey("mouse2", "up", stopCursor)showCursor(getKeyState("mouse2"))-- KOD --addEventHandler("onClientResourceStart",root,function()triggerServerEvent("onDownloadFinish",localPlayer) end)