Jump to content

help


MAB

Recommended Posts

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

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

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

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