Bishop_G Posted March 15, 2025 Posted March 15, 2025 Guys I'm really stuck and going crazy.Please I need urgent help.I'm adding vehicle upgrades to a panel. All the upgrades are in the panel. When I press the add button I get this error and warning: WARNING:Resources\VehPanel\server.lua:25:Access denied @ 'loadstring' ERROR:Resources\VehPanel\server.lua:25:attempt to call a nil value Please someone help me.I will be very appreciative of this. serverside codes are here: allowedFunctions = { ["addVehicleUpgrade"]=true, ["removeVehicleUpgrade"]=true, ["fixVehicle"]=true,["setVehicleColor"]=true } function callClientFunction(client, funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end -- If the clientside event handler is not in the same resource, replace 'resourceRoot' with the appropriate element triggerClientEvent(client, "onServerCallsClientFunction", resourceRoot, funcname, unpack(arg or {})) end function callServerFunction(funcname, ...) if not allowedFunctions[funcname] then -- Protect server from abuse outputServerLog( "SECURITY: " .. tostring(getPlayerName(client)) .. " tried to use function " .. tostring(funcname) ) return end local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onClientCallsServerFunction", true) addEventHandler("onClientCallsServerFunction", resourceRoot , callServerFunction)
Moderators IIYAMA Posted March 15, 2025 Moderators Posted March 15, 2025 3 hours ago, Bishop_G said: Please someone help me.I will be very appreciative of this. It is a permission issue. https://wiki.multitheftauto.com/wiki/Server_Commands#aclrequest First verify if the meta.xml has any acl request listed in it's meta.xml /aclrequest list <resourceName> all And if loadstring is listed, grand permission. /aclrequest allow <resourceName> all If not listed, add it to the meta.xml of the resource: <aclrequest> <right name="function.loadstring" access="true" /> </aclrequest> See example: https://wiki.multitheftauto.com/wiki/Meta.xml Run: /refreshall And try the aclrequest commands again. 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Bishop_G Posted March 15, 2025 Author Posted March 15, 2025 It's great to see you here again after years. This worked. Thanks IIYAMA! 1
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