Alexs Posted August 1, 2012 Share Posted August 1, 2012 Hola a Todos, hice esto: botred = guiCreateStaticImage(0.2013,0.2517,0.2475,0.4467,"Teams/Red.png",true) botblue = guiCreateStaticImage(0.5575,0.225,0.2688,0.4917,"images/Blue.png",true) function bigImage ( ) if (source == botblue) then local gxb,gyb = guiGetSize(botblue) guiSetSize ( botblue, gxb + 0.075, gyb + 0.075, true ) playSound("Sounds/button.mp3") elseif (source == botred) then local gxr,gyr = guiGetSize(botred) guiSetSize ( botblue, gxr + 0.075, gyr + 0.075, true ) playSound("Sounds/button.mp3") end end addEventHandler("onClientMouseEnter", root, bigImage) function smallImage ( ) if (source == botblue) then local gxbd,gybd = guiGetSize(botblue) guiSetSize ( botblue, gxbd - 0.075, gybd - 0.075, true ) elseif (source == botred) then local gxrd,gyrd = guiGetSize(botred) guiSetSize ( botblue, gxrd - 0.075, gyrd - 0.075, true ) end end addEventHandler("onClientMouseLeave", root, smallImage) Se supone q al tocar la imagen esta crece en 0.075 relativo, pero dice que gxrd gyrd gxr y hyr es un boolean y no se ve la imagen azul al entrar al servidor, que esta mal? Link to comment
Castillo Posted August 1, 2012 Share Posted August 1, 2012 La imagen del azul no carga porque pusiste: "images/Blue.png", pero en el rojo usas: "Teams/Red.png". Y el otro problema es que en guiGetSize te olvidaste del segundo argumento. botred = guiCreateStaticImage(0.2013,0.2517,0.2475,0.4467,"Teams/Red.png",true) botblue = guiCreateStaticImage(0.5575,0.225,0.2688,0.4917,"Teams/Blue.png",true) function bigImage ( ) if ( source == botblue ) then local gxb, gyb = guiGetSize ( source, true ) guiSetSize ( source, ( gxb + 0.075 ), ( gyb + 0.075 ), true ) playSound ( "Sounds/button.mp3" ) elseif ( source == botred ) then local gxr,gyr = guiGetSize ( source, true ) guiSetSize ( source, ( gxr + 0.075 ), ( gyr + 0.075 ), true ) playSound ( "Sounds/button.mp3" ) end end addEventHandler ( "onClientMouseEnter", root, bigImage ) function smallImage ( ) if ( source == botblue ) then local x, y = guiGetSize ( source, true ) guiSetSize ( source, ( x - 0.075 ), ( y - 0.075 ), true ) elseif ( source == botred ) then local x, y = guiGetSize ( source, true ) guiSetSize ( source, ( x - 0.075 ), ( y - 0.075 ), true ) end end addEventHandler ( "onClientMouseLeave", root, smallImage ) Link to comment
Alexs Posted August 1, 2012 Author Share Posted August 1, 2012 2 Cosas que me aparecieron ahora: Me cargo bien el client asi que el server ahora marca los errores de esto, lee el debugscript de la foto: http://i47.tinypic.com/2878t1.png function getDefinitions ( startedMap ) local mapRoot = getResourceRootElement ( startedMap ) local spawnred = getElementsByType ( "spawnred", mapRoot ) local spawnblue = getElementsByType ( "spawnblue", mapRoot ) for teamr, rojos in pairs ( getPlayersInTeam ( Rojos ) ) do local randomPoint = math.random ( #getElementsByType ( "spawnred", mapRoot ) ) local x, y, z = unpack ( getElementData ( getElementsByType ( "spawnred", mapRoot ) [ randomPoint ], "position" ) ) local rot = getElementData ( getElementsByType ( "spawnred", mapRoot ) [ randomPoint ], "rotation" ) spawnPlayer ( rojos, x, y, z, rot, 170 ) end for teamb, azules in pairs ( getPlayersInTeam ( Blue ) ) do local randomPoint = math.random ( #getElementsByType ( "spawnblue", mapRoot ) ) local x, y, z = unpack ( getElementData ( getElementsByType ( "spawnblue", mapRoot ) [ randomPoint ], "position" ) ) local rot = getElementData ( getElementsByType ( "spawnblue", mapRoot ) [ randomPoint ], "rotation" ) spawnPlayer ( azules, x, y, z, rot, 188 ) end end addEventHandler ( "onGamemodeMapStart", getRootElement(), getDefinitions ) Link to comment
Castillo Posted August 1, 2012 Share Posted August 1, 2012 Donde esta definido: Blue y Red? Link to comment
Recommended Posts