Jump to content

sound on login/register


EvoGT

Recommended Posts

Posted
Just use these functions:
onPlayerLogin 
playSound 
  

If you get errors, just post it, we'll help you.

You have to use triggerClientEvent !, Because onPlayerLogin is a server side event, And playSound is a client side function ..

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted
Just use these functions:
onPlayerLogin 
playSound 
  

If you get errors, just post it, we'll help you.

Do You Have Problem? Or What The Fuck? Should Use :

triggerClientEvent 

Why? Becuase "Play Sound" Function Client Side Only .

  

Posted

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) 

MTA Scripters. ♥♥♥Beijinhos♥♥♥

Posted

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 
) 

State: Inactive

Posted
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) ?"

MTA Scripters. ♥♥♥Beijinhos♥♥♥

Posted

Use the getAccount function to check if player is registred.

If you're using a login panel, just use playSound function when the player click on the login/register button.

Please do not PM me with scripting related question nor support, use the forums instead.

Posted
Use the getAccount function to check if player is registred.

If you're using a login panel, just use playSound function when the player click on the login/register button.

Put that well play the sound even if there was a login error !

Thanks to all

You all are awesome <3

You're welcome ..

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

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