Jump to content

lc171

Members
  • Posts

    2
  • Joined

  • Last visited

lc171's Achievements

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. (2/54)

0

Reputation

  1. preciso de ajuda no painel de top rank , preciso adcionar uma coluna de numeração tambem colocar em ordem (da quantidade maior de kill para menor quantidade). client side scoreWindow = guiCreateWindow (0.3, 0.2, 0.4, 0.6, "Ranking Kills/Death", true) scoreGrid = guiCreateGridList (0, 0.05, 1, 0.85, true, scoreWindow) guiWindowSetSizable (scoreWindow, false) guiGridListAddColumn (scoreGrid, "Account", 0.45) guiGridListAddColumn (scoreGrid, "Kills", 0.13) guiGridListAddColumn (scoreGrid, "Deaths", 0.13) guiGridListAddColumn (scoreGrid, "Ratio", 0.18) closeGrid = guiCreateButton (0.2, 0.91, 0.6, 0.09, "Fechar Painel", true, scoreWindow) guiSetVisible (scoreWindow, false) function scoreInfo (accounts, kills, deaths, ratio) guiSetVisible (scoreWindow, true) guiSetVisible (closeGrid, true) showCursor (true) if accounts then for i, v in ipairs (accounts) do guiGridListAddRow (scoreGrid, accounts, kills, deaths, math.round (tonumber(ratio), 2, "floor")) end end end addEvent ("showRank", true) addEventHandler ("showRank", getRootElement(), scoreInfo) function clickOptions (button, state, absoluteX, absoluteY) if button == "left" then if source == closeGrid then guiSetVisible (scoreWindow, false) showCursor (false) guiGridListClear (scoreGrid) end end end addEventHandler ("onClientGUIClick", getRootElement(), clickOptions) function math.round (number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end function sendScores () if not guiGetVisible (scoreWindow) then triggerServerEvent ("getRank", localPlayer) end end bindKey("F9","down",sendScores) server side function recebeKills () local data = getAccounts () local accTable = {} local killsTable = {} local deathsTable = {} local killDeath = {} local kill = 0 local death = 0 if not data[1] then triggerClientEvent (client, "showScores", client) return end for i, acc in ipairs (data) do table.insert (accTable, getAccountName (data)) if not getAccountData (data, "kills") then table.insert (killsTable, "0") kill = 0 else table.insert (killsTable, tostring (getAccountData (data, "kills"))) kill = tonumber (getAccountData (data, "kills")) end if not getAccountData (data, "deaths") then table.insert (deathsTable, "0") death = 0 else table.insert (deathsTable, tostring (getAccountData (data, "deaths"))) death = tonumber (getAccountData (data, "deaths")) end if death == 0 and kill == 0 then table.insert (killDeath, 0) else table.insert (killDeath, kill / death) end end triggerClientEvent (client, "showRank", client, accTable, killsTable, deathsTable, killDeath) end addEvent ("getRank", true) addEventHandler ("getRank", getRootElement(), recebeKills) function salvaKills (ammo, killer, weapon, bodypart, stealth) if not isGuestAccount (getPlayerAccount(source)) then local deaths = getAccountData (getPlayerAccount(source), "deaths") if deaths then setAccountData (getPlayerAccount(source), "deaths", deaths + 1) else setAccountData (getPlayerAccount(source), "deaths", 1) end end if killer and killer ~= source then if getElementType (killer) == "player" then if not isGuestAccount (getPlayerAccount(killer)) then local kills = getAccountData (getPlayerAccount(killer), "kills") if kills then setAccountData (getPlayerAccount(killer), "kills", kills + 1) else setAccountData (getPlayerAccount(killer), "kills", 1) end end elseif getElementType (killer) == "vehicle" then killer = getVehicleController (killer) if killer then if not isGuestAccount (getPlayerAccount(killer)) then local kills = getAccountData (getPlayerAccount(killer), "kills") if kills then setAccountData (getPlayerAccount(killer), "kills", kills + 1) else setAccountData (getPlayerAccount(killer), "kills", 1) end end end end end end addEventHandler ("onPlayerWasted", getRootElement(), salvaKills)''
×
×
  • Create New...