Looney;3 Posted August 11, 2016 Posted August 11, 2016 Hola, Quisiera preguntar si alguien me podria decir que estoy haciendo mal o que deberia arreglar en este script. Segun algunos players este script da lag , pero a otros les anda 0 lag if alive[1] >= 1 then local playersInTeam = getPlayersInTeam ( homeTeam ) dxDrawRectangle(0.85*sX,0.01*sY,0.15*sX,0.03*sY,tocolor(11,11,11,200),false) dxDrawEmptyRectangle(0.85*sX,0.01*sY,0.15*sX,0.03*sY, tocolor(r1, g1, b1,200), 0.5, false) dxDrawText (""..tostring(homeName).."#FFFFFF PLAYERS ("..THColor..alive[1].."#FFFFFF) POINTS "..THColor..points[1],0.86*sW, 0.015*sH, 0*sW, 0*sH, tocolor(r1, g1, b1), 0.65*sW/sH*scale, font,'left', 'top', false,false,false,true) for playerKey, playerValue in ipairs (playersInTeam) do local playerKeyH = playerKey local playerValueH = playerValue setElementData(localPlayer,"playerKeyHome",playerKeyH) setElementData(localPlayer,"playerValueHome",playerValueH) dxDrawText (""..getPlayerName(playerValue),0.86*sW, 0.016*sH+((0.03*sH)*playerKey), 0*sW, 0*sH, tocolor(r1, g1, b1), 0.65*sW/sH*scale, font,'left', 'top', false,false,false,true) if (tostring(getElementData(playerValueH, "state")) == "alive") then dxDrawImageSection ( 0.97*sX, 0.01*sY+((0.03*sH)*playerKey), 0.02*sX, 0.03*sY, 3, 0, 115, 115,"img/logo.png", 0, 0, 0, tocolor (255,22,22,255), false ) else dxDrawImageSection ( 0.97*sX, 0.01*sY+((0.03*sH)*playerKey), 0.02*sX, 0.03*sY, 3, 0, 115, 115,"img/logo.png", 0, 0, 0, tocolor (255,55,55,100), false ) end end else dxDrawRectangle(0.85*sX,0.01*sY,0.15*sX,0.03*sY,tocolor(11,11,11,200),false) dxDrawEmptyRectangle(0.85*sX,0.01*sY,0.15*sX,0.03*sY, tocolor(r1, g1, b1,200), 0.5, false) dxDrawText (""..tostring(homeName).."#FFFFFF PLAYERS ("..THColor.."0#FFFFFF) POINTS "..THColor..points[1],0.86*sW, 0.0*sH+(0.015*sH), 0*sW, 0*sH, tocolor(r1, g1, b1), 0.65*sW/sH*scale, font,'left', 'top', false,false,false,true) dxDrawText ("No Players On The Team",0.86*sW, 0.032*sH+(0.015*sH), 0*sW, 0*sH, tocolor(r1, g1, b1), 0.65*sW/sH*scale, font,'left', 'top', false,false,false,true) end Gracias
aka Blue Posted August 11, 2016 Posted August 11, 2016 No entiendo. Nos dejas una foto y un código así por la cara... no entiendo nada. Por ejemplo, ¿el alive[1] de dónde viene? Debes postear bien, para que lo entendamos.
Simple02 Posted August 11, 2016 Posted August 11, 2016 Los elementData suelen dar mucho lag y también se puede deber a falta de optimización en cuanto tablas y loops.
Looney;3 Posted August 11, 2016 Author Posted August 11, 2016 El alive[] es para que salgan los players solo cuando son mas de 0 y si no, no sale.
Looney;3 Posted August 11, 2016 Author Posted August 11, 2016 Los elementData suelen dar mucho lag y también se puede deber a falta de optimización en cuanto tablas y loops. Me podrias ayudar a saber sobre la optimizacion de tablas? No soy muy bueno y estoy aprendiendo Gracias
Simple02 Posted August 11, 2016 Posted August 11, 2016 Ayudar en temas de optimzacion? Con todo gusto manda PM
Recommended Posts