Jump to content

server attempts to trigger clientside event, says it was not added to clientside, while it is!!!!


Recommended Posts

Hi! Sorry, i would not like to post the whole source code, because it is really creative. But, when i start the script, there is a "triggerClientEvent" right away, and there is a big lag, camera stops for 3 seconds. 263N_vtelen.png Then this is what the debugscript is writing. It makes me really furious, i'm trying to fix this since morning, but i could not fix it.
Declarations and basic things:

local szef = createObject (2634, 2370.0651855469+0.05, -1913.1561279297+0.20, 13.449999809265+0.30)
local szefmarker = createMarker(2370.1186523438, -1911.3524169922, 13.449999809265-1, "cylinder", 1, 161, 212, 144)
local kamuszefmarker = createMarker(2370.1186523438, -1911.3524169922, 13.449999809265-1, "cylinder", 4, 161, 212, 144)
local kapu = createObject (980, 2403.6474609375, -1909.4417724609+10, 13.573752403259+0.05)
setElementRotation (kapu, 0, 0, 90)
setElementAlpha (kamuszefmarker, 0)
setElementData (szef, "rabolhato", true)
setElementData (szef, "zart", true)
setElementData (szef, "allapot", "0")
triggerClientEvent ("kepekEngedelyezese_Szef", getRootElement())
triggerClientEvent ("kepekTiltasa_Zsak", getRootElement())

After this the functions start.

Clientside:

function kepekTiltasa_Szef()
	setElementData (kamuszefmarker, "megjelenitheti_a_kepet", false)
end
addEvent ("kepekTiltasa_Szef", true)
addEventHandler ("kepekTiltasa_Szef", getRootElement(), kepekTiltasa_Szef)

function kepekEngedelyezese_Szef()
	setElementData (kamuszefmarker, "megjelenitheti_a_kepet", true)
end
addEvent ("kepekEngedelyezese_Szef", true)
addEventHandler ("kepekEngedelyezese_Szef", getRootElement(), kepekEngedelyezese_Szef)

function kepekTiltasa_Zsak()
	setElementData (kamupenzeszsakmarker, "megjelenitheti_a_kepet", false)
end
addEvent ("kepekTiltasa_Zsak", true)
addEventHandler ("kepekTiltasa_Zsak", getRootElement(), kepekTiltasa_Zsak)

function kepekEngedelyezese_Zsak()
	setElementData (kamupenzeszsakmarker, "megjelenitheti_a_kepet", true)
end
addEvent ("kepekEngedelyezese_Zsak", true)
addEventHandler ("kepekEngedelyezese_Zsak", getRootElement(), kepekEngedelyezese_Zsak)

Says it is not added to clientside......... I dont know what the problem could be. Any help please?

Link to comment

Is there a specific event you call the triggerServerEvent from or just when the resource starts? Because the server loads in before the client, so at the time when it runs, the event is not added yet

Edited by pa3ck
  • Like 1
Link to comment

The problem has not been solved yet. Tried to switch the two lines in the meta, but was not succesful. 

Solved: I made a function for them, and on event onResourceStart it starts running, and get delayed by 2500ms. I'm running this on my PC, the CPU might not be as fast as the Xeon on my server lol. :D

Edited by rusztamas
Link to comment
9 hours ago, rusztamas said:

Solved: I made a function for them, and on event onResourceStart it starts running, and get delayed by 2500ms. I'm running this on my PC, the CPU might not be as fast as the Xeon on my server lol. :D

Yeah I must do the same on my local server, that's really sad :-(

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