Jump to content

sound on login/register


EvoGT

Recommended Posts

Client

function Sound()  
    playSound("sound.mp3",false) 
end 
addEvent("onActiveSound",true) 
addEventHandler("onActiveSound",getRootElement(),Sound) 

Server

addEventHandler ( "onPlayerCommand", root, 
function(sound) 
   if (sound == 'login') or (sound == 'register') then 
    triggerClientEvent("onActiveSound",getRootElement(),Sound) 
   end 
end) 

Link to comment

This script will do that music play for all.

The client is good but server is wrong.

Client
function Sound()  
    playSound("sound.mp3",false) 
end 
addEvent("onActiveSound",true) 
addEventHandler("onActiveSound",getRootElement(),Sound) 

Server

addEventHandler ( "onPlayerCommand", root, 
function(sound) 
   if (sound == 'login') or (sound == 'register') then 
    triggerClientEvent("onActiveSound",getRootElement(),Sound) 
   end 
end) 

Try this:

Client

function Sound()  
    playSound("sound.mp3",false) 
end 
addEvent("onActiveSound",true) 
addEventHandler("onActiveSound",getRootElement(),Sound) 

Server

addEventHandler ( "onPlayerLogin", root, 
function() 
    triggerClientEvent("onActiveSound",source,Sound) 
end 
) 

Link to comment
This script will do that music play for all.

The client is good but server is wrong.

Client
function Sound()  
    playSound("sound.mp3",false) 
end 
addEvent("onActiveSound",true) 
addEventHandler("onActiveSound",getRootElement(),Sound) 

Server

addEventHandler ( "onPlayerCommand", root, 
function(sound) 
   if (sound == 'login') or (sound == 'register') then 
    triggerClientEvent("onActiveSound",getRootElement(),Sound) 
   end 
end) 

Try this:

Client

function Sound()  
    playSound("sound.mp3",false) 
end 
addEvent("onActiveSound",true) 
addEventHandler("onActiveSound",getRootElement(),Sound) 

Server

addEventHandler ( "onPlayerLogin", root, 
function() 
    triggerClientEvent("onActiveSound",source,Sound) 
end 
) 

"@EvoGT, How can i make sound on login and (register) ?"

Link to comment

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