MAB Posted August 2, 2015 Share Posted August 2, 2015 mm... not working... i see the setting in the settings list and i can change the value but nothing happens to the marker size even after restarting the resource.. also there is a debugscript message saying : ERROR : Server triggered clientside event receiveSettings, but event is not added clientside . meta .. "Michael" type="script" name="" description="" /> client .. local MarkerSize = -0.1 function addevent () addEvent("receiveSettings", true) end addEventHandler( "onClientResourceStart", getRootElement( ), addevent ) addEventHandler("receiveSettings", root, function(markerSize) MarkerSize = markerSize end ) --that is all u need.... Server... local markerSize = get("markerSize") triggerClientEvent("receiveSettings", root, markerSize) Link to comment
GTX Posted August 2, 2015 Share Posted August 2, 2015 Why did you create new topic? And your code makes no sense. local markerSize = get"markerSize" addEventHandler("onResourceStart", resourceRoot, function() triggerClientEvent("receiveSettings", root, markerSize) end ) local MarkerSize = -0.1 addEvent("receiveSettings", true) addEventHandler("receiveSettings", root, function(markerSize) MarkerSize = markerSize end ) <meta> <info author="Michael" type="script" name="" description="" /> <script src="effect_c.lua" type="client" /> <script src="effect_s.lua" /> <settings> <setting name="*markerSize" value="markerSize" friendlyname="" group="" accept="" examples="" desc="" /> </settings> </meta> Link to comment
MAB Posted August 2, 2015 Author Share Posted August 2, 2015 sorry about the new topic i though u won't look at the old one again... mm,,, this is an example or the problem solution? the problem still in there... i think the resource start event should be client Link to comment
GTX Posted August 2, 2015 Share Posted August 2, 2015 Yes, you can do that. local markerSize = get"markerSize" addEvent("onRequestSettings", true) addEventHandler("onRequestSettings", root, function() triggerClientEvent(source, "receiveSettings", source, markerSize) end ) local MarkerSize = -0.1 addEvent("receiveSettings", true) addEventHandler("receiveSettings", root, function(markerSize) MarkerSize = markerSize end ) addEventHandler("onClientResourceStart", resourceRoot, function() triggerServerEvent("onRequestSettings", localPlayer) end ) 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