Tox Posted August 8, 2015 Share Posted August 8, 2015 I got 0 errors on debugscript mode 3. I also checked if triggerClientEvent works as you can see on line 4 of the Server-side. I don't see what is the problem. Hope you can help me... Client-side: addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), function () function leaveSound() playSound ("sounds/goodbye.mp3") end addEvent ("onLeaveEvent", true) addEventHandler ("onLeaveEvent", localPlayer, leaveSound) end) Server-side: function onLeave (playerSource) setPlayerTeam (playerSource, nil) triggerClientEvent("onLeaveEvent", playerSource) outputChatBox ("bok") end addCommandHandler ("leave", onLeave) Link to comment
iMr.SFA7 Posted August 8, 2015 Share Posted August 8, 2015 addEvent ("onLeaveEvent", true) addEventHandler ("onLeaveEvent", localPlayer, function () playSound ("sounds/goodbye.mp3") end) Link to comment
Tox Posted August 8, 2015 Author Share Posted August 8, 2015 addEvent ("onLeaveEvent", true) addEventHandler ("onLeaveEvent", localPlayer, function () playSound ("sounds/goodbye.mp3") end) Sorry but doesn't work.. Link to comment
iMr.SFA7 Posted August 8, 2015 Share Posted August 8, 2015 function onLeave (playerSource) setPlayerTeam (playerSource, nil) triggerClientEvent(playerSource,"onLeaveEvent", playerSource) outputChatBox ("bok") end addCommandHandler ("leave", onLeave) addEvent ("onLeaveEvent", true) addEventHandler ("onLeaveEvent", localPlayer, function () playSound ("sounds/goodbye.mp3") end) Link to comment
Tox Posted August 8, 2015 Author Share Posted August 8, 2015 function onLeave (playerSource) setPlayerTeam (playerSource, nil) triggerClientEvent(playerSource,"onLeaveEvent", playerSource) outputChatBox ("bok") end addCommandHandler ("leave", onLeave) addEvent ("onLeaveEvent", true) addEventHandler ("onLeaveEvent", localPlayer, function () playSound ("sounds/goodbye.mp3") end) Link to comment
GTX Posted August 8, 2015 Share Posted August 8, 2015 addEvent("onLeaveEvent", true) addEventHandler("onLeaveEvent", root, function() playSound("sounds/goodbye.mp3") end ) Link to comment
Tox Posted August 8, 2015 Author Share Posted August 8, 2015 meta.xml ?? OK. Yeah, it was a foolish thing not to add on meta.xml. Sorry you all... And thank you. Link to comment
iMr.SFA7 Posted August 8, 2015 Share Posted August 8, 2015 meta.xml ?? OK. Yeah, it was a foolish thing not to add on meta.xml. Sorry you all... And thank you. You are 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