Zsoltisz Posted October 4, 2016 Share Posted October 4, 2016 (edited) hello guys. I have a problem with this script. please help me whats the problem. client side: function motorhang() local motor = playSound("sounds/start.mp3") setSoundVolume(motor, 1) end addEvenet("motor") addEventHandler("motor",thePlayer,motorhang) server side: triggerClientEvent("start",source) Edited October 4, 2016 by Zsoltisz Link to comment
iPrestege Posted October 4, 2016 Share Posted October 4, 2016 function motorhang() local motor = playSound("sounds/start.mp3") setSoundVolume(motor, 1) end addEvent("motor") addEventHandler("motor",thePlayer,motorhang) triggerClientEvent(source,"start",source) Link to comment
Zsoltisz Posted October 4, 2016 Author Share Posted October 4, 2016 I dont hear nothing Here is the full code of server side elseif fuel >= 1 then triggerClientEvent(source,"start",source) toggleControl(source, 'brake_reverse', true) setTimer ( function() setVehicleEngineState(veh, true) exports['StarMTA_anticheat']:changeProtectedElementDataEx(veh, "engine", 1, false) exports.StarMTA_core:sendLocalMeAction(source, "beindította a jármű motorját.") end, 500, 1 ) Link to comment
iPrestege Posted October 4, 2016 Share Posted October 4, 2016 I didn't know that you want to use this event to start the sound i thought it's another thing to do any way : triggerClientEvent(source,"motor",source) Link to comment
Zsoltisz Posted October 4, 2016 Author Share Posted October 4, 2016 Well. The sript: When i sit in car and i press J the car is start about 0,5 sec but the sound is played without timer. I do it. Don't working Link to comment
iPrestege Posted October 4, 2016 Share Posted October 4, 2016 replace this : addEventHandler("motor",thePlayer,motorhang) With this : addEventHandler("motor",root,motorhang) Link to comment
Zsoltisz Posted October 4, 2016 Author Share Posted October 4, 2016 nothing. I replaced it but don't working Link to comment
iPrestege Posted October 4, 2016 Share Posted October 4, 2016 So the sound isn't playing? Any errors? Link to comment
Zsoltisz Posted October 4, 2016 Author Share Posted October 4, 2016 (edited) Nothing. The sound isn't playing. And i dont got any error code. (meta.xml is good.) Edited October 4, 2016 by Zsoltisz Link to comment
iPrestege Posted October 4, 2016 Share Posted October 4, 2016 Check the sound file path maybe it's wrong or something? Link to comment
Zsoltisz Posted October 4, 2016 Author Share Posted October 4, 2016 No. Because I tested the client script with "addCommandHandler" and the sound is working. I think have problem with Event. Link to comment
iPrestege Posted October 4, 2016 Share Posted October 4, 2016 Yeah just saw that replace this : addEvent("motor") To addEvent("motor",true) Link to comment
Zsoltisz Posted October 4, 2016 Author Share Posted October 4, 2016 debugscript :ERROR:Server triggered clientside event motor, but event is not added clientside Link to comment
iPrestege Posted October 4, 2016 Share Posted October 4, 2016 Take a look at my post above Link to comment
Zsoltisz Posted October 4, 2016 Author Share Posted October 4, 2016 Yeah!! Working. Thank's my friend! 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