Wysłany: 2018-06-25, 17:28
Kulegg
Wiek: 46 Na forum: 3125 dni Posty: 283
Piwa : 20
Witam,
Nie wyswietla mi sie praca tunera w urzedzie, jak to naprawic?
Wysłany: 2018-06-25, 17:31
PatryKK.
Emeryt LUA
Wiek: 26 Na forum: 3061 dni Posty: 1060
Nick w MP: PatryKK.
Piwa : 2322
Podaj kod
Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔
Aktualny projekt: BRAK
Wysłany: 2018-06-25, 17:36
Kulegg
Wiek: 46 Na forum: 3125 dni Posty: 283
Piwa : 20
To jest to? Wzialem to z pystories_offices
& #65279;
-- 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 [ "pystories-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 [ 'pystories-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 [ 'pystories-db' ]: dbSet ( "DELETE FROM ogrpg_jobs WHERE code=? and uid=?? and actived=?" , v . code , v . uid , v . actived )
exports [ 'pystories-db' ]: dbSet ( "UPDATE ogrpg_office set spaces=spaces-1 where code=?" , v . code )
outputDebugString ( "pystories-offices.s_selectjob.lua> Wyczyszczono prace z nieaktywnych os?b!" )
end
end
end , 86400000 , 0 ) -- 86400000 24h 86400000
addEvent ( "jobs:download" , true )
addEventHandler ( "jobs:download" , resourceRoot , refreshing )
addEvent ( "jobs:hire" , true )
addEventHandler ( "jobs:hire" , resourceRoot , function( _ , name , code )
-- Pobieramy UID gracza
local uid = getElementData ( client , "player:sid" )
if not uid then return end
-- Sprawdzamy czy kto ? istnieje w jakie ? frakcji
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ogrpg_jobs WHERE uid=?" , uid )
if #result > 0 then
outputChatBox ( "* Ju? jeste? w jakie? pracy zatrudniony(a)." , client , 255 , 0 , 0 )
return
end
-- Sprawdzamy czy praca ma jakie ? wolne miejsca
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ogrpg_office WHERE code=?" , code )
if #result > 0 then
if result [ 1 ]. spaces == result [ 1 ]. maxspaces then
outputChatBox ( "* W tej pracy nie ma wolnych miejsc." , client , 255 , 0 , 0 )
return
end
end
-- Dodajemy gracza do frakcji i nast ? pnie od ? wie ? amy wniki dodajemym dodatkowe miejsca itp .
local query = exports [ "pystories-db" ]: dbSet ( "INSERT ogrpg_jobs (code,uid) VALUES (?,?)" , code , uid )
if query then
exports [ "pystories-db" ]: dbSet ( "UPDATE ogrpg_office SET spaces=spaces+1 WHERE code=?" , code )
outputChatBox ( "* Otrzymujesz sta?? prac? w " .. name .. "" , client )
refreshing ( client )
end
end )
addEvent ( "jobs:slow" , true )
addEventHandler ( "jobs:slow" , resourceRoot , function( _ , name , code )
-- Pobieramy UID gracza
local uid = getElementData ( client , "player:sid" )
if not uid then return end
-- Sprawdzamy czy kto ? istnieje w jakie ? frakcji
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ogrpg_jobs WHERE uid=?" , uid )
if #result > 0 then
-- Sprawdzamy czy praca ma jakie ? wolne miejsca
local query = string . format ( "SELECT * FROM ogrpg_office WHERE code=%q" , result [ 1 ]. code )
local result2 = exports [ "DB2" ]: pobierzWyniki ( query )
if #result2 > 0 then
if result2 [ "spaces" ] == 0 then
outputChatBox ( "* Wyst?pi? b??d, poniewa? nie by?e? zatrudniony?" , client , 255 , 0 , 0 )
return
end
end
-- Usuwamy gracza z frakcji i nast ? pnie od ? wie ? amy wniki usuwamy miejsce itp .
local result3 = exports [ "pystories-db" ]: dbSet ( "DELETE FROM ogrpg_jobs WHERE code=? AND uid=?" , result [ 1 ]. code , uid )
if query then
exports [ "pystories-db" ]: dbSet ( "UPDATE ogrpg_office SET spaces=? WHERE code=?" , result2 [ "spaces" ]- 1 , result [ 1 ]. code )
outputChatBox ( "* Zwolni?e?(a?) si? ze sta?ej pracy w " .. name , client )
refreshing ( client )
end
else
outputChatBox ( "* Nie jeste? w ?adnej pracy zatrudniony(a)." , client , 255 , 0 , 0 )
end
end )
Wysłany: 2018-06-25, 18:16
PatryKK.
Emeryt LUA
Wiek: 26 Na forum: 3061 dni Posty: 1060
Nick w MP: PatryKK.
Piwa : 2322
Spr?buj tak:
-- 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 [ "pystories-db" ]: dbGet ( "SELECT * FROM pystories_office" )
if result and #result > 0 then
triggerClientEvent ( client , "jobs:refresh" , resourceRoot , result )
end
end
setTimer (function()
local result = exports [ 'pystories-db' ]: dbGet ( "SELECT * from pystories_jobs WHERE actived<NOW() - INTERVAL 1 DAY;" )
if result and #result > 0 then
for i , v in pairs ( result ) do
exports [ 'pystories-db' ]: dbSet ( "DELETE FROM pystories_jobs WHERE code=? and uid=?? and actived=?" , v . code , v . uid , v . actived )
exports [ 'pystories-db' ]: dbSet ( "UPDATE pystories_office set spaces=spaces-1 where code=?" , v . code )
outputDebugString ( "pystories-offices.s_selectjob.lua> Wyczyszczono prace z nieaktywnych os?b!" )
end
end
end , 86400000 , 0 ) -- 86400000 24h 86400000
addEvent ( "jobs:download" , true )
addEventHandler ( "jobs:download" , resourceRoot , refreshing )
addEvent ( "jobs:hire" , true )
addEventHandler ( "jobs:hire" , resourceRoot , function( _ , name , code )
-- Pobieramy UID gracza
local uid = getElementData ( client , "player:sid" )
if not uid then return end
-- Sprawdzamy czy kto ? istnieje w jakie ? frakcji
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM pystories_jobs WHERE uid=?" , uid )
if #result > 0 then
outputChatBox ( "* Ju? jeste? w jakie? pracy zatrudniony(a)." , client , 255 , 0 , 0 )
return
end
-- Sprawdzamy czy praca ma jakie ? wolne miejsca
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM pystories_office WHERE code=?" , code )
if #result > 0 then
if result [ 1 ]. spaces == result [ 1 ]. maxspaces then
outputChatBox ( "* W tej pracy nie ma wolnych miejsc." , client , 255 , 0 , 0 )
return
end
end
-- Dodajemy gracza do frakcji i nast ? pnie od ? wie ? amy wniki dodajemym dodatkowe miejsca itp .
local query = exports [ "pystories-db" ]: dbSet ( "INSERT pystories_jobs (code,uid) VALUES (?,?)" , code , uid )
if query then
exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_office SET spaces=spaces+1 WHERE code=?" , code )
outputChatBox ( "* Otrzymujesz sta?? prac? w " .. name .. "" , client )
refreshing ( client )
end
end )
addEvent ( "jobs:slow" , true )
addEventHandler ( "jobs:slow" , resourceRoot , function( _ , name , code )
-- Pobieramy UID gracza
local uid = getElementData ( client , "player:sid" )
if not uid then return end
-- Sprawdzamy czy kto ? istnieje w jakie ? frakcji
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM pystories_jobs WHERE uid=?" , uid )
if #result > 0 then
-- Sprawdzamy czy praca ma jakie ? wolne miejsca
local query = string . format ( "SELECT * FROM pystories_office WHERE code=%q" , result [ 1 ]. code )
local result2 = exports [ "pystories-db" ]: pobierzWyniki ( query )
if #result2 > 0 then
if result2 [ "spaces" ] == 0 then
outputChatBox ( "* Wyst?pi? b??d, poniewa? nie by?e? zatrudniony?" , client , 255 , 0 , 0 )
return
end
end
-- Usuwamy gracza z frakcji i nast ? pnie od ? wie ? amy wniki usuwamy miejsce itp .
local result3 = exports [ "pystories-db" ]: dbSet ( "DELETE FROM pystories_jobs WHERE code=? AND uid=?" , result [ 1 ]. code , uid )
if query then
exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_office SET spaces=? WHERE code=?" , result2 [ "spaces" ]- 1 , result [ 1 ]. code )
outputChatBox ( "* Zwolni?e?(a?) si? ze sta?ej pracy w " .. name , client )
refreshing ( client )
end
else
outputChatBox ( "* Nie jeste? w ?adnej pracy zatrudniony(a)." , client , 255 , 0 , 0 )
end
end )
Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔
Aktualny projekt: BRAK
Wysłany: 2018-06-25, 18:24
nanKy
Wiek: 22 Na forum: 3866 dni Posty: 498
Nick w MP: nanky
Piwa : 1773
By? mo?e jest to wina tego ?e w tabeli pystories_office nie ma ?adnego rekordu.
Wysłany: 2018-06-25, 18:28
PatryKK.
Emeryt LUA
Wiek: 26 Na forum: 3061 dni Posty: 1060
Nick w MP: PatryKK.
Piwa : 2322
nanKy , Nie, dlatego, ?e kolega zamiast z ogrpg-db oraz zamiast np ogrpg_offices zmienic na pystories to wgral to z ogrpg. Poda?em wy?ej prawid?owy kod.
Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔
Aktualny projekt: BRAK
Wysłany: 2018-06-25, 18:37
Kulegg
Wiek: 46 Na forum: 3125 dni Posty: 283
Piwa : 20
Nie dzia?a dalej ;/
[ Dodano : 2018-06-25, 19:43 ]
Naprawi?em, okaza?o si? ?e trzeba by?o tylko dopisa? w bazie danych linijke do pystories-office
Tagi: nie :: wyswietla :: sie :: praca :: tunera :: urzedzie
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: