Looney;3 Posted December 1, 2016 Share Posted December 1, 2016 Hola Soy nuevo con esto de los Scoreboards y nececito ayuda estoy haciendo uno pero la verdad no me sale muy bien que digamos jaja Client.lua local sX,sY = guiGetScreenSize() function Background() if not getKeyState("tab") then return end dxDrawRectangle(0*sX,0*sY,sX,0.1*sY,tocolor(0,0,0,200)) dxDrawRectangle(0*sX,0.095*sY,sX,0.005*sY,tocolor(0,130,255,200)) dxDrawImage(0.42*sX, -0.04*sY, sX/7, sY/7,"files/logo.png",0,0,0,tocolor(22,22,22,255)) dxDrawText ("INSANE STYLE GAMERS",0.05*sX, 0.025*sY, 0*sX, 0*sY, tocolor(0, 130, 255), 2*sX/sY*scale, font,'left', 'top', false,false,false,true) dxDrawText ("NEVER LOSE HOPE",0.55*sX, 0.025*sY, 0*sX, 0*sY, tocolor(255, 80, 80), 2*sX/sY*scale, font,'left', 'top', false,false,false,true) for i, name in ipairs (getElementsByType("player")) do local r,g,b = getTeamColor(getPlayerTeam(name)) dxDrawRectangle(0.25*sX,0.4*sY+((0.03*sY)*i),0.5*sX,0.03*sY,tocolor(11,11,11,200)) dxDrawText (""..(getElementData(name,"ID") or 0),0.26*sX, 0.405*sY+((0.03*sY)*i), 0*sX, 0*sY, tocolor(255, 255, 255), 0.65*sX/sY*scale, font,'left', 'top', false,false,false,true) dxDrawText (""..string.format("#%02x%02x%02x",r,g,b)..(getPlayerNametagText(name) or "Anonymous"),0.28*sX, 0.405*sY+((0.03*sY)*i), 0*sX, 0*sY, tocolor(255, 255, 255), 0.65*sX/sY*scale, font,'left', 'top', false,false,false,true) -- dxDrawText (""..(getElementData(nick,"Cash") or "Guest"),0.35*sX, 0.405*sY+((0.03*sY)*i), 0*sX, 0*sY, tocolor(255, 255, 255), 0.65*sX/sY*scale, font,'left', 'top', false,false,false,true) dxDrawText (""..(getElementData(name,"Points") or "Guest"),0.41*sX, 0.405*sY+((0.03*sY)*i), 0*sX, 0*sY, tocolor(255, 255, 255), 0.65*sX/sY*scale, font,'left', 'top', false,false,false,true) dxDrawText (""..(getElementData(name,"Rank") or "Guest"),0.47*sX, 0.405*sY+((0.03*sY)*i), 0*sX, 0*sY, tocolor(255, 255, 255), 0.65*sX/sY*scale, font,'left', 'top', false,false,false,true) --dxDrawText (""..(getElementData(nick,"State") or "Guest"),0.53*sX, 0.405*sY+((0.03*sY)*i), 0*sX, 0*sY, tocolor(255, 255, 255), 0.65*sX/sY*scale, font,'left', 'top', false,false,false,true) --dxDrawText (""..(getElementData(nick,"Country") or "Narnia"),0.59*sX, 0.405*sY+((0.03*sY)*i), 0*sX, 0*sY, tocolor(255, 255, 255), 0.65*sX/sY*scale, font,'left', 'top', false,false,false,true) dxDrawImage ( 0.59*sX, 0.402*sY+((0.03*sY)*i), 0.03*sX, 0.025*sY,":admin/client/images/flags/"..(getElementData(name,"country") or "Narnia"):lower()..".png", 0, 0, 0, tocolor (255,255,255,255), false ) dxDrawText (""..(getElementData(name,"FPS") or "Guest"),0.65*sX, 0.405*sY+((0.03*sY)*i), 0*sX, 0*sY, tocolor(255, 255, 255), 0.65*sX/sY*scale, font,'left', 'top', false,false,false,true) dxDrawText (""..(getPlayerPing(name) or "Guest"),0.71*sX, 0.405*sY+((0.03*sY)*i), 0*sX, 0*sY, tocolor(255, 255, 255), 0.65*sX/sY*scale, font,'left', 'top', false,false,false,true) if (tostring(getElementData(name, "state")) == "alive") then dxDrawImageSection ( 0.53*sX, 0.399*sY+((0.03*sY)*i), 0.02*sX, 0.03*sY, 3, 0, 115, 115,"files/alive.png", 0, 0, 0, tocolor (255,22,22,255), false ) else dxDrawImageSection ( 0.53*sX, 0.399*sY+((0.03*sY)*i), 0.02*sX, 0.03*sY, 3, 0, 115, 115,"files/alive.png", 0, 0, 0, tocolor (255,55,55,100), false ) end end for i, team in ipairs (getElementsByType("team")) do local PlayersWithTeam = getPlayersInTeam(team) if #PlayersWithTeam == 0 then else local teamName = getTeamName(team) local r,g,b = getTeamColor(team) dxDrawRectangle(0.25*sX,0.4*sY+((0.03*sY)*i),0.5*sX,0.03*sY,tocolor(11,11,11,220)) dxDrawText (""..teamName,0.26*sX, 0.405*sY+((0.03*sY)*i), 0*sX, 0*sY, tocolor(r,g,b), 0.65*sX/sY*scale, font,'left', 'top', false,false,false,true) end end end function StartDates() for i, name in ipairs (getElementsByType("player")) do nick = name i = nameid end end function Start() addEventHandler("onClientRender",getRootElement(),StartDates) addEventHandler("onClientRender",root,Background) end addEventHandler("onClientResourceStart",root,Start) Link to comment
Recommended Posts