Jump to content

Problema con Enter y Leave


Alexs

Recommended Posts

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

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

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:

2878t1.png

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...