Jump to content

Problem with event


Ashur

Recommended Posts

Hello!
Please help me figure out why the argument is not passed from the server side to the client, nothing is displayed in the chat. And the event itself is also not triggered, because the function is also not executed even if you perform actions without an argument. Previously, I had no problem with this, but something went wrong. 

I'm a newbie, sorry for the language, I use a translator

Client side:

addEvent("boatSail", true)   
addEventHandler ( "boatSail", root, function(text)
outputChatBox(text)
end)


Server side:

function cruisingBoat()
	local x, y, z = -2611.08203125, 1476.525390625, -0.55000001192093
	local boat = createVehicle(453, x, y, z)
    local driver = createPed (120, x, y, z)
	warpPedIntoVehicle (driver, boat)  
	local text = "123456"
	triggerClientEvent("boatSail", getRootElement(), text) 
end
addEventHandler ( "onResourceStart", getRootElement(), cruisingBoat )

 

Edited by Ashur
Link to comment
25 minutes ago, Tekken said:

You getting any error in /debugscript 3 something like attempt to call non existing client side event this might be 'cause you call it before the client side event it's even created try with "onPlayerJoin"

Thank you very much, everything seems to work ?

  • Like 1
Link to comment

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...