EvoGT Posted March 21, 2013 Share Posted March 21, 2013 How can i make sound on login and register ? What script should i use ? Link to comment
iPrestege Posted March 21, 2013 Share Posted March 21, 2013 onPlayerLogin playSound onPlayerLogin triggerClientEvent playSound Link to comment
EstrategiaGTA Posted March 21, 2013 Share Posted March 21, 2013 (edited) Just use these functions: onPlayerLogin playSound triggerClientEvent If you get errors, just post it, we'll help you. Edited March 21, 2013 by Guest Link to comment
PaiN^ Posted March 21, 2013 Share Posted March 21, 2013 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 .. Link to comment
iPrestege Posted March 21, 2013 Share Posted March 21, 2013 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 . Link to comment
EstrategiaGTA Posted March 21, 2013 Share Posted March 21, 2013 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 .. Yeah, I forgot... Sorry & Calm down Pres[T]ege .__. Link to comment
ZL|LuCaS Posted March 21, 2013 Share Posted March 21, 2013 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
Sasu Posted March 21, 2013 Share Posted March 21, 2013 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
ZL|LuCaS Posted March 21, 2013 Share Posted March 21, 2013 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
codeluaeveryday Posted March 22, 2013 Share Posted March 22, 2013 Just to let you know, this sound is playing to everyone. If I logged in everyone would hear the sound. Link to comment
DNL291 Posted March 22, 2013 Share Posted March 22, 2013 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. Link to comment
EvoGT Posted March 22, 2013 Author Share Posted March 22, 2013 Thanks to all You all are awesome <3 Link to comment
PaiN^ Posted March 22, 2013 Share Posted March 22, 2013 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 .. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now