BorderLine Posted February 5, 2012 Share Posted February 5, 2012 Hi scripters Well i was boring and im trying to put sound to my moveocbject dont work this is the script clientside fuction opendoor() playSound ( "door.mp3", false ) end serverside addEventHandler ("onMarkerHit",markerBHZ, function (hitPlayer) local account = getPlayerAccount(hitPlayer) if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'BHZ' ) ) then moveObject (puerta2,1000,742.4,-2442.5,14.39) triggerClientEvent ("opendoor",hitPlayer,opendoor) else outputChatBox ("Acceso denegado!",hitPlayer) killPed (hitPlayer) end end) debugscript 3 say Server triggered clientside event opendoor, but event is not added client what type of event i need add to fuction opendoor? Link to comment
Castillo Posted February 5, 2012 Share Posted February 5, 2012 First, you wrote: "fuction" instead of "function", second you never added the event client side, and third, use this: -- client side: function opendoor() playSound ( "door.mp3", false ) end addEvent("opendoor",true) addEventHandler("opendoor",root,opendoor) -- server side: addEventHandler ("onMarkerHit",markerBHZ, function (hitPlayer) local account = getPlayerAccount(hitPlayer) if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'BHZ' ) ) then moveObject (puerta2,1000,742.4,-2442.5,14.39) triggerClientEvent (hitPlayer,"opendoor",hitPlayer) else outputChatBox ("Acceso denegado!",hitPlayer) killPed (hitPlayer) end end) Link to comment
BorderLine Posted February 5, 2012 Author Share Posted February 5, 2012 1) i will never forget function 2) the script work 3) you are the man thk a loot 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