Jump to content

TriggerClientEvent problem.


Zsoltisz

Recommended Posts

Posted (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 by Zsoltisz
function Zsoltisz(thePlayer)
  if isPlayerZsoltisz(thePlayer) then
    outputChatBox("Scripter")
  end
end

 

Posted

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 )

 

function Zsoltisz(thePlayer)
  if isPlayerZsoltisz(thePlayer) then
    outputChatBox("Scripter")
  end
end

 

Posted

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 :(

function Zsoltisz(thePlayer)
  if isPlayerZsoltisz(thePlayer) then
    outputChatBox("Scripter")
  end
end

 

Posted

nothing. I replaced it but don't working :/

function Zsoltisz(thePlayer)
  if isPlayerZsoltisz(thePlayer) then
    outputChatBox("Scripter")
  end
end

 

Posted (edited)

Nothing. The sound isn't playing. And i dont got any error code. (meta.xml is good.)

Edited by Zsoltisz
function Zsoltisz(thePlayer)
  if isPlayerZsoltisz(thePlayer) then
    outputChatBox("Scripter")
  end
end

 

Posted

No. Because I tested the client script with "addCommandHandler" and the sound is working. I think have problem with Event.

function Zsoltisz(thePlayer)
  if isPlayerZsoltisz(thePlayer) then
    outputChatBox("Scripter")
  end
end

 

Posted

debugscript
:ERROR:Server triggered clientside event motor, but event is not added clientside

 

function Zsoltisz(thePlayer)
  if isPlayerZsoltisz(thePlayer) then
    outputChatBox("Scripter")
  end
end

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...