Zsoltisz Posted October 4, 2016 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
iPrestege Posted October 4, 2016 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)
Zsoltisz Posted October 4, 2016 Author 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 )
iPrestege Posted October 4, 2016 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)
Zsoltisz Posted October 4, 2016 Author 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
iPrestege Posted October 4, 2016 Posted October 4, 2016 replace this : addEventHandler("motor",thePlayer,motorhang) With this : addEventHandler("motor",root,motorhang)
Zsoltisz Posted October 4, 2016 Author Posted October 4, 2016 nothing. I replaced it but don't working
Zsoltisz Posted October 4, 2016 Author 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
iPrestege Posted October 4, 2016 Posted October 4, 2016 Check the sound file path maybe it's wrong or something?
Zsoltisz Posted October 4, 2016 Author Posted October 4, 2016 No. Because I tested the client script with "addCommandHandler" and the sound is working. I think have problem with Event.
iPrestege Posted October 4, 2016 Posted October 4, 2016 Yeah just saw that replace this : addEvent("motor") To addEvent("motor",true)
Zsoltisz Posted October 4, 2016 Author Posted October 4, 2016 debugscript :ERROR:Server triggered clientside event motor, but event is not added clientside
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