Jump to content

onClientMouseEnter


papam77

Recommended Posts

Posted
function login () 
showCursor ( true ) 
  
  
bg = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "img/bg.png", true) 
window = guiCreateStaticImage(0.30, 0.32, 0.40, 0.34, "img/login_window.png", true, bg) 
login = guiCreateStaticImage(0.70, 0.44, 0.21, 0.13, "img/login.png", true, window) 
guest = guiCreateStaticImage(0.70, 0.59, 0.21, 0.13, "img/guest.png", true, window)  
------------------------- 
-- Mouse Events --------- 
------------------------- 
addEventHandler( "onClientMouseEnter", root, 
function(aX, aY) 
if (login) then 
guiCreateStaticImage(70, 0.44, 0.21, 0.13, "img/login2.png", true, window) 
   end 
end 
) 
  
  
end 
addCommandHandler ("script", login ) 

Why it doesn't work when i hit login ?

Posted

try this:

  
function loginFunc () 
showCursor ( true ) 
  
  
bg = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "img/bg.png", true) 
window = guiCreateStaticImage(0.30, 0.32, 0.40, 0.34, "img/login_window.png", true, bg) 
login = guiCreateStaticImage(0.70, 0.44, 0.21, 0.13, "img/login.png", true, window) 
guest = guiCreateStaticImage(0.70, 0.59, 0.21, 0.13, "img/guest.png", true, window) 
------------------------- 
-- Mouse Events --------- 
------------------------- 
addEventHandler( "onClientMouseEnter", root,function(aX, aY) 
    if source==login then --check if the source they went over is the login 
        guiCreateStaticImage(70, 0.44, 0.21, 0.13, "img/login2.png", true, window) 
   end 
end) 
  
end 
addCommandHandler (loginFunc) 

And please try not to put function names and variable names the same name!

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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