local districtsBus = {
{1817.91,-1917.31,13.38},
{1916.32,-1936.04,13.38},
{1985.46,-1936.26,13.38},
{2085.96,-1915.64,13.38},
{2085.63,-1852.60,13.38},
{2085.70,-1806.89,13.38},
{2114.49,-1693.73,13.38},
{2116.98,-1581.85,25.96},
{2116.56,-1442.89,23.83},
{2086.14,-1380.24,23.83},
{2076.03,-1281.49,23.83},
{2075.67,-1172.02,23.66},
{2019.02,-1131.67,24.79},
{1927.82,-1131.63,25.01},
{1862.59,-1157.71,23.69},
{1795.70,-1170.01,23.65},
{1607.47,-1156.67,23.91},
{1514.15,-1156.63,23.91},
{1450.54,-1265.07,13.38},
{1450.02,-1418.88,13.38},
{1425.29,-1573.70,13.36},
{1425.43,-1671.88,13.38},
{1429.87,-1736.51,13.38},
{1629.79,-1736.56,13.38},
{1781.05,-1736.39,13.38},
{1817.39,-1788.47,13.38},
{1817.38,-1870.58,13.41},
}
local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsBus
function finishJob()
if jobMarker and isElement(jobMarker) then
destroyElement(jobMarker)
jobMarker = nil
end
if jobTarget and isElement(jobTarget) then
destroyElement(jobTarget)
jobTarget = nil
jobTarget = 0
end
triggerServerEvent("destroyVeh", localPlayer)
end
function busDriver(el, md)
if el ~= localPlayer or not md then return end
if jobTarget > maxTarget and getPedOccupiedVehicle(el) then return end
if jobTarget == maxTarget and not getPedOccupiedVehicle(el) then return end
if jobTarget == #districtsBus then
finishJob()
playSoundFrontEnd(5)
exports.notification:showBox ("info","Gratuluje Zako?czy?e? Prace Kierowcy Autobusu!")
--exports["rpg_noti"]:createNotification(el,"Gratuluje Zako?czy?e? Prace Kierowcy Autobusu!")
outputChatBox("Gratuluje Zako?czy?e? Prace Kierowcy Autobusu!")
else
showMarker()
playSoundFrontEnd(12)
triggerServerEvent("doATMOperation", resourceRoot, 10)
end
end
function showMarker()
if jobMarker and isElement(jobMarker) then
destroyElement(jobMarker)
jobMarker = nil
end
jobTarget = jobTarget + 1
jobMarker = createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint", 4,128,255,0)
if districtsBus[jobTarget+1] then
ile = districtsBus[jobTarget+1]
setMarkerTarget(jobMarker, ile[1], ile[2], ile[3])
end
addEventHandler("onClientMarkerHit", jobMarker, busDriver)
end
addEvent("STARTJobBus", true)
addEventHandler("STARTJobBus", resourceRoot, function(veh)
exports.notification:showBox ("info","Rozpocz??e? Prace Kierowyc Autobusu.Zarobki 20 PLN Za Przystanek!")
--exports["rpg_noti"]:createNotification(el,"Rozpocz??e? Prace Kierowyc Autobusu.Zarobki 10 PLN Za Przystanek!")
outputChatBox("Rozpocz??e? Prace Kierowyc Autobusu.Zarobki 20 PLN Za Przystanek!")
jobVehicle = veh
jobTarget = 0
showMarker()
end)
addEventHandler("onClientResourceStop", resourceRoot, function()
if jobVehicle and getElementData(localPlayer, "gracz_praca") then
setElementData(localPlayer, "gracz_praca", false)
end
end)
addEventHandler("onClientVehicleExit", resourceRoot, function(plr, seat)
if seat == 0 then
if plr == localPlayer then
finishJob()
exports.notification:showBox ("info","Gratuluje Zako?czy?e? Prace Kierowcy Autobusu!")
--exports["rpg_noti"]:createNotification(el,"Gratuluje Zako?czy?e? Prace Kierowcy Autobusu!")
outputChatBox("Gratuluje Zako?czy?e? Prace Kierowcy Autobusu!")
end
end
end)
! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
local districtsBus = {
{1817.91,-1917.31,13.38},
{1916.32,-1936.04,13.38},
{1985.46,-1936.26,13.38},
{2085.96,-1915.64,13.38},
{2085.63,-1852.60,13.38},
{2085.70,-1806.89,13.38},
{2114.49,-1693.73,13.38},
{2116.98,-1581.85,25.96},
{2116.56,-1442.89,23.83},
{2086.14,-1380.24,23.83},
{2076.03,-1281.49,23.83},
{2075.67,-1172.02,23.66},
{2019.02,-1131.67,24.79},
{1927.82,-1131.63,25.01},
{1862.59,-1157.71,23.69},
{1795.70,-1170.01,23.65},
{1607.47,-1156.67,23.91},
{1514.15,-1156.63,23.91},
{1450.54,-1265.07,13.38},
{1450.02,-1418.88,13.38},
{1425.29,-1573.70,13.36},
{1425.43,-1671.88,13.38},
{1429.87,-1736.51,13.38},
{1629.79,-1736.56,13.38},
{1781.05,-1736.39,13.38},
{1817.39,-1788.47,13.38},
{1817.38,-1870.58,13.41},
}
local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsBus
function finishJob()
if jobMarker and isElement(jobMarker) then
destroyElement(jobMarker)
jobMarker = nil
end
if jobTarget and isElement(jobTarget) then
destroyElement(jobTarget)
jobTarget = nil
jobTarget = 0
end
triggerServerEvent("destroyVeh", localPlayer)
end
function busDriver(el, md)
if el ~= localPlayer or not md then return end
if jobTarget > maxTarget and getPedOccupiedVehicle(el) then return end
if jobTarget == maxTarget and not getPedOccupiedVehicle(el) then return end
if jobTarget == #districtsBus then
finishJob()
playSoundFrontEnd(5)
exports.notification:showBox ("info","Gratuluje Zako?czy?e? Prace Kierowcy Autobusu!")
--exports["rpg_noti"]:createNotification(el,"Gratuluje Zako?czy?e? Prace Kierowcy Autobusu!")
outputChatBox("Gratuluje Zako?czy?e? Prace Kierowcy Autobusu!")
else
showMarker()
playSoundFrontEnd(12)
triggerServerEvent("doATMOperation", resourceRoot, 10)
end
end
function showMarker()
if jobMarker and isElement(jobMarker) then
destroyElement(jobMarker)
jobMarker = nil
end
jobTarget = jobTarget + 1
jobMarker = createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint", 4,128,255,0)
if districtsBus[jobTarget+1] then
ile = districtsBus[jobTarget+1]
setMarkerTarget(jobMarker, ile[1], ile[2], ile[3])
end
addEventHandler("onClientMarkerHit", jobMarker, busDriver)
end
addEvent("STARTJobBus", true)
addEventHandler("STARTJobBus", resourceRoot, function(veh)
exports.notification:showBox ("info","Rozpocz??e? Prace Kierowyc Autobusu.Zarobki 20 PLN Za Przystanek!")
--exports["rpg_noti"]:createNotification(el,"Rozpocz??e? Prace Kierowyc Autobusu.Zarobki 10 PLN Za Przystanek!")
outputChatBox("Rozpocz??e? Prace Kierowyc Autobusu.Zarobki 20 PLN Za Przystanek!")
jobVehicle = veh
jobTarget = 0
showMarker()
end)
addEventHandler("onClientResourceStop", resourceRoot, function()
if jobVehicle and getElementData(localPlayer, "gracz_praca") then
setElementData(localPlayer, "gracz_praca", false)
end
end)
addEventHandler("onClientVehicleExit", resourceRoot, function(plr, seat)
if seat == 0 then
if plr == localPlayer then
finishJob()
exports.notification:showBox ("info","Gratuluje Zako?czy?e? Prace Kierowcy Autobusu!")
--exports["rpg_noti"]:createNotification(el,"Gratuluje Zako?czy?e? Prace Kierowcy Autobusu!")
outputChatBox("Gratuluje Zako?czy?e? Prace Kierowcy Autobusu!")
end
end
end)
STOPseba, Dzieje si? tak dlatego , ?e funkcja do ktorej triggerujesz ma zapisane aby zabiera? tobie pieni?dze i wp?aca? do bankomatu , polecam zrobi? now? funkcje wzoruj?c si? na niej i usun?? nie potrzebne elementy (takePlayerMoney , i to co ci przeszkadza.) I wtedy , jak b?dziesz robi? jak?? prac? to po prostu u?yjesz tego triggera.
addEvent("WyplataPraca", true)
addEventHandler("WyplataPraca", resourceRoot, function(kwota)
-- kwota dodatnia - wplata
-- kwota ujemna - wyplata
if type(kwota) ~= "number" then outputDebugString("Blad bankomatu xDDDDD") return end
if kwota>0 and kwota>getPlayerMoney(client) then return end -- komunikat bledu po stronie klienta
local dbid=getElementData(client,"player:uid")
local sr=exports["ogrpg-db"]:dbGet("SELECT `bank_money` FROM `ogrpg_users` WHERE id=? LIMIT 1",dbid)
if not sr or #sr < 1 then return end
sr=tonumber(sr[1].bank_money)
if not dbid then return end -- nie powinno sie zdarzyc
if kwota>0 then
if getPlayerMoney(client)<kwota then return end
--takePlayerMoney(client, kwota)
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET bank_money=bank_money+?? WHERE id=? LIMIT 1",tonumber(kwota),dbid)
local sr=exports["ogrpg-db"]:dbGet("SELECT `bank_money` FROM `ogrpg_users` WHERE id=? LIMIT 1",dbid)
if not sr or #sr < 1 then return end
sr=tonumber(sr[1].bank_money)
triggerEvent("admin:logs", root, string.format("WPLATA %d DO bankomatu (UID : %d) STAN KONTA %d",math.abs(tonumber(kwota)),dbid,sr))
--triggerEvent("broadcastCaptionedEvent", client, getPlayerName(client).." wp?aca pieni?dze do bankomatu", 3, 20, true)
--outputChatBox("* Wplaciles pieni?dze", client, 128,255,0)
elseif kwota<0 then
if (sr<math.abs(kwota)) then
--outputChatBox("* Nie masz tyle ?rodk?w na koncie!", client, 128,255,0)
-- triggerClientEvent(client,"onAnnouncement3", root, "Nie masz tyle ?rodk?w na koncie!", 5)
return
end
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET bank_money=bank_money-?? WHERE id=? LIMIT 1",math.abs(tonumber(kwota)),dbid)
local sr=exports["ogrpg-db"]:dbGet("SELECT `bank_money` FROM `ogrpg_users` WHERE id=? LIMIT 1",dbid)
if not sr or #sr < 1 then return end
sr=tonumber(sr[1].bank_money)
triggerEvent("admin:logs", root, string.format("WYPLATA %d z bankomatu (UID : %d) STAN KONTA %d",math.abs(tonumber(kwota)),dbid,sr))
--outputChatBox("* Wyplaciles pieni?dze", client, 128,255,0)
givePlayerMoney(client, math.abs(kwota))
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