rusztamas Posted May 9, 2017 Share Posted May 9, 2017 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. 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
pa3ck Posted May 9, 2017 Share Posted May 9, 2017 (edited) 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 May 9, 2017 by pa3ck 1 Link to comment
Mr.Loki Posted May 9, 2017 Share Posted May 9, 2017 (edited) In your Meta.xml, put the client script above the server script. Edited May 9, 2017 by Mr.Loki 2 Link to comment
rusztamas Posted May 9, 2017 Author Share Posted May 9, 2017 (edited) 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. Edited May 9, 2017 by rusztamas Link to comment
Gordon_G Posted May 10, 2017 Share Posted May 10, 2017 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. Yeah I must do the same on my local server, that's really sad 1 Link to comment
rusztamas Posted May 10, 2017 Author Share Posted May 10, 2017 it works for me, hope it will for you too Link to comment
1B0Y Posted May 10, 2017 Share Posted May 10, 2017 Add an export clientside to call the server, and then trigger the event to the client to fix this. Delaying it can still be unpredictable due to the download rate of the client 2 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