Musisz poprawi? triggery we wszystkich pracach z NewPlace'a (( sam korzysta?em z tej paczki i mia?em ten sam b??d starczy czysta zmiana nazw trigger?w ))
Wys?a?e? kod od autobus?w a nie dzia?aj???mieciarki, wy?lij odpowiedni kod.
Z tego co pisa? Adaskokieblasko wywnioskowa?em, ?e wie jak naprawi? Tw?j b??d - musisz poczeka? na pomoc z Jego strony, sam spr?buje Ci pom?c kiedy otrzymam odpowiedni kod.
Edit//Dodam ze w moim przypadku nie trzeba by?o zmienia? nazw po prostu w s.lua
starczy?o usun?? nazw? eventu i nada? j? ponownie (( w razie co podaje ten spos?b jest szybszy i prostszy ))
--[[
Autor: Malentas
]]
local sx, sy = guiGetScreenSize()
local okno1 = false
local ulepszenia = false
local pracodawca = createPed(27, 2076.60, -2045.03, 13.59, 180)
setElementData(pracodawca, "name", "Pracodawca")
setElementDimension(pracodawca, 0)
setElementFrozen(pracodawca, true)
local rozpoczecie = createMarker(2076.85, -2047.22, 13.59-.95, "cylinder", 1, 255, 255, 255)
setElementData(rozpoczecie, "praca", true)
setElementDimension(rozpoczecie, 0)
addEventHandler("onClientMarkerHit", rozpoczecie, function(gracz)
if gracz ~= localPlayer then return end
if getPedOccupiedVehicle(localPlayer) then return end
if getElementData(localPlayer, "block:prawko") then exports["np-notyfikacje"]:noti("Posiadasz zabrane prawo jazdy kat. A, B, C", "error") return end
if getElementData(localPlayer, "punkty") < 75 then exports["np-notyfikacje"]:noti("Nie posiadasz 120 punkt?w reputacji!", "error") return end
if getElementData(localPlayer, "pracuje") then
if getElementData(localPlayer, "pracuje") ~= "smieciarki" then exports["np-notyfikacje"]:noti("Posiadasz inn? aktywn? prace!", "error") return end
end
addEventHandler("onClientRender", root, guistart)
okno1 = true
showCursor(true)
triggerServerEvent("pokazTopke:smieciarki:source", localPlayer)
end)
local font = dxCreateFont("cz.ttf", 10)
local font2 = dxCreateFont("cz.ttf", 12)
local font = dxCreateFont("cz.ttf", 10)
local font2 = dxCreateFont("cz.ttf", 12)
local pracownicy = { }
local listaulepszen = {
{"Sprint", "Dzi?ki temu ulepszeniu mo?esz biega? z koszem", 300, "dolar.png"},
{"Szybsze ?adowanie", "Dzi?ki temu ulepszeniu b?dziesz szybciej ?adowa? ?mieci", 500, "dolar.png"},
{"Zarobek +5%", "Dzi?ki temu ulepszeniu zarabiasz wi?cej o 5%", 700, "dolar.png"},
{"Pojemniejsza ?mieciarka", "Dzi?ki temu ulepszeniu twoja smieciarka zmiesci wi?cej koszy", 500, "dolar.png"},
}
function guistart()
dxDrawImage(scale_x(402), scale_y(251), scale_x(637), scale_y(399), ":np-gui/grafiki/tlo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
if ulepszenia == false then
local punkty = getElementData(localPlayer, "spunkty") or 0
local zlecenia = getElementData(localPlayer, "szlecenia") or 0
shadowText("Praca zbieracza smieci", scale_x(401), scale_y(251), scale_x(1039), scale_y(295), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
--shadowText("Wymagania:\nBRAK", scale_x(401), scale_y(295), scale_x(719), scale_y(449), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
shadowText("Wykonane zlecenia: "..zlecenia.."\nPunkty: "..punkty.."", scale_x(402), scale_y(510), scale_x(719), scale_y(646), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
shadowText("Top pracownicy:", scale_x(719), scale_y(295), scale_x(1036), scale_y(329), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
dxDrawImage(scale_x(415), scale_y(310), scale_x(304), scale_y(175), ":np-magazynier/grafiki/bg2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
shadowText("Wymagania: Kategoria C\n75 Punkt?w reputacji", scale_x(415), scale_y(500), scale_x(719), scale_y(548), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
if mysz(scale_x(889), scale_y(592), scale_x(139), scale_y(44)) then
dxDrawImage(scale_x(889), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
else
dxDrawImage(scale_x(889), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
end
if mysz(scale_x(729), scale_y(592), scale_x(139), scale_y(44)) then
dxDrawImage(scale_x(729), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
else
dxDrawImage(scale_x(729), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
end
if getElementData(localPlayer, "pracuje") == "smieciarki" then
shadowText("Zako?cz prace", scale_x(728), scale_y(591), scale_x(868), scale_y(636), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
else
shadowText("Rozpocznij prace", scale_x(728), scale_y(591), scale_x(868), scale_y(636), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
end
shadowText("Ulepszenia", scale_x(888), scale_y(592), scale_x(1028), scale_y(637), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
dxDrawImage(scale_x(1010), scale_y(261), scale_x(25), scale_y(25), ":np-gui/grafiki/cross.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
shadowText("Nickname:", scale_x(729), scale_y(329), scale_x(880), scale_y(363), tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
shadowText("Wykonane zlecenia:", scale_x(877), scale_y(329), scale_x(1028), scale_y(363), tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
for i, v in ipairs(pracownicy) do
local dodatekY = (scale_y(37))*(i-1)
local dodatekY2 = (scale_y(74))*(i-1)
dxDrawRectangle(scale_x(729), scale_y(363) + dodatekY, scale_x(299), scale_y(35), tocolor(0, 0, 0, 120), false)
shadowText(v.nick, scale_x(729), scale_y(364) + dodatekY2, scale_x(877), scale_y(398), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
shadowText(v.liczba, scale_x(880), scale_y(364) + dodatekY2, scale_x(1028), scale_y(398), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
end
else
local punkty = getElementData(localPlayer, "spunkty") or 0
shadowText("Kupno ulepszen", scale_x(401), scale_y(251), scale_x(1039), scale_y(295), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
dxDrawImage(scale_x(1011), scale_y(262), scale_x(16), scale_y(16), ":np-gui/grafiki/cofnij.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("Posiadasz: "..punkty.." punkt?w", scale_x(402), scale_y(582), scale_x(1037), scale_y(648), tocolor(0, 255, 0, 255), 1.00, font2, "center", "center", false, false, false, false, false)
for i, v in ipairs(listaulepszen) do
local dodatekY = (scale_y(72))*(i-1)
local dodatekY2 = (scale_y(144))*(i-1)
dxDrawRectangle(scale_x(417), scale_y(297)+dodatekY, scale_x(610), scale_y(70), tocolor(0, 0, 0, 120), false)
dxDrawImage(scale_x(432), scale_y(307)+dodatekY, scale_x(50), scale_y(50), ":np-magazynier/grafiki/"..v[4].."", 0, 0, 0, tocolor(255, 255, 255, 255), false)
shadowText(v[1], scale_x(501), scale_y(297)+dodatekY2, scale_x(874), scale_y(332), tocolor(255, 255, 255, 255), 1.00, font2, "left", "center", false, false, false, false, false)
shadowText(v[2], scale_x(501), scale_y(332)+dodatekY2, scale_x(874), scale_y(367), tocolor(255, 255, 255, 255), 1.00, font, "left", "center", false, false, false, false, false)
if mysz(scale_x(904), scale_y(312)+dodatekY, scale_x(113), scale_y(38)) then
dxDrawImage(scale_x(904), scale_y(312)+dodatekY, scale_x(113), scale_y(38), ":np-gui/grafiki/button_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
else
dxDrawImage(scale_x(904), scale_y(312)+dodatekY, scale_x(113), scale_y(38), ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
end
shadowText("Zakup", scale_x(904), scale_y(312)+dodatekY2, scale_x(1017), scale_y(350), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
shadowText("Cena: "..v[3].."p", scale_x(781), scale_y(297)+dodatekY2, scale_x(894), scale_y(335), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
end
end
end
addEventHandler("onClientClick", root, function(btn, state)
if btn == "left" and state == "down" then
if mysz(scale_x(729), scale_y(592), scale_x(139), scale_y(44)) and okno1 == true and ulepszenia == false then
if getElementData(localPlayer, "pracuje") == "smieciarki" then
zakonczprace()
else
rozpocznijprace()
end
elseif mysz(scale_x(889), scale_y(592), scale_x(139), scale_y(44)) and okno1 == true and ulepszenia == false then
ulepszenia = true
elseif mysz(scale_x(1010), scale_y(261), scale_x(16), scale_y(16)) and okno1 == true and ulepszenia == false then
removeEventHandler("onClientRender", root, guistart)
okno1 = false
showCursor(false)
elseif mysz(scale_x(1011), scale_y(262), scale_x(16), scale_y(16)) and okno1 == true and ulepszenia == true then
ulepszenia = false
end
for i, v in ipairs(listaulepszen) do
local dodatekY = (scale_y(72))*(i-1)
if mysz(scale_x(904), scale_y(312)+dodatekY, scale_x(113), scale_y(38)) and okno1 == true and ulepszenia == true then
local punkty = getElementData(localPlayer, "spunkty") or 0
if punkty < tonumber(v[3]) then exports["np-notyfikacje"]:noti("Posiadasz za ma?o punkt?w by zakupi? to ulepszenie", "error") return end
if v[1] == "Szybsze ?adowanie" then
if getElementData(localPlayer, "smieciarki:ulepszenie2") == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? to ulepszenie", "error") return end
setElementData(localPlayer, "smieciarki:ulepszenie2", 1)
elseif v[1] == "Sprint" then
if getElementData(localPlayer, "smieciarki:ulepszenie1") == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? to ulepszenie", "error") return end
setElementData(localPlayer, "smieciarki:ulepszenie1", 1)
elseif v[1] == "Zarobek +5%" then
if getElementData(localPlayer, "smieciarki:ulepszenie3") == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? to ulepszenie", "error") return end
setElementData(localPlayer, "smieciarki:ulepszenie3", 1)
elseif v[1] == "Pojemniejsza ?mieciarka" then
if getElementData(localPlayer, "smieciarki:ulepszenie4") == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? to ulepszenie", "error") return end
setElementData(localPlayer, "smieciarki:ulepszenie4", 1)
end
exports["np-notyfikacje"]:noti("Zakupujesz ulepszenie: "..v[1])
setElementData(localPlayer, "spunkty", punkty-tonumber(v[3]))
end
end
end
end)
addEvent("pokazTopke:smieciarki:client", true)
addEventHandler("pokazTopke:smieciarki:client", root, function(tabelka)
pracownicy = tabelka
end)
--praca
local kosz = {}
local kmarker = {}
local kblip = {}
local liczbakoszy = 5
local max = 20
local czas = 4000
local odklada = false
--Jefferson
local miejsce1 = {
{2134.10, -1375.30, 23.98},
{2190.74, -1375.72, 23.99},
{2138.45, -1406.00, 23.99},
{2138.42, -1411.33, 23.99},
{2138.24, -1452.13, 23.98},
}
--Ganton
local miejsce2 = {
{2498.26, -1686.70, 13.48},
{2505.73, -1654.07, 13.59},
{2490.30, -1647.08, 14.08},
{2468.72, -1648.26, 13.47},
{2471.70, -1684.67, 13.51},
}
--Idlewood
local miejsce3 = {
{2067.43, -1733.55, 13.88},
{2065.64, -1701.91, 14.15},
{2072.29, -1653.71, 13.55},
{2013.18, -1653.42, 13.55},
{2012.33, -1629.07, 13.55},
}
--Glen Park
local miejsce4 = {
{1937.65, -1126.89, 25.42},
{1903.61, -1116.77, 25.66},
{1939.73, -1062.33, 24.42},
{2025.53, -1056.79, 24.69},
{1858.05, -1159.61, 23.86},
}
--Market
local miejsce5 = {
{1184.90, -1257.63, 15.18},
{1185.32, -1257.91, 18.90},
{1181.94, -1230.21, 18.55},
{1185.18, -1230.07, 22.14},
{1134.85, -1211.10, 18.55},
}
--Marina
local miejsce6 = {
{819.46, -1495.79, 13.59},
{867.32, -1509.56, 13.55},
{843.90, -1481.20, 13.60},
{785.13, -1460.96, 13.55},
{811.44, -1553.44, 13.59},
}
--Richman
local miejsce7 = {
{298.88, -1335.26, 53.44},
{253.61, -1364.64, 53.11},
{250.39, -1271.32, 73.84},
{254.48, -1219.24, 75.31},
{280.82, -1259.10, 73.92},
}
--Las Colinas
local miejsce8 = {
{2528.09, -1036.69, 69.58},
{2501.15, -1062.82, 70.16},
{2488.55, -1013.44, 65.40},
{2629.20, -1071.08, 69.62},
{2556.71, -956.12, 82.73},
}
function rozpocznijprace()
if getElementData(localPlayer, "prawko_c") ~= 1 then exports["np-notyfikacje"]:noti("Nie posiadasz prawa jazdy kat. c", "error") return end
setElementData(localPlayer, "pracuje", "smieciarki")
triggerServerEvent("skin:praca", localPlayer, 260)
triggerServerEvent("NadajSmieciarke", localPlayer)
removeEventHandler("onClientRender", root, guistart)
okno1 = false
showCursor(false)
stowrzKosze()
wysypisko = createMarker(2080.57, -2000.48, 12.65, "cylinder", 4.5, 0, 255, 0)
bwysypisko = createBlipAttachedTo(wysypisko, 11)
setElementData(localPlayer, "liczbakoszy", 0)
odklada = false
addEventHandler("onClientMarkerHit", wysypisko, function(gracz)
if gracz ~= localPlayer then return end
local ile = getElementData(localPlayer, "liczbakoszy")
if ile <= 1 then exports["np-notyfikacje"]:noti("Aby wy?adowa? smieciarke musisz za?adowa? wi?cej ni? 1 kosz!", "error") return end
local zarobek = 90*ile
if getElementData(localPlayer, "premium") then
zarobek = zarobek+(zarobek*0.15)
end
local nagroda = math.random(0,1)
if getElementData(localPlayer, "premium") then
nagroda = nagroda+(nagroda*2)
end
if getElementData(localPlayer, "smieciarki:ulepszenie3") == 1 then
zarobek = zarobek+(zarobek*0.05)
end
setElementData(localPlayer, "pieniadze", getElementData(localPlayer, "pieniadze")+zarobek)
setElementData(localPlayer, "punkty", getElementData(localPlayer, "punkty")+nagroda)
exports["np-notyfikacje"]:noti("Wy?adowa?e? smieciarke zarabiasz: "..zarobek.." PLN")
setElementData(localPlayer, "liczbakoszy", 0)
setElementData(getPedOccupiedVehicle(localPlayer), "nametag", "")
end)
end
function stowrzKosze()
local los = math.random(1, 8)
if los == 1 then
trasa = miejsce1
elseif los == 2 then
trasa = miejsce2
elseif los == 3 then
trasa = miejsce3
elseif los == 4 then
trasa = miejsce4
elseif los == 5 then
trasa = miejsce5
elseif los == 6 then
trasa = miejsce6
elseif los == 7 then
trasa = miejsce7
elseif los == 8 then
trasa = miejsce8
end
liczbakoszy = 5
for i, v in ipairs(trasa) do
kmarker[i] = createMarker(v[1], v[2], v[3], "corona", 1.2, 0,0,0,0)
kosz[i] = createObject(1339, v[1], v[2], v[3]-0.35)
kblip[i] = createBlipAttachedTo(kosz[i], 41)
setElementData(kmarker[i], "kosz", kosz[i])
setElementData(kmarker[i], "blip", kblip[i])
setElementCollisionsEnabled(kosz[i], false)
addEventHandler("onClientMarkerHit", kmarker[i], function(gracz)
if gracz ~= localPlayer then return end
if getPedOccupiedVehicle(localPlayer) then return end
if getElementData(localPlayer, "kosz") then return end
--destroyElement(getElementData(source, "kosz"))
attachElements(getElementData(source, "kosz"), localPlayer, 0, 0.7, -0.4, 0, 0, 180)
setElementData(localPlayer, "kosz", getElementData(source, "kosz"))
destroyElement(getElementData(source, "blip"))
destroyElement(source)
toggleControl("jump", false)
if getElementData(localPlayer, "smieciarki:ulepszenie1") == 1 then
toggleControl("walk", true)
setControlState(localPlayer, "walk", false)
else
toggleControl("walk", false)
setControlState(localPlayer, "walk", true)
end
setPedWalkingStyle(localPlayer, 66)
end)
end
end
addEventHandler("onClientVehicleExit", root, function(gracz, seat)
if gracz ~= localPlayer then return end
if getElementData(localPlayer, "pracuje") == "smieciarki" then
local x,y,z = getElementPosition(source)
pmarker = createMarker(x,y,z, "corona", 1, 0,0,0,0)
setElementData(pmarker, "pojazd", source)
attachElements(pmarker, source, 0.121, -4.047, -0.641)
addEventHandler("onClientMarkerHit", pmarker, function(gracz)
if gracz ~= localPlayer then return end
if odklada == true then return end
if getElementData(localPlayer, "kosz") and isPedOnGround(localPlayer) then
if getElementData(localPlayer, "smieciarki:ulepszenie4") == 1 then
max = 30
else
max = 20
end
local ile = getElementData(localPlayer, "liczbakoszy") or 0
if tonumber(ile) >= tonumber(max) then exports["np-notyfikacje"]:noti("Twoja ?mieciarka ma pe?ny zbiornik. Jed? na wysypisko aby j? wy?adowa?.") return end
toggleAllControls(false)
exports["np-notyfikacje"]:noti("Trwa wy?adowywanie kosza...")
setElementFrozen(localPlayer, true)
if getElementData(localPlayer, "smieciarki:ulepszenie1") == 1 then
czas = 2000
else
czas = 4000
end
setElementData(localPlayer, "liczbakoszy", ile+1)
odklada = true
setTimer(function()
odklada = false
setElementFrozen(localPlayer, false)
exports["np-notyfikacje"]:noti("Kosz zosta? wy?adowany")
toggleAllControls(true)
toggleControl("fire", false)
toggleControl("aim_weapon", false)
destroyElement(getElementData(localPlayer, "kosz"))
toggleControl("walk", true)
setControlState(localPlayer, "walk", false)
toggleControl("jump", true)
setPedWalkingStyle(localPlayer, 0)
setElementData(localPlayer, "kosz", false)
liczbakoszy = liczbakoszy-1
local nagroda = math.random(1, 10)
if tonumber(nagroda) == 5 then
local los2 = math.random(1,3)
if getElementData(localPlayer, "premium") then
los2 = math.random(2, 6)
end
setElementData(localPlayer, "punkty", getElementData(localPlayer, "punkty")+los2)
exports["np-notyfikacje"]:noti("Za dobr? prace otrzymujesz "..los2.." RP")
end
local pkt = getElementData(localPlayer, "spunkty") or 0
setElementData(localPlayer, "spunkty", pkt+math.random(0, 2))
for i, v in ipairs(getElementsByType("vehicle")) do
if getElementData(v, "kierowca:smieciarki") and getElementData(v, "kierowca:smieciarki") == getElementData(localPlayer, "dbid") then
setElementData(v, "nametag", "Zape?nienie "..getElementData(localPlayer, "liczbakoszy").."/"..max)
end
end
if liczbakoszy == 0 then
stowrzKosze()
triggerServerEvent("daj:szlecenia", localPlayer, localPlayer)
end
end, czas, 1)
end
end)
end
end)
addEventHandler("onClientVehicleEnter", root, function(gracz, seat)
if gracz ~= localPlayer then return end
if getElementData(localPlayer, "pracuje") == "smieciarki" then
if isElement(pmarker) then
destroyElement(pmarker)
end
end
end)
function zakonczprace()
setElementData(localPlayer, "pracuje", false)
triggerServerEvent("skin:praca", localPlayer, getElementData(localPlayer, "skin"))
triggerServerEvent("usunSmieciarke:smieciarki", localPlayer)
setElementData(localPlayer, "liczbakoszy", 0)
odklada = false
for i, v in ipairs(kmarker) do
if isElement(v) then
destroyElement(v)
end
end
for i, v in ipairs(kblip) do
if isElement(v) then
destroyElement(v)
end
end
for i, v in ipairs(kosz) do
if isElement(v) then
destroyElement(v)
end
end
if isElement(pmarker) then
destroyElement(pmarker)
end
if isElement(wysypisko) then
destroyElement(wysypisko)
end
if isElement(bwysypisko) then
destroyElement(bwysypisko)
end
end
--opcje
function shadowText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
dxDrawText(text,x+1,y+1,w+1,h+1,tocolor(0,0,0),size,font,xx,yy,x1,x2,x3,x4,x5)
dxDrawText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
end
function mysz(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
function scale_x(value)
local result = (value / 1440) * sx
return result
end
function scale_y(value)
local result = (value / 900) * sy
return result
end
np-smieciarki >> s.lua
local smieciarka = { }
function pokazpracownikow()
local q = exports['np-mysql']:wykonaj("SELECT * from konta order by szlecenia desc")
local topka = {}
for i = 1,5 do
table.insert(topka, {nick = q[i]["login"], liczba = q[i]["szlecenia"]})
end
return topka
end
tablica = pokazpracownikow()
setTimer(function()
tablica = pokazpracownikow()
end, 600000, 0)
+
addEvent("pokazTopke:smieciarki:source", true)
addEventHandler("pokazTopke:smieciarki:source", root, function()
triggerClientEvent(source, "pokazTopke:smieciarki:client", source, tablica)
end)
addEvent("NadajSmieciarke", true)
addEventHandler("NadajSmieciarke", root, function(el)
smieciarka[source] = createVehicle(408, 2080.96, -2020.48, 14.10, 1.3, 0.1, 264.8)
warpPedIntoVehicle(source, smieciarka[source])
triggerClientEvent(root, "ghost:vehicle", root, smieciarka[source])
setElementData(smieciarka[source], "kierowca:smieciarki", getElementData(source, "dbid"))
end)
addEvent("usunSmieciarke:smieciarki", true)
addEventHandler("usunSmieciarke:smieciarki", root, function(el)
if isElement(smieciarka[source]) then
destroyElement(smieciarka[source])
end
end)
addEventHandler("onPlayerQuit", root, function()
if isElement(smieciarka[source]) then
destroyElement(smieciarka[source])
end
end)
addEvent("daj:szlecenia", true)
addEventHandler("daj:szlecenia", root, function(player)
local dbid = getElementData(player, "dbid")
local ilosc = getElementData(player, "szlecenia") or 0
local q = exports['np-mysql']:wykonaj("UPDATE konta SET szlecenia=szlecenia+1 where dbid=?", dbid)
setElementData(player, "szlecenia", ilosc+1)
end)
addEventHandler("onVehicleStartEnter", root, function(gracz, seat)
if seat ~= 0 then return end
if getElementData(gracz, "pracuje") == "smieciarki" then
if getElementData(source, "id") then
cancelEvent()
end
if getElementData(source, "kierowca:smieciarki") ~= getElementData(gracz, "dbid") then
cancelEvent()
end
else
if getElementData(source, "kierowca:smieciarki") then
cancelEvent()
end
end
end)
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach