MihayMondialu Posted March 17, 2016 Share Posted March 17, 2016 Help me! I do not know how to solve it ERROR: ped-system\s_peds.lua:39: cannot resume dead coroutine [string "?"] function resume() for key, value in ipairs(threads) do coroutine.resume(value) end end Link to comment
Addlibs Posted March 17, 2016 Share Posted March 17, 2016 Error is self-explanatory. You're looping though a table called 'threads', within it, there are coroutines, right? Well, one (if not more) of those coroutines are dead (completed, finished, done etc) Link to comment
MihayMondialu Posted March 17, 2016 Author Share Posted March 17, 2016 wherein local tempPeds = {} local pedMoveTimer = {} local pedMoveTimerTO = {} local null = mysql_null() local toLoad = { } local threads = { } local skinsMale = {7,14,15,17,20,21,24,25,26,29,35,36,37,44,46,57,58,59,60,68,72,98,147,185,186,187,223,227,228,234,235,240,258,259} local skinsFemale = {9,11,12,40,41,55,56,69,76,88,89,91,93,129,130,141,148,150,151,190,191,192,193,194,196,211,215,216,219,224,225,226,233,263} function loadAllPeds(res) local mysql = exports.mysql local players = exports.pool:getPoolElementsByType("player") for key, value in ipairs(players) do exports.anticheat:changeProtectedElementDataEx(value, "realinvehicle", 0, false) end local result = mysql:query("SELECT id FROM `peds` ORDER BY `id` ASC") if result then while true do local row = mysql:fetch_assoc(result) if not row then break end toLoad[tonumber(row["id"])] = true end mysql:free_result(result) for id in pairs( toLoad ) do local co = coroutine.create(loadOnePed) coroutine.resume(co, id, true) table.insert(threads, co) end setTimer(resume, 1000, 4) else outputDebugString( "loadAllPeds failed" ) end end addEventHandler("onResourceStart", getResourceRootElement(), loadAllPeds) function resume() for key, value in ipairs(threads) do coroutine.resume(value) end end Link to comment
Addlibs Posted March 18, 2016 Share Posted March 18, 2016 Can you also show the loadOnePed function (Line 26: local co = coroutine.create(loadOnePed))? Link to comment
MihayMondialu Posted March 27, 2016 Author Share Posted March 27, 2016 sure but help me 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