Jump to content

Search the Community

Showing results for tags 'scoreboard'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 19 results

  1. I was bored and long time without do any script so I started looking in the wiki some functions what I not used yet and I found dxDrawMaterialLine3D. You have a video and code about a scoreboard what I made for test this function. Maybe this can be useful for you ( take scrollbar, etc ). Client-Side code:
  2. Hey guys, I would like to know how I can add the name of my server to the scoreboard, besides this, change the colors of the columns and add players to teams when starting a job. I would really appreciate a help. Thanks
  3. Iae rapaziada, seguinte estou usando o resource Object_Preview para fazer um scoreboard, porém estou com um certo problema. O resource cria o ped atrás da imagem de fundo, vou mandar as fotos para deixar mais cla que estou falando... Sem o Fundo: Com o Fundo: Partes do code: imgs/fundoP.png = ao fundo(azul) dxDrawImage(x*135, y*93, x*796, y*538, "imgs/ScoreFundo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*623, y*123, x*269, y*480, "imgs/fundoP.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) function CriarPed() local x1, y1, z1 = getCameraMatrix() myElement = createPed(getElementModel(localPlayer), x1, y1, z1) Preview = exports.Object_Preview:createObjectPreview(myElement, 0, 0, 180, 0.352, 0.28, 0.377, 0.375, false, false, true) end function abrir () if Scorebd_RDS == false then CriarPed() addEventHandler("onClientRender", root, MostrarScore) Scorebd_RDS = true showChat(false) for id, hudComponents in ipairs(hudTable) do setPlayerHudComponentVisible(hudComponents, false) end else removeEventHandler("onClientRender", root, MostrarScore) Scorebd_RDS = false showChat(true) exports.Object_Preview:destroyObjectPreview(Preview) destroyElement (myElement) myElement = nil for id, hudComponents in ipairs(hudTable) do setPlayerHudComponentVisible(hudComponents, true) end end end bindKey("tab", "both", abrir) Obs: talvez o problema seja devido ao evento OnClientRender. Pois acredito eu que, enquanto ativado o evento ele fica renderizando na tela do Player tipo um loop bem rapido! Enquanto isso o Ped só é criado uma unica vez. Por isto a sobreposição da Imagem sobre o Ped! Não queria adicionar o Ped no Evento onClientRender por motivos de lag! Alguém conhece uma outra forma?
  4. This is the code: local normalScoreGorget = 0 local maxMegjelenit = 1 -------------------- for i, row in pairs(scoreboard_rows) do if (i > normalScoreGorget and elem < maxMegjelenit) then elem = elem + 1 if getElementType(row) == "player" then ---DX things here........ elseif getElementType(row) == "team" then ---DX things here........ end end end end bindKey("mouse_wheel_down", "down", function() if normalScoreGorget < #scoreboard_rows - maxMegjelenit then normalScoreGorget = normalScoreGorget + 1 end end ) bindKey("mouse_wheel_up", "down", function() if normalScoreGorget > 0 then normalScoreGorget = normalScoreGorget - 1 end end ) This is the bug: how can i fix this?.. :s
  5. I created a scoreboard script, and the playerlist working fine, but i dont know how to insert teams, and team players after the playerlist, like in the default scoreboard script.. :s Anyone can help me?
  6. I created a scoreboard system, but when i make a team, the team does not show in scoreboard.. how can i add this after playerlist?
  7. Więc jak w temacie TAB nie pokazuje listy graczy, jest zbindowane, byl reconnect, reinstalacja. Dopiero kiedy wlasciciel zmienił tablice na podstawową to zadziałało. Oczywiscie innym graczom działa normalnie. prawdopodobnie po prostu moje mta nie czyta skryptu czy coś to są (chyba logi z błędu): [2019-05-12 23:22:25] ERROR: community-scoreboard\dxscoreboard_client.lua:1190: attempt to perform arithmetic on a boolean value [2019-05-12 23:22:31] WARNING: community-scoreboard\dxscoreboard_client.lua:1190: Bad argument @ 'dxGetFontHeight' [Expected dx-font at argument 2, got boolean] [DUP x72] [2019-05-12 23:22:31] ERROR: community-scoreboard\dxscoreboard_client.lua:1190: attempt to perform arithmetic on a boolean value [DUP x72] [2019-05-12 23:22:35] WARNING: community-scoreboard\dxscoreboard_client.lua:1190: Bad argument @ 'dxGetFontHeight' [Expected dx-font at argument 2, got boolean] [2019-05-12 23:22:35] ERROR: community-scoreboard\dxscoreboard_client.lua:1190: attempt to perform arithmetic on a boolean value [2019-05-12 23:22:41] WARNING: community-scoreboard\dxscoreboard_client.lua:1190: Bad argument @ 'dxGetFontHeight' [Expected dx-font at argument 2, got boolean] [DUP x29] [2019-05-12 23:22:41] ERROR: community-scoreboard\dxscoreboard_client.lua:1190: attempt to perform arithmetic on a boolean value [DUP x29]
  8. Hi I started a few days ago lua scripting, my first project is an scoreboard. But i have an issue. I can't test my job, because don't have enought players on my custom server. I can join from my laptop, but this is just 2 player ( my pc and laptop). My question, that how can i set scoreboard bots (just a few, example 10) for the test?
  9. Encontrei depois de muito tempo um sistema de Patentes bem bacana, só que gostaria de saber como faço pra aparecer no scoreboard. alguém pode me ajudar ??? Se for necessário posto o script aqui com todos os créditos ao criador. Me ajudem !?
  10. This is my first time creating a MTA.SA Server, and I'm having trouble to find out how to add player's drift points to the scoreboard. I wanted it to show a "drift" column on the scoreboard, in a way that when a player get drift points it is added to the points he's got in other days too. The player would not lose the points when he logs out of the server, it would always keep adding the points, and showing them on the scoreboard. Could someone please help me to do that? I deeply thank you!
  11. I want create a custom scoreboard.. But, how to add players to it with rectangle, and dxdrawtext(s), and when there are xy players, how to make scrollable?? Sorry for my bad english.. :c
  12. How to make the country flag of a player in scoreboard? Country flag countryNames = { ["IT"]="Italy", ["MX"]="Mexico", ["SA"]="SAUDI ARBIA", ["PK"]="Pakistan", ["AF"]="Afghanistan", ["DZ"]="Algeria", ["AS"]="American samoa", ["AU"]="Australlia", ["AO"]="Anqola", ["AI"]="Anquilla", ["AQ"]="Antarctica", ["AG"]="Antigua and Barbuda", ["AR"]="Argentina", ["AM"]="Armenia", ["AW"]="Aruba", ["AT"]="Austria", ["AZ"]="Azerbaijan", ["BS"]="Bahamas", ["BH"]="Bahrain", ["BD"]="Bangladesh", ["BB"]="Barbados", ["BY"]="Belarus", ["BE"]="Belgium", ["BZ"]="Belize", ["BJ"]="Benin", ["BM"]="Bermuda", ["BT"]="Bhutan", ["BO"]="Bolivia", ["BA"]="Bosnia", ["BH"]="Herzegovina", ["BW"]="Botswana", ["BR"]="Brazil", ["IO"]="British Indian Ocean Territory", ["VG"]="British Virgin Islands", ["BN"]="Brunei", ["BG"]="Bulgaria", ["BF"]="Burkina Faso", ["MM"]="Burma (Myanmar)", ["BI"]="Burundi", ["KH"]="Cambodia", ["CM"]="Cameroon", ["CA"]="Canada", ["CV"]="Cape Verde", ["KY"]="Cayman Islands", ["CF"]="Central African Republic", ["TD"]="Chad", ["CL"]="Chile", ["CN"]="China", ["CX"]="Christmas Island", ["CC"]="Cocos (Keeling) Islands", ["CO"]="Colombia", ["KM"]="Comoros", ["CK"]="Cook Islands", ["CR"]="Costa Rica", ["HR"]="Croatia", ["CU"]="Cuba", ["CY"]="Cyprus", ["CZ"]="Czech Republic", ["CD"]="Democratic Republic of the Congo", ["DK"]="Denmark", ["DJ"]="Djibouti", ["DM"]="Dominica", ["DO"]="Dominican Republic", ["EC"]="Ecuador", ["SV"]="El Salvador", ["GQ"]="Equatorial Guinea", ["ER"]="Eritrea", ["EE"]="Estonia", ["ET"]="Ethiopia", ["FK"]="Falkland Islands", ["FO"]="Faroe Islands", ["FJ"]="Fiji", ["FI"]="Finland", ["FR"]="France", ["PF"]="French Polynesia", ["GA"]="Gabon", ["GM"]="Gambia", ["GE"]="Georgia", ["DE"]="Germany", ["GH"]="Ghana", ["GI"]="Gibraltar", ["GR"]="Greece", ["GL"]="Greenland", ["GD"]="Grenada", ["GU"]="Guam", ["GT"]="Guatemala", ["GN"]="Guinea", ["GW"]="Guinea-Bissau", ["GY"]="Guyana", ["HT"]="Haiti", ["VA"]="Holy See (Vatican City)", ["HN"]="Honduras", ["HK"]="Hong Kong", ["HU"]="Hungary", ["IS"]="Iceland", ["IN"]="India", ["ID"]="Indonesia", ["IR"]="Iran", ["IQ"]="Iraq", ["IE"]="Ireland", ["IM"]="Isle of Man", ["IL"]="Israel", ["IT"]="Italy", ["CI"]="Ivory Coast", ["JM"]="Jamaica", ["JP"]="Japan", ["JE"]="Jersey", ["JO"]="Jordan", ["KZ"]="Kazakhstan", ["KE"]="Kenya", ["KI"]="Kiribati", ["KO"]="Kosovo", ["KW"]="Kuwait", ["KG"]="Kyrgyzstan", ["LA"]="Laos", ["LV"]="Latvia", ["LB"]="Lebanon", ["LS"]="Lesotho", ["LR"]="Liberia", ["LY"]="Libya", ["LI"]="Liechtenstein", ["LT"]="Lithuania", ["LU"]="Luxembourg", ["MO"]="Macau", ["MK"]="Macedonia", ["MG"]="Madagascar", ["MW"]="Malawi", ["MY"]="Malaysia", ["MV"]="Maldives", ["ML"]="Mali", ["MT"]="Malta", ["MH"]="Marshall Islands", ["MR"]="Mauritania", ["MU"]="Mauritius", ["YT"]="Mayotte", ["MX"]="Mexico", ["FM"]="Micronesia", ["MD"]="Moldova", ["MC"]="Monaco", ["MN"]="Mongolia", ["ME"]="Montenegro", ["MS"]="Montserrat", ["MA"]="Morocco", ["MZ"]="Mozambique", ["NA"]="Namibia", ["NR"]="Nauru", ["NP"]="Nepal", ["NL"]="Netherlands", ["AN"]="Netherlands Antilles", ["NC"]="New Caledonia", ["NZ"]="New Zealand", ["NI"]="Nicaragua", ["NE"]="Niger", ["NG"]="Nigeria", ["NU"]="Niue", ["NI"]="Norfolk Island", ["KP"]="North Korea", ["MP"]="Northern Mariana Islands", ["NO"]="Norway", ["OM"]="Oman", ["PK"]="Pakistan", ["PW"]="Palau", ["PA"]="Panama", ["PG"]="Papua New Guinea", ["PY"]="Paraguay", ["PE"]="Peru", ["PH"]="Philippines", ["PN"]="Pitcairn Islands", ["PL"]="Poland", ["PT"]="Portugal", ["PR"]="Puerto Rico", ["QA"]="Qatar", ["CG"]="Republic of the Congo", ["RO"]="Romania", ["RU"]="Russia", ["RW"]="Rwanda", ["BL"]="Saint Barthelemy", ["SH"]="Saint Helena", ["KN"]="Saint Kitts and Nevis", ["LC"]="Saint Lucia", ["MF"]="Saint Martin", ["PM"]="Saint Pierre and Miquelon", ["VC"]="Saint Vincent and the Grenadines", ["WS"]="Samoa", ["SM"]="San Marino", ["ST"]="Sao Tome and Principe", ["SA"]="Saudi Arabia", ["SN"]="Senegal", ["RS"]="Serbia", ["SC"]="Seychelles", ["SL"]="Sierra Leone", ["SG"]="Singapore", ["SK"]="Slovakia", ["SI"]="Slovenia", ["SB"]="Solomon Islands", ["SO"]="Somalia", ["ZA"]="South Africa", ["KR"]="South Korea", ["ES"]="Spain", ["LK"]="Sri Lanka", ["SD"]="Sudan", ["SR"]="Suriname", ["SJ"]="Svalbard", ["SZ"]="Swaziland", ["SE"]="Sweden", ["CH"]="Switzerland", ["SY"]="Syria", ["TW"]="Taiwan", ["TJ"]="Tajikistan", ["TZ"]="Tanzania", ["TH"]="Thailand", ["TL"]="Timor-Leste", ["TG"]="Togo", ["TK"]="Tokelau", ["TO"]="Tonga", ["TT"]="Trinidad and Tobago", ["TN"]="Tunisia", ["TR"]="Turkey", ["TM"]="Turkmenistan", ["TC"]="Turks and Caicos Islands", ["TV"]="Tuvalu", ["UG"]="Uganda", ["UA"]="Ukraine", ["AE"]="United Arab Emirates", ["GB"]="United Kingdom", ["US"]="United States", ["UY"]="Uruguay", ["VI"]="US Virgin Islands", ["UZ"]="Uzbekistan", ["VU"]="Vanuatu", ["VE"]="Venezuela", ["VN"]="Vietnam", ["WF"]="Wallis and Futuna", ["WB"]="West Bank", ["EH"]="Western Sahara", ["YE"]="Yemen", ["ZM"]="Zambia", ["ZW"]="Zimbabwe" } function OnResourceStart() call(getResourceFromName("scoreboard"),"addScoreboardColumn","Country", getRootElement(), 10, 150) call(getResourceFromName("scoreboard"),"addScoreboardColumn"," flag", getRootElement(), 9, 16) local tPlayers = getElementsByType('player') for _,uPlayer in ipairs(tPlayers) do local countryCode = exports["admin"]:getPlayerCountry(uPlayer) local name = "Unknown" if countryCode and countryNames[countryCode] then name = countryNames[countryCode] local sFlagImagePath = ':'..getResourceName( getThisResource() )..'/flags/'..string.lower(countryCode)..'.png' if fileExists(sFlagImagePath) then setElementData(uPlayer, "countryFlagImage", sFlagImagePath ) else setElementData(uPlayer, "countryFlagImage", "??" ) end end setElementData(uPlayer, "Country", name ) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), OnResourceStart) and scoreboard local sw, sh = guiGetScreenSize() local fps = getPlayerPing(getLocalPlayer()) ColumnName = {{ name = "", width = 100, data = function (element) return getPlayerName ( element) end },} ColumnStats = { { name = "Murders", width = 100, data = function (element) return ( getElementData ( element, "murders" ) or 0 ) end }, { name = "Zombies", width = 100, data = function (element) return ( getElementData ( element, "zombieskilled" ) or 0 ) end }, { name = "Alive", width = 100, data = function (element) return formatTimeFromMinutes(getElementData ( element, "alivetime" ) or 1 ) end }, { name = "Ping", width = 80, data = function (element) return getPlayerPing ( element, "ping" ) or 99 end }, { name = "Group", width = 100, data = function (element) return getElementData ( element, "Group" ) or "None" end }, } local serverName = "Server" local topsize = 60 local playersize = topsize-30 local panelsize = playersize*1 function calculateWidth() local width = 0 for key, value in ipairs( ColumnName ) do width = width + value.width end for key, value in ipairs( ColumnStats ) do width = width + value.width end return width + 60 end local max_players = 50 local ploff = 0 local width = calculateWidth() local baseX = sw/2-width/2 local baseY = sh/2-(panelsize+topsize)/0.5 addEventHandler( "onClientRender", root, function() if getKeyState( "tab" ) == false then ploff = 0; return end if getElementData(getLocalPlayer(),"logedin") then dxDrawRectangle ( baseX, baseY-40, width, topsize+10, tocolor(0, 0, 0, 80) ) dxDrawRectangle ( baseX, baseY-40, width, topsize+40, tocolor(0, 0, 0, 40) ) dxDrawText ( serverName, baseX+53, baseY-45, baseX+width, baseY+topsize, tocolor(255,255,255,60), 2.6, "bankgothic" ) dxDrawRectangle ( baseX, baseY+topsize, width, panelsize, tocolor(0, 0, 0, 40) ) dxDrawLine ( baseX, baseY+panelsize+topsize, baseX+width, baseY+panelsize+topsize, tocolor(100,100,100,50),0.8 ) local xoff = 60 for i, v in ipairs ( ColumnName ) do dxDrawLine ( baseX+xoff+v.width, baseY+30, baseX+xoff+v.width, baseY+panelsize, tocolor(100,100,100),0.9 ) dxDrawText ( v.name, baseX+xoff, baseY+70, baseX+xoff+v.width+10, baseY+topsize-30, tocolor(255,255,255,255), 1, "default-bold", "center", "center" ) xoff = xoff+v.width end for i, v in ipairs ( ColumnStats ) do dxDrawLine ( baseX+xoff+v.width, baseY+30, baseX+xoff+v.width, baseY+panelsize, tocolor(100,100,100),0.9 ) dxDrawText ( v.name, baseX+xoff, baseY+60, baseX+xoff+v.width, baseY+topsize-30, tocolor(255,255,255,255), 1, "default-bold", "center", "center" ) xoff = xoff+v.width end local playersTable = getElementsByType ( "player" ) dxDrawText ( "Players: "..tostring(#playersTable).."/"..tostring(max_players), baseX -550, baseY+60, baseX+width, baseY+30, tocolor(255,255,255,255), 1, "default-bold", "center", "center" ) local maxNum = #playersTable if maxNum > 10 then maxNum = 10 end for i = 1, maxNum do dxDrawLine ( baseX, baseY+topsize+playersize*i, baseX+width, baseY+topsize+playersize*i, tocolor(0, 0, 0, 40),0.5 ) dxDrawText ( i+ploff, baseX, baseY+topsize+playersize*(i-1), baseX+25, baseY+topsize+playersize*i, tocolor(255, 255, 255,255), 1, "default-bold", "center", "center" ) if playersTable[i+ploff] == localPlayer then dxDrawRectangle ( baseX, baseY+topsize+playersize*(i-1), width, playersize, tocolor(0, 0, 0, 60) ) else dxDrawRectangle ( baseX, baseY+topsize+playersize*(i-1), width, playersize, tocolor(0, 0, 0, 30) ) end local xoff = 60 for c, d in ipairs ( ColumnName ) do local data = d.data(playersTable[i+ploff]) --local r,g,b = 255,255,255,50 dxDrawText ( data, baseX+xoff-40, baseY+topsize+playersize*(i-1), baseX+xoff+d.width-10, baseY+topsize+playersize*i, tocolor(255, 255, 255,255), 0.9, "default-bold", "center", "center" ) xoff = xoff+d.width end for c, d in ipairs ( ColumnStats ) do local data = d.data(playersTable[i+ploff]) local r,g,b = 255, 255, 255,255 if d.name == "Group" and data == "None" then r,g,b = 249,41,0 data = "None" end dxDrawText ( data, baseX+xoff, baseY+topsize+playersize*(i-1), baseX+xoff+d.width-5, baseY+topsize+playersize*i, tocolor(r,g,b), 0.9, "default-bold", "center", "center" ) xoff = xoff+d.width end end end end ) function PlayerScrollMenu (key,keyState,arg) if getElementData(localPlayer,"logedin") and getKeyState( "F4" ) then if ( keyState == "down" ) then if arg == "up" then if ploff > 0 then ploff=ploff-1 end elseif arg == "down" then local playersTable = getElementsByType ( "player" ) if ploff < #playersTable-10 then ploff = ploff+1 end end end end end bindKey ( "mouse_wheel_up", "down", PlayerScrollMenu, "up" ) bindKey ( "mouse_wheel_down", "down", PlayerScrollMenu, "down" ) function formatTimeFromMinutes(value) if value then local hours = math.floor(value/60) local minutes = math.round(((value/60) - math.floor(value/60))*100/(100/60)) if hours then if hours == 0 then value = minutes.." min" end elseif hours >= 1 then value = hours.." ч "..minutes.." min" end return value end return false end 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 sendMaxPlayersOnServer (players) max_players = players end addEvent("sendMaxPlayersOnServer",true) addEventHandler("sendMaxPlayersOnServer",getLocalPlayer(),sendMaxPlayersOnServer) Please help me!
  13. so hello so i tried adding days and weeks but all i got was error and i can't figure way how to make days from hours and then weeks from days code: exports.scoreboard:addScoreboardColumn('time') local t = { } function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hour = tonumber( t[ v ][ 'hour' ] or 0 ) setElementData( v, "time", tostring( hour )..'h '..tostring( min )..'min.' ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'time' ) local hour = tonumber( t[ source ][ 'hour' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "time-hour", tostring(hour) ) setAccountData ( playeraccount, "time-min", tostring(min) ) setAccountData ( playeraccount, "time-sec", tostring(sec) ) setAccountData ( playeraccount, "time", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "time" ) local hou = getAccountData ( playeraccount, "time-hour") local min = getAccountData ( playeraccount, "time-min") local sec = getAccountData ( playeraccount, "time-sec") if ( time ) then setElementData ( source, "time", time ) t[ source ]["hour"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "time",0 ) setAccountData ( playeraccount, "time",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin )
  14. Can anyone edit this script i lost mine, please im new member :DD
  15. Hola buenas a todos, por favor me podrían ayudar con un problema que tengo con un script, es el de banderas en el scoreboard, y es cierto que está en la comunidad, pero al momento de ejecutar no aparece la bandera solo el nonbre del país, de antemano muchas gracias... aquí el script... -- ScoreBoard Country Script by ToXiiC -- Skype: toxiic_eu countryNames = { ["IT"]="Italy", ["MX"]="Mexico", ["SA"]="SAUDI ARBIA", ["PK"]="Pakistan", ["AF"]="Afghanistan", ["DZ"]="Algeria", ["AS"]="American samoa", ["AU"]="Australlia", ["AO"]="Anqola", ["AI"]="Anquilla", ["AQ"]="Antarctica", ["AG"]="Antigua and Barbuda", ["AR"]="Argentina", ["AM"]="Armenia", ["AW"]="Aruba", ["AT"]="Austria", ["AZ"]="Azerbaijan", ["BS"]="Bahamas", ["BH"]="Bahrain", ["BD"]="Bangladesh", ["BB"]="Barbados", ["BY"]="Belarus", ["BE"]="Belgium", ["BZ"]="Belize", ["BJ"]="Benin", ["BM"]="Bermuda", ["BT"]="Bhutan", ["BO"]="Bolivia", ["BA"]="Bosnia", ["BH"]="Herzegovina", ["BW"]="Botswana", ["BR"]="Brazil", ["IO"]="British Indian Ocean Territory", ["VG"]="British Virgin Islands", ["BN"]="Brunei", ["BG"]="Bulgaria", ["BF"]="Burkina Faso", ["MM"]="Burma (Myanmar)", ["BI"]="Burundi", ["KH"]="Cambodia", ["CM"]="Cameroon", ["CA"]="Canada", ["CV"]="Cape Verde", ["KY"]="Cayman Islands", ["CF"]="Central African Republic", ["TD"]="Chad", ["CL"]="Chile", ["CN"]="China", ["CX"]="Christmas Island", ["CC"]="Cocos (Keeling) Islands", ["CO"]="Colombia", ["KM"]="Comoros", ["CK"]="Cook Islands", ["CR"]="Costa Rica", ["HR"]="Croatia", ["CU"]="Cuba", ["CY"]="Cyprus", ["CZ"]="Czech Republic", ["CD"]="Democratic Republic of the Congo", ["DK"]="Denmark", ["DJ"]="Djibouti", ["DM"]="Dominica", ["DO"]="Dominican Republic", ["EC"]="Ecuador", ["SV"]="El Salvador", ["GQ"]="Equatorial Guinea", ["ER"]="Eritrea", ["EE"]="Estonia", ["ET"]="Ethiopia", ["FK"]="Falkland Islands", ["FO"]="Faroe Islands", ["FJ"]="Fiji", ["FI"]="Finland", ["FR"]="France", ["PF"]="French Polynesia", ["GA"]="Gabon", ["GM"]="Gambia", ["GE"]="Georgia", ["DE"]="Germany", ["GH"]="Ghana", ["GI"]="Gibraltar", ["GR"]="Greece", ["GL"]="Greenland", ["GD"]="Grenada", ["GU"]="Guam", ["GT"]="Guatemala", ["GN"]="Guinea", ["GW"]="Guinea-Bissau", ["GY"]="Guyana", ["HT"]="Haiti", ["VA"]="Holy See (Vatican City)", ["HN"]="Honduras", ["HK"]="Hong Kong", ["HU"]="Hungary", ["IS"]="Iceland", ["IN"]="India", ["ID"]="Indonesia", ["IR"]="Iran", ["IQ"]="Iraq", ["IE"]="Ireland", ["IM"]="Isle of Man", ["IL"]="Israel", ["IT"]="Italy", ["CI"]="Ivory Coast", ["JM"]="Jamaica", ["JP"]="Japan", ["JE"]="Jersey", ["JO"]="Jordan", ["KZ"]="Kazakhstan", ["KE"]="Kenya", ["KI"]="Kiribati", ["KO"]="Kosovo", ["KW"]="Kuwait", ["KG"]="Kyrgyzstan", ["LA"]="Laos", ["LV"]="Latvia", ["LB"]="Lebanon", ["LS"]="Lesotho", ["LR"]="Liberia", ["LY"]="Libya", ["LI"]="Liechtenstein", ["LT"]="Lithuania", ["LU"]="Luxembourg", ["MO"]="Macau", ["MK"]="Macedonia", ["MG"]="Madagascar", ["MW"]="Malawi", ["MY"]="Malaysia", ["MV"]="Maldives", ["ML"]="Mali", ["MT"]="Malta", ["MH"]="Marshall Islands", ["MR"]="Mauritania", ["MU"]="Mauritius", ["YT"]="Mayotte", ["MX"]="Mexico", ["FM"]="Micronesia", ["MD"]="Moldova", ["MC"]="Monaco", ["MN"]="Mongolia", ["ME"]="Montenegro", ["MS"]="Montserrat", ["MA"]="Morocco", ["MZ"]="Mozambique", ["NA"]="Namibia", ["NR"]="Nauru", ["NP"]="Nepal", ["NL"]="Netherlands", ["AN"]="Netherlands Antilles", ["NC"]="New Caledonia", ["NZ"]="New Zealand", ["NI"]="Nicaragua", ["NE"]="Niger", ["NG"]="Nigeria", ["NU"]="Niue", ["NI"]="Norfolk Island", ["KP"]="North Korea", ["MP"]="Northern Mariana Islands", ["NO"]="Norway", ["OM"]="Oman", ["PK"]="Pakistan", ["PW"]="Palau", ["PA"]="Panama", ["PG"]="Papua New Guinea", ["PY"]="Paraguay", ["PE"]="Peru", ["PH"]="Philippines", ["PN"]="Pitcairn Islands", ["PL"]="Poland", ["PT"]="Portugal", ["PR"]="Puerto Rico", ["QA"]="Qatar", ["CG"]="Republic of the Congo", ["RO"]="Romania", ["RU"]="Russia", ["RW"]="Rwanda", ["BL"]="Saint Barthelemy", ["SH"]="Saint Helena", ["KN"]="Saint Kitts and Nevis", ["LC"]="Saint Lucia", ["MF"]="Saint Martin", ["PM"]="Saint Pierre and Miquelon", ["VC"]="Saint Vincent and the Grenadines", ["WS"]="Samoa", ["SM"]="San Marino", ["ST"]="Sao Tome and Principe", ["SA"]="Saudi Arabia", ["SN"]="Senegal", ["RS"]="Serbia", ["SC"]="Seychelles", ["SL"]="Sierra Leone", ["SG"]="Singapore", ["SK"]="Slovakia", ["SI"]="Slovenia", ["SB"]="Solomon Islands", ["SO"]="Somalia", ["ZA"]="South Africa", ["KR"]="South Korea", ["ES"]="Spain", ["LK"]="Sri Lanka", ["SD"]="Sudan", ["SR"]="Suriname", ["SJ"]="Svalbard", ["SZ"]="Swaziland", ["SE"]="Sweden", ["CH"]="Switzerland", ["SY"]="Syria", ["TW"]="Taiwan", ["TJ"]="Tajikistan", ["TZ"]="Tanzania", ["TH"]="Thailand", ["TL"]="Timor-Leste", ["TG"]="Togo", ["TK"]="Tokelau", ["TO"]="Tonga", ["TT"]="Trinidad and Tobago", ["TN"]="Tunisia", ["TR"]="Turkey", ["TM"]="Turkmenistan", ["TC"]="Turks and Caicos Islands", ["TV"]="Tuvalu", ["UG"]="Uganda", ["UA"]="Ukraine", ["AE"]="United Arab Emirates", ["GB"]="United Kingdom", ["US"]="United States", ["UY"]="Uruguay", ["VI"]="US Virgin Islands", ["UZ"]="Uzbekistan", ["VU"]="Vanuatu", ["VE"]="Venezuela", ["VN"]="Vietnam", ["WF"]="Wallis and Futuna", ["WB"]="West Bank", ["EH"]="Western Sahara", ["YE"]="Yemen", ["ZM"]="Zambia", ["ZW"]="Zimbabwe" } function OnResourceStart() call(getResourceFromName("scoreboard"),"addScoreboardColumn","Country", getRootElement(), 10, 150) call(getResourceFromName("scoreboard"),"addScoreboardColumn"," flag", getRootElement(), 9, 16) local tPlayers = getElementsByType('player') for _,uPlayer in ipairs(tPlayers) do local countryCode = exports["admin"]:getPlayerCountry(uPlayer) local name = "Unknown" if countryCode and countryNames[countryCode] then name = countryNames[countryCode] local sFlagImagePath = ':'..getResourceName( getThisResource() )..'/flags/'..string.lower(countryCode)..'.png' if fileExists(sFlagImagePath) then setElementData(uPlayer, "countryFlagImage", sFlagImagePath ) else setElementData(uPlayer, "countryFlagImage", "??" ) end end setElementData(uPlayer, "Country", name ) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), OnResourceStart) function OnPlayerJoin () local countryCode = exports["admin"]:getPlayerCountry(source) local name = "Unknown" if countryCode and countryNames[countryCode] then name = countryNames[countryCode] local sFlagImagePath = ':'..getResourceName( getThisResource() )..'/flags/'..string.lower(countryCode)..'.png' if fileExists(sFlagImagePath) then setElementData( source, "countryFlagImage", sFlagImagePath ) else setElementData( source, "countryFlagImage", "??" ) end end setElementData(source, "Country", name) outputChatBox("#00a8ff* [Join] #00a8ff" .. getPlayerName(source) .. "#00a8ff has joined the game from: #ECECEC" .. name, getRootElement(), 151, 151, 151, true) end addEventHandler("onPlayerJoin", getRootElement(), OnPlayerJoin)
  16. user123

    Scoreboard settings

    Accidentally in the setting of the scoreboard I put a scale of 4 And now when I press tab the scoreboard Is larger than the screen and the settings button no longer appears.
  17. Hello, I'm having a slight problem which I'm really hoping to find an answer for. I'm using lil_toady's admin panel on my server, associated with it's "team-system". When a team is created, it's also sent to the scoreboard (TAB BUTTON). The problem is, I'd want to hide the team when none of it's members are online. Currently, when nobody is online from the team, all it does is shows the team name and then "0 players" at the end. Is there a way to fix this? Thank you in advance.
  18. Estaba aburrido y llevaba bastante tiempo sin scriptear así que me puse a buscar por la wiki funciones que nunca usé y encontré dxDrawMaterialLine3D. Aquí os dejo un vídeo y el código de un scoreboard simple que he hecho para probar la función, por si os es útil el tema del scroll y lo que podáis encontrar. Código Client-Side:
  19. Hola, buenas noticias para todos, espero que estés muy bien. Quiero que me ayude con esto estoy editando un marcador y cuando lo activo y entro en mi servidor con mi seudónimo por ejemplo, # FF0000Akranes el código se ve en el marcador Quiero que me ayude con ese pequeño error por favor, no sé cómo hacer que se vaya sin los códigos -- -- Update the scoreboard content -- local currentTick = getTickCount() if (currentTick - scoreboardTicks.lastUpdate > scoreboardTicks.updateInterval and (scoreboardToggled or scoreboardForced)) or forceScoreboardUpdate then forceScoreboardUpdate = false scoreboardContent = {} local index = 1 local sortTableIndex = 1 local sortTable = {} local players = getElementsByType( "player" ) for key, player in ipairs( players ) do if not getPlayerTeam( player ) or not (showTeams or (serverInfo.forceshowteams and not serverInfo.forcehideteams)) or serverInfo.forcehideteams then sortTable[sortTableIndex] = {} for key, column in ipairs( scoreboardColumns ) do local content if column.name == "name" then local playerName = getPlayerName( player ) if serverInfo.allowcolorcodes then if string.find( playerName, "#%x%x%x%x%x%x" ) then local colorCodes = {} while( string.find( playerName, "#%x%x%x%x%x%x" ) ) do local startPos, endPos = string.find( playerName, "#%x%x%x%x%x%x" ) if startPos then colorCode = string.sub( playerName, startPos, endPos ) table.insert( colorCodes, { { getColorFromString( colorCode ) }, startPos } ) playerName = string.gsub( playerName, "#%x%x%x%x%x%x", "", 1 ) end end content = { playerName, colorCodes } else content = playerName end else content = playerName end elseif column.name == "ping" then content = getPlayerPing( player ) else content = getElementData( player, column.name ) end content = iif( content and column.name ~= "name" and type( content ) ~= "table", tostring( content ), content ) if column.textFunction then if content and column.name == "name" and type( content ) == "table" then content[1] = column.textFunction( content[1], player ) else content = column.textFunction( content, player ) end end sortTable[sortTableIndex][column.name] = content sortTable[sortTableIndex]["__SCOREBOARDELEMENT__"] = player end sortTableIndex = sortTableIndex + 1 end end if sortBy.what ~= "__NONE__" then table.sort( sortTable, scoreboardSortFunction ) end for key, value in ipairs( sortTable ) do scoreboardContent[index] = value index = index + 1 end if (showTeams or (serverInfo.forceshowteams and not serverInfo.forcehideteams)) and not serverInfo.forcehideteams then -- And then the teams local teamSortTableIndex = 1 local teamSortTable = {} sortTableIndex = 1 sortTable = {} local teams = getElementsByType( "team" ) for key, team in ipairs( teams ) do -- Add teams to sorting table first teamSortTable[teamSortTableIndex] = {} for key, column in ipairs( scoreboardColumns ) do local content if column.name == "name" then local teamName = getTeamName( team ) local teamMemberCount = #getPlayersInTeam( team ) teamName = iif( teamName, tostring( teamName ), "-" ) teamMemberCount = iif( teamMemberCount, tostring( teamMemberCount ), "0" ) teamName = teamName .. " (" .. teamMemberCount .. " player" .. iif( teamMemberCount == "1", "", "s" ) .. ")" if serverInfo.allowcolorcodes then if string.find( teamName, "#%x%x%x%x%x%x" ) then local colorCodes = {} while( string.find( teamName, "#%x%x%x%x%x%x" ) ) do local startPos, endPos = string.find( teamName, "#%x%x%x%x%x%x" ) if startPos then colorCode = string.sub( teamName, startPos, endPos ) table.insert( colorCodes, { { getColorFromString( colorCode ) }, startPos } ) teamName = string.gsub( teamName, "#%x%x%x%x%x%x", "", 1 ) end end content = { teamName, colorCodes } else content = teamName end else content = teamName end else content = getElementData( team, column.name ) end content = iif( content and column.name ~= "name" and type( content ) ~= "table", tostring( content ), content ) if column.textFunction then if content and column.name == "name" and type( content ) == "table" then content[1] = column.textFunction( content[1], team ) else content = column.textFunction( content, team ) end end teamSortTable[teamSortTableIndex][column.name] = content teamSortTable[teamSortTableIndex]["__SCOREBOARDELEMENT__"] = team end teamSortTableIndex = teamSortTableIndex + 1 -- and then the players sortTableIndex = 1 sortTable[team] = {} local players = getPlayersInTeam( team ) for key, player in ipairs( players ) do sortTable[team][sortTableIndex] = {} for key, column in ipairs( scoreboardColumns ) do local content if column.name == "name" then local playerName = getPlayerName( player ) if serverInfo.allowcolorcodes then if string.find( playerName, "#%x%x%x%x%x%x" ) then local colorCodes = {} while( string.find( playerName, "#%x%x%x%x%x%x" ) ) do local startPos, endPos = string.find( playerName, "#%x%x%x%x%x%x" ) if startPos then colorCode = string.sub( playerName, startPos, endPos ) table.insert( colorCodes, { { getColorFromString( colorCode ) }, startPos } ) playerName = string.gsub( playerName, "#%x%x%x%x%x%x", "", 1 ) end end content = { playerName, colorCodes } else content = playerName end else content = playerName end elseif column.name == "ping" then content = getPlayerPing( player ) else content = getElementData( player, column.name ) end content = iif( content and column.name ~= "name" and type( content ) ~= "table", tostring( content ), content ) if column.textFunction then if content and column.name == "name" and type( content ) == "table" then content[1] = column.textFunction( content[1], player ) else content = column.textFunction( content, player ) end end sortTable[team][sortTableIndex][column.name] = content sortTable[team][sortTableIndex]["__SCOREBOARDELEMENT__"] = player end sortTableIndex = sortTableIndex + 1 end if sortBy.what ~= "__NONE__" then table.sort( sortTable[team], scoreboardSortFunction ) end end if sortBy.what ~= "__NONE__" then table.sort( teamSortTable, scoreboardSortFunction ) end for key, content in ipairs( teamSortTable ) do local team = content["__SCOREBOARDELEMENT__"] scoreboardContent[index] = content index = index + 1 for key, value in ipairs( sortTable[team] ) do scoreboardContent[index] = value index = index + 1 end end end scoreboardTicks.lastUpdate = currentTick end
×
×
  • Create New...