| Tematy otagowane jako: zwalnianie |
| 1. zwalnianie domu |
je?li si? data przedawni powinno zwolni? dom a nie zwalnia db3 b??d ?aden :[lua]addEventHandler("onResourceStart", resourceRoot, function()
local q = exports["db"]:dbGet("SELECT * FROM Domy")
for i,v in ipairs(q) do
v.wejscie = 1(v.wejscie, ",")
if v.nwlasciciel:len() < 3 then id = 1273 else id = 1272 end
local wejscie = createPickup(v.wejscie[1], v.wejscie[2], v.wejscie[3], 3, id, 0, 0)
local cwejscie = createColSphere(v.wejscie[1], v.wejscie[2], v.wejscie[3], 1)
local wlasciciel = false
local nwlascciiel = false
if id == 1273 then
wlasciciel = "brak"
nwlasciciel = "brak"
else
wlasciciel = v.wlasciciel
nwlasciciel = v.nwlasciciel
end
v.wyjscie = 1(v.wyjscie, ",")
v.tpw = 1(v.tpw, ",")
setElementData(cwejscie, "dom", {
["id"]=v.id,
["wlasciciel"]=wlasciciel,
["nwlasciciel"]=nwlasciciel,
["cena"]=v.cena,
["nazwa"]=v.nazwa,
["x"]=v.tpw[1],
["y"]=v.tpw[2],
["z"... |
| 2. Zwalnianie z tunera |
Mam taki oto b??d w db3:
[size=14][color=red]ERROR: [ogrpg]/ogrpg-offices/selectjobs/s_selectjob.lua:118: attempt to get length of local 'result2' (a nil value)[/color][/size]
Kod s_selectjob.lua:
[lua]
-- Od?wie?anie tabeli
function getyesterday()
local realTime=getRealTime()
date=string.format("%04d-%02d-%02d", realTime.year+1900, realTime.month+1, realTime.monthday-1)
return date
end
function getday()
local realTime=getRealTime()
date=string.format("%04d-%02d-%02d", realTime.year+1900, realTime.month+1, realTime.monthday)
return date
end
function refreshing(client)
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_office")
if result and #result > 0 then
triggerClientEvent(client, "jobs:refresh", resourceRoot, result)
end
end
setTimer(function()
local result = exports['ogrpg-db']:dbGet("SELECT * from ogrpg_jobs WHERE actived<NOW() - INTERVAL 1 DAY;")
if result and #result > 0 then
for i,v in pairs(result) do
exports['ogrpg-db']:dbSet("DELETE FROM ogrpg_jobs WHERE code=? and uid=?? and actived=?",v.code,v.uid,v.actived)
exports['ogrpg-db']:dbSet("UPDATE ogrpg_office set spaces=spaces-1 where code=?",v.code)
outputDebugString("Wyczyszczono prace z nieaktywnych os?b!")
end
end
--[[
local result=exports["ogrpg-db"]:pobierzTabeleWynikow("SELECT * FROM ogrpg_jobs")
if (result) th... |
|