Tosti Posted April 29, 2012 Share Posted April 29, 2012 Witam. Posiadam pewien skrypt który powinien tworzyć NPC który sprzedaje paliwo (tankuje), dostając go powiedziano mi że koordynaty musze sam wpisać. Wpisałem je i nic niemam jeżeli ktoś mógłby powiedzieć co mam źle ew. dać poprawiony kod. Z góry dzięki. Pozdrawiam To' oto kod: function createFuelPed(217, 1940.7587890625, -1776.2998046875, 13.390598297119, 87, name, priceratio) theNewPed = createPed (50, 1941.5654296875, -1769.1708984375, 13.640625) exports.pool:allocateElement(theNewPed) setPedRotation (theNewPed, rotZ) setPedFrozen(theNewPed, true) setPedAnimation(theNewPed, "FOOD", "FF_Sit_Loop", -1, true, false, true) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "ped:name", name, true) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "ped:fuelped",true) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "fuel:priceratio" , priceratio or 100, false) -- For the language system exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.lang1" , 1, false) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.lang1skill", 100, false) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.lang2" , 2, false) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.lang2skill", 100, false) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.current", 1, false) return theNewPed end function onServerStart() local sqlHandler = mysql:query("SELECT * FROM fuelpeds") if (sqlHandler) then while true do local row = mysql:fetch_assoc( sqlHandler ) if not row then break end createFuelPed(tonumber(row["skin"]),tonumber(row["posX"]),tonumber(row["posY"]),tonumber(row["posZ"]), tonumber(row["rotZ"]), row["name"],tonumber(row["priceratio"])) end end mysql:free_result(sqlHandler) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onServerStart) --createFuelPed(217, 1940.7587890625, -1776.2998046875, 13.390598297119,87) Link to comment
Tosti Posted April 30, 2012 Author Share Posted April 30, 2012 To co mi sie wyswietla w debugerze: ERROR: exports: Call to non-running server resource (pool) [string "?"] ERROR: fuel-system\s_fuel_system.lua:21: bad argument #1 to 'ipairs' (table expected, got nil) Link to comment
dzek (varez) Posted April 30, 2012 Share Posted April 30, 2012 Skrypt oczekuje uruchomionego zasobu o nazwie "pool". Nie wiem co to, ani gdzie tego szukać - ale komunikat błędu jasno mówi co jest źle. 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