Wysłany: 2018-07-29, 18:31
SzoPPP
Wiek: 25 Na forum: 3561 dni Posty: 3
Nick w MP: SzoPPP
Witam,
chodzi o to ?e je?eli pr?buje zacz?? prac? to w DB3 wyskakuje ?wy b??d(SS ni?ej) a praca si? nie rozpoczyna. Prosz? o pomoc!
SS b??du DB3:
Kod:
Kod: --[[
autor: Asper & Payro
for: Own World
All rights reserved!
]]
local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()
function isMouseIn(psx,psy,pssx,pssy,abx,aby)
if not isCursorShowing() then return end
cx,cy=getCursorPosition()
cx,cy=cx*sx,cy*sy
if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
return true,cx,cy
else
return false
end
end
local showed = false
local showed2 = false
addEvent("onPlayerStartJob", true)
addEvent("onPlayerResign", true)
addEvent("onClientPlayerPayday", true)
local top = {}
addEvent("createJobsWindow", true)
addEventHandler("createJobsWindow", root, function(det)
details = det
addEventHandler("onClientRender", root, guiPrace)
showCursor(true)
showed = true
end)
addEvent("destroyJobsWindow", true)
addEventHandler("destroyJobsWindow", root, function()
removeEventHandler("onClientRender", root, guiPrace)
removeEventHandler("onClientRender", root, guiLevels)
showCursor(false)
showed = false
end)
local r,g,b = 50,50,50
local lvl_text = ""
function guiPrace()
local b = "Zatrudnij si?"
if getElementData(localPlayer, "user:job") == details[2] then
b = "Zwolnij si?"
end
exports["buttons"]:createCustomWindow("Panel pracy", screenW * 0.3599, screenH * 0.2417, screenW * 0.2802, screenH * 0.5176, tocolor(255, 255, 255, 255), false)
-- exports["buttons"]:createCustomText("Ranking pracy:\n"..table.concat(details[3], "\n"), screenW * 0.3510, screenH * 0.2489, screenW * 0.6490, screenH * 0.5815, tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, true, false, false, false)
exports["buttons"]:createCustomButton(b, screenW * 0.4130, screenH * 0.61, screenW * 0.1740, screenH * 0.0565, tocolor(255, 255, 255, 255), false)
exports["buttons"]:createCustomButton("Anuluj", screenW * 0.4130, screenH * 0.67, screenW * 0.1740, screenH * 0.0565, tocolor(255, 255, 255, 255), false)
end
function guiLevels()
exports["buttons"]:createCustomWindow("Wybierz poziom", screenW * 0.3599, screenH * 0.2417, screenW * 0.2802, screenH * 0.5176, tocolor(255, 255, 255, 255), false)
--texty leveli
if isMouseIn(screenW * 0.4323, screenH * 0.4796, screenW * 0.1354, screenH * 0.0426) then
lvl_text = details[4]
elseif isMouseIn(screenW * 0.4323, screenH * 0.5269, screenW * 0.1354, screenH * 0.0426) then
lvl_text = details[5]
elseif isMouseIn(screenW * 0.4323, screenH * 0.5741, screenW * 0.1354, screenH * 0.0426) then
lvl_text = details[6]
end
--
exports["buttons"]:createCustomText("Opis poziomu:\n"..lvl_text, screenW * 0.3510, screenH * 0.1989, screenW * 0.6490, screenH * 0.5815, tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, true, false, false, false)
--3 levele
exports["buttons"]:createCustomButton("Poziom 1", screenW * 0.4323, screenH * 0.4796, screenW * 0.1354, screenH * 0.0426, tocolor(255, 255, 255, 255), tocolor(r,g,b))
exports["buttons"]:createCustomButton("Poziom 2", screenW * 0.4323, screenH * 0.5269, screenW * 0.1354, screenH * 0.0426, tocolor(255, 255, 255, 255), tocolor(r,g,b))
exports["buttons"]:createCustomButton("Poziom 3", screenW * 0.4323, screenH * 0.5741, screenW * 0.1354, screenH * 0.0426, tocolor(255, 255, 255, 255), tocolor(r,g,b))
--
exports["buttons"]:createCustomButton("Anuluj", screenW * 0.4130, screenH * 0.67, screenW * 0.1740, screenH * 0.0565, tocolor(255, 255, 255, 255), false)
end
addEventHandler("onClientClick", root, function(btn, state)
if btn == "left" and state == "down" then
if isMouseIn(screenW * 0.4130, screenH * 0.61, screenW * 0.1740, screenH * 0.0565) and showed then
if getElementData(localPlayer, "user:job") and getElementData(localPlayer, "user:job") == details[2] then
endJob()
else
acceptJob()
end
elseif isMouseIn(screenW * 0.4130, screenH * 0.67, screenW * 0.1740, screenH * 0.0565) and showed2 then
removeEventHandler("onClientRender", root, guiLevels)
showed2 = false
showCursor(false)
elseif isMouseIn(screenW * 0.4130, screenH * 0.67, screenW * 0.1740, screenH * 0.0565) and showed then
removeEventHandler("onClientRender", root, guiPrace)
showed = false
showCursor(false)
elseif isMouseIn(screenW * 0.4323, screenH * 0.4796, screenW * 0.1354, screenH * 0.0426) and showed2 then
startJob(1)
elseif isMouseIn(screenW * 0.4323, screenH * 0.5269, screenW * 0.1354, screenH * 0.0426) and showed2 then
startJob(2)
elseif isMouseIn(screenW * 0.4323, screenH * 0.5741, screenW * 0.1354, screenH * 0.0426) and showed2 then
startJob(3)
end
end
end)
function startJob(lvl)
if lvl == 1 then
if details[10] ~= true then
if getElementData(localPlayer, "user:pj"..details[10]) and getElementData(localPlayer, "user:pj"..details[10]) ~= 1 then
exports["rpg_noti"]:createNotification("error", "Aby pracowa? na tej pracy potrzebujesz prawo jazdy kat. "..details[10])
return
end
end
if getElementData(localPlayer, details[13]) < details[7] then
exports["rpg_noti"]:createNotification("error", "Aby pracowa? na tej pracy potrzebujesz "..details[7].." punkt?w")
return
end
elseif lvl == 2 then
if details[11] ~= true then
if getElementData(localPlayer, "user:pj"..details[11]) and getElementData(localPlayer, "user:pj"..details[11]) ~= 1 then
exports["rpg_noti"]:createNotification("error", "Aby pracowa? na tej pracy potrzebujesz prawo jazdy kat. "..details[11])
return
end
end
if getElementData(localPlayer, details[13]) < details[8] then
exports["rpg_noti"]:createNotification("error", "Aby pracowa? na tej pracy potrzebujesz "..details[8].." punkt?w")
return
end
elseif lvl == 3 then
if details[12] ~= true then
if getElementData(localPlayer, "user:pj"..details[12]) and getElementData(localPlayer, "user:pj"..details[12]) ~= 1 then
exports["rpg_noti"]:createNotification("error", "Aby pracowa? na tej pracy potrzebujesz prawo jazdy kat. "..details[12])
return
end
end
if getElementData(localPlayer, details[13]) < details[9] then
exports["rpg_noti"]:createNotification("error", "Aby pracowa? na tej pracy potrzebujesz "..details[9].." punkt?w")
return
end
end
setElementData(localPlayer, "user:job", details[2])
triggerEvent("onPlayerStartJob", localPlayer, details[2], lvl)
triggerServerEvent("onPlayerStartJob", localPlayer, details[2], lvl)
removeEventHandler("onClientRender", root, guiLevels)
showed2 = false
showCursor(false)
end
function acceptJob()
removeEventHandler("onClientRender", root, guiPrace)
showCursor(false)
showed = false
if not getElementData(localPlayer, "user:job") or getElementData(localPlayer, "user:job") == 0 then
showCursor(true)
showed2 = true
addEventHandler("onClientRender", root, guiLevels)
else
exports.rpg_noti:createNotification("error", "Posiadasz ju? inn? prac?, aby si? z niej zwolnij wpisz /zrezygnuj")
end
end
addEvent("acceptJob", true)
addEventHandler("acceptJob", root, acceptJob)
function endJob()
triggerServerEvent("playerResign", localPlayer, localPlayer, true)
end
addEvent("jobResign", true)
addEventHandler("jobResign", root, endJob)
Wysłany: 2018-07-29, 19:19
_jvneczek
Wiek: 22 Na forum: 4326 dni Posty: 1513
Nick w MP: _jvneczek
Piwa : 3949
Lepiej we? prace z ogka i to przer?b bo te prace to masakra, niby prace spoko ale bug za bugiem.
Podpis
Support Team: 04.10.2020 - 01.09.2020
Test Moderator: 03.05.2021 - 01.09.2021
Moderator: 01.09.2021 - 23.10.2021
Wysłany: 2018-07-29, 19:22
Mezo.
Mod-Team
Wiek: 24 Na forum: 3211 dni Posty: 548
Nick w MP: Mezo
Piwa : 6070
Spr?buj
--[[
autor : Asper & Payro
for: Own World
All rights reserved !
]]
local screenW , screenH = guiGetScreenSize ()
local sx , sy = guiGetScreenSize ()
function isMouseIn ( psx , psy , pssx , pssy , abx , aby )
if not isCursorShowing () then return end
cx , cy = getCursorPosition ()
cx , cy = cx * sx , cy * sy
if cx >= psx and cx <= psx + pssx and cy >= psy and cy <= psy + pssy then
return true , cx , cy
else
return false
end
end
local showed = false
local showed2 = false
addEvent ( "onPlayerStartJob" , true )
addEvent ( "onPlayerResign" , true )
addEvent ( "onClientPlayerPayday" , true )
local top = {}
addEvent ( "createJobsWindow" , true )
addEventHandler ( "createJobsWindow" , root , function( det )
details = det
addEventHandler ( "onClientRender" , root , guiPrace )
showCursor ( true )
showed = true
end )
addEvent ( "destroyJobsWindow" , true )
addEventHandler ( "destroyJobsWindow" , root , function()
removeEventHandler ( "onClientRender" , root , guiPrace )
removeEventHandler ( "onClientRender" , root , guiLevels )
showCursor ( false )
showed = false
end )
local r , g , b = 50 , 50 , 50
local lvl_text = ""
function guiPrace ()
local b = "Zatrudnij si?"
if getElementData ( localPlayer , "user:job" ) == details [ 2 ] then
b = "Zwolnij si?"
end
exports [ "buttons" ]: createCustomWindow ( "Panel pracy" , screenW * 0.3599 , screenH * 0.2417 , screenW * 0.2802 , screenH * 0.5176 , tocolor ( 255 , 255 , 255 , 255 ), false )
-- exports [ "buttons" ]: createCustomText ( "Ranking pracy:\n" .. table . concat ( details [ 3 ], "\n" ), screenW * 0.3510 , screenH * 0.2489 , screenW * 0.6490 , screenH * 0.5815 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , font , "center" , "center" , false , true , false , false , false )
exports [ "buttons" ]: createCustomButton ( b , screenW * 0.4130 , screenH * 0.61 , screenW * 0.1740 , screenH * 0.0565 , tocolor ( 255 , 255 , 255 , 255 ), false )
exports [ "buttons" ]: createCustomButton ( "Anuluj" , screenW * 0.4130 , screenH * 0.67 , screenW * 0.1740 , screenH * 0.0565 , tocolor ( 255 , 255 , 255 , 255 ), false )
end
function guiLevels ()
exports [ "buttons" ]: createCustomWindow ( "Wybierz poziom" , screenW * 0.3599 , screenH * 0.2417 , screenW * 0.2802 , screenH * 0.5176 , tocolor ( 255 , 255 , 255 , 255 ), false )
-- texty leveli
if isMouseIn ( screenW * 0.4323 , screenH * 0.4796 , screenW * 0.1354 , screenH * 0.0426 ) then
lvl_text = details [ 4 ]
elseif isMouseIn ( screenW * 0.4323 , screenH * 0.5269 , screenW * 0.1354 , screenH * 0.0426 ) then
lvl_text = details [ 5 ]
elseif isMouseIn ( screenW * 0.4323 , screenH * 0.5741 , screenW * 0.1354 , screenH * 0.0426 ) then
lvl_text = details [ 6 ]
end
--
exports [ "buttons" ]: createCustomText ( "Opis poziomu:\n" .. lvl_text , screenW * 0.3510 , screenH * 0.1989 , screenW * 0.6490 , screenH * 0.5815 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , font , "center" , "center" , false , true , false , false , false )
-- 3 levele
exports [ "buttons" ]: createCustomButton ( "Poziom 1" , screenW * 0.4323 , screenH * 0.4796 , screenW * 0.1354 , screenH * 0.0426 , tocolor ( 255 , 255 , 255 , 255 ), tocolor ( r , g , b ))
exports [ "buttons" ]: createCustomButton ( "Poziom 2" , screenW * 0.4323 , screenH * 0.5269 , screenW * 0.1354 , screenH * 0.0426 , tocolor ( 255 , 255 , 255 , 255 ), tocolor ( r , g , b ))
exports [ "buttons" ]: createCustomButton ( "Poziom 3" , screenW * 0.4323 , screenH * 0.5741 , screenW * 0.1354 , screenH * 0.0426 , tocolor ( 255 , 255 , 255 , 255 ), tocolor ( r , g , b ))
--
exports [ "buttons" ]: createCustomButton ( "Anuluj" , screenW * 0.4130 , screenH * 0.67 , screenW * 0.1740 , screenH * 0.0565 , tocolor ( 255 , 255 , 255 , 255 ), false )
end
addEventHandler ( "onClientClick" , root , function( btn , state )
if btn == "left" and state == "down" then
if isMouseIn ( screenW * 0.4130 , screenH * 0.61 , screenW * 0.1740 , screenH * 0.0565 ) and showed then
if getElementData ( localPlayer , "user:job" ) and getElementData ( localPlayer , "user:job" ) == details [ 2 ] then
endJob ()
else
acceptJob ()
end
elseif isMouseIn ( screenW * 0.4130 , screenH * 0.67 , screenW * 0.1740 , screenH * 0.0565 ) and showed2 then
removeEventHandler ( "onClientRender" , root , guiLevels )
showed2 = false
showCursor ( false )
elseif isMouseIn ( screenW * 0.4130 , screenH * 0.67 , screenW * 0.1740 , screenH * 0.0565 ) and showed then
removeEventHandler ( "onClientRender" , root , guiPrace )
showed = false
showCursor ( false )
elseif isMouseIn ( screenW * 0.4323 , screenH * 0.4796 , screenW * 0.1354 , screenH * 0.0426 ) and showed2 then
startJob ( 1 )
elseif isMouseIn ( screenW * 0.4323 , screenH * 0.5269 , screenW * 0.1354 , screenH * 0.0426 ) and showed2 then
startJob ( 2 )
elseif isMouseIn ( screenW * 0.4323 , screenH * 0.5741 , screenW * 0.1354 , screenH * 0.0426 ) and showed2 then
startJob ( 3 )
end
end
end )
function startJob ( lvl )
if lvl == 1 then
if details [ 10 ] ~= true then
if getElementData ( localPlayer , "user:pj" .. details [ 10 ]) and getElementData ( localPlayer , "user:pj" .. details [ 10 ]) ~= 1 then
exports [ "rpg_noti" ]: createNotification ( "error" , "Aby pracowa? na tej pracy potrzebujesz prawo jazdy kat. " .. details [ 10 ])
return
end
end
if getElementData ( localPlayer , details [ 10 ]) < details [ 7 ] then
exports [ "rpg_noti" ]: createNotification ( "error" , "Aby pracowa? na tej pracy potrzebujesz " .. details [ 7 ].. " punkt?w" )
return
end
elseif lvl == 2 then
if details [ 11 ] ~= true then
if getElementData ( localPlayer , "user:pj" .. details [ 10 ]) and getElementData ( localPlayer , "user:pj" .. details [ 9 ]) ~= 1 then
exports [ "rpg_noti" ]: createNotification ( "error" , "Aby pracowa? na tej pracy potrzebujesz prawo jazdy kat. " .. details [ 11 ])
return
end
end
if getElementData ( localPlayer , details [ 10 ]) < details [ 8 ] then
exports [ "rpg_noti" ]: createNotification ( "error" , "Aby pracowa? na tej pracy potrzebujesz " .. details [ 8 ].. " punkt?w" )
return
end
elseif lvl == 3 then
if details [ 12 ] ~= true then
if getElementData ( localPlayer , "user:pj" .. details [ 10 ]) and getElementData ( localPlayer , "user:pj" .. details [ 7 ]) ~= 1 then
exports [ "rpg_noti" ]: createNotification ( "error" , "Aby pracowa? na tej pracy potrzebujesz prawo jazdy kat. " .. details [ 12 ])
return
end
end
if getElementData ( localPlayer , details [ 10 ]) < details [ 4 ] then
exports [ "rpg_noti" ]: createNotification ( "error" , "Aby pracowa? na tej pracy potrzebujesz " .. details [ 9 ].. " punkt?w" )
return
end
end
setElementData ( localPlayer , "user:job" , details [ 2 ])
triggerEvent ( "onPlayerStartJob" , localPlayer , details [ 2 ], lvl )
triggerServerEvent ( "onPlayerStartJob" , localPlayer , details [ 2 ], lvl )
removeEventHandler ( "onClientRender" , root , guiLevels )
showed2 = false
showCursor ( false )
end
function acceptJob ()
removeEventHandler ( "onClientRender" , root , guiPrace )
showCursor ( false )
showed = false
if not getElementData ( localPlayer , "user:job" ) or getElementData ( localPlayer , "user:job" ) == 0 then
showCursor ( true )
showed2 = true
addEventHandler ( "onClientRender" , root , guiLevels )
else
exports . rpg_noti : createNotification ( "error" , "Posiadasz ju? inn? prac?, aby si? z niej zwolnij wpisz /zrezygnuj" )
end
end
addEvent ( "acceptJob" , true )
addEventHandler ( "acceptJob" , root , acceptJob )
function endJob ()
triggerServerEvent ( "playerResign" , localPlayer , localPlayer , true )
end
addEvent ( "jobResign" , true )
addEventHandler ( "jobResign" , root , endJob )
Podpis
- Na forum pomagam na miarę swoich możliwości, oraz bezpłatnie.
- Jeżeli potrzebujesz pomocy, pisz do mnie w prywatnej wiadomości, pomoc uzyskasz szybciej.
Współpraca -
[email protected]
Użytkownik - 19.08.2017
GTAO MEMBER - 29.03.2019
Support-Team - 03.02.2019 - 07.05.2019
Moderator - 07.05.2019 - 02.08.2020
Mod-Team - 02.08.2020 - 25.03.2022
Wysłany: 2018-07-29, 23:13
SzoPPP
Wiek: 25 Na forum: 3561 dni Posty: 3
Nick w MP: SzoPPP
Teraz w DB3 pojawiaj? si? takie b??dy:
Praca nadal si? nie rozpoczyna.
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: