Jump to content
  • 0

HELP ME! PLEASE!


MihayMondialu

Question

Help me! I do not know how to solve it

ERROR: ped-system\s_peds.lua:39: cannot resume dead coroutine [string "?"]

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

MihayMondialu

Square

Link to comment

1 answer to this question

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