Jump to content

onClientMouseMove


IIIIlllllIII

Recommended Posts

Posted

hi

how i make the sound playing for 1 time when i move the mouse on gui button or gui window

i want when i move the mouse on button the sound play for 1 time not replay agine

this the code

===================================================

addEventHandler("onClientMouseMove", getRootElement(), function()

if source == Button then

playSound("sot.mp3")

end

end

)

================================================

the problem when i move the mouse on button the sound replay agine on the button when i select the button

how i stop the sound without replay agine on the button

i hope you understand me 8)

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

Posted (edited)

tell the other members to help you ..

but when you post code please use lua code viewer .

use this  

Edited by Guest

==================================================================

~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~

134479106051.png

==================================================================

Posted

use this

addEventHandler("onClientMouseMove", getRootElement(), function() 
if source == Button then 
stopSound("sot.mp3") 
end 
end 
) 
  

==================================================================

~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~

134479106051.png

==================================================================

Posted (edited)
function play () 
    if source == Button then 
    local me = playSound("sot.mp3")  
    setSoundVolume(me, 0.-- s8) -->
end 
addEventHandler( "onClientMouseMove", getRootElement( ), play) 
  
function stop () 
if source == Button then 
stopSound("me") 
end 
addEventHandler("onClientMouseLeave", getRootElement(), stop) 

Edited by Guest

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted
use this
addEventHandler("onClientMouseMove", getRootElement(), function() 
if source == Button then 
stopSound("sot.mp3") 
end 
end 
) 
  

where is the event ??

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted
addEventHandler("onClientMouseMove", root, function() 
if (source == Button) then 
     playSound("sot.mp3",false) 
     end 
end) 

CiTLh.png
Posted
use this
addEventHandler("onClientMouseMove", getRootElement(), function() 
if source == Button then 
stopSound("sot.mp3") 
end 
end 
) 
  

where is the event ??

i don't know

==================================================================

~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~

134479106051.png

==================================================================

Posted

what? lol

you both get out noobs

where is the event? wtf

the event is there

addEventHandler("onClientMouseMove", getRootElement(), function() 

CiTLh.png
Posted
what? lol

you both get out noobs

where is the event? wtf

the event is there

addEventHandler("onClientMouseMove", getRootElement(), function() 

Exactly, I thought about the same thing that what the hell are they talking about :3

If I helped you, please click the like button on the right ;) Thanks!

Posted

Since the event is triggered every time mouse moves over the GUI element. I suggest you use onClientMouseEnter instead which is triggered only when mouse enters the gui element bounding box.

That is:

addEventHandler("onClientMouseEnter", root, function() 
    playSound("sot.mp3"); 
end) 

Posted

That will be triggered for any GUI element.

addEventHandler("onClientMouseEnter", Button, function() 
    playSound("sot.mp3"); 
end) 

Posted
Since the event is triggered every time mouse moves over the GUI element. I suggest you use onClientMouseEnter instead which is triggered only when mouse enters the gui element bounding box.

That is:

addEventHandler("onClientMouseEnter", root, function() 
    playSound("sot.mp3"); 
end) 

50p

Wow thanks you works great

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

Posted
That will be triggered for any GUI element.
addEventHandler("onClientMouseEnter", Button, function() 
    playSound("sot.mp3"); 
end) 

Yes, isn't that what author of the topic wanted?

MOJRM-511, you're welcome. Have fun scripting and don't hesitate to ask here or IRC.

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...