local districtsBus = {
{-2267.09, 513.41, 35.21},
{-2361.05, 508.25, 29.70},
{-2334.35, 446.11, 33.93},
{-2251.87, 324.60, 35.32},
{-2252.09, 137.86, 35.32},
{-2255.90, -53.92, 35.32},
{-2179.74, -70.35, 35.32},
{-2157.58, 29.73, 35.32},
{-2008.12, 32.28, 32.92},
{-2006.04, 152.42, 27.70},
{-2003.16, 327.24, 35.20},
{-2000.66, 582.50, 35.20},
{-1866.77, 602.79, 35.20},
{-1711.04, 640.27, 24.82},
{-1658.49, 728.29, 17.35},
{-1542.51, 753.95, 7.20},
{-1554.45, 849.46, 7.20},
{-1737.17, 849.34, 24.89},
{-1941.91, 849.34, 40.29},
{-1906.05, 920.55, 35.20},
{-1671.73, 920.66, 24.82},
{-1568.30, 1005.91, 7.20},
{-1619.79, 1233.35, 7.20},
{-1880.92, 1348.59, 7.20},
{-2094.87, 1274.71, 15.28},
{-2265.25, 1182.31, 55.78},
{-2265.34, 928.57, 66.66},
{-2265.42, 724.64, 49.49},
{-2265.30, 548.17, 35.22},
}
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",resourceRoot,jobVehicle)
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)
outputChatBox("* |NoName Polski Serwer RPG|Zako?czy?e?/a? prac?.")
else
showMarker()
playSoundFrontEnd(12)
triggerServerEvent("givePlayerMoney", localPlayer, 2, 0)
triggerServerEvent("punkty", localPlayer)
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,23,214,255,140)
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)
outputChatBox("* |NoName Polski Serwer RPG|Rozpocz??e?/a? prac?.")
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()
outputChatBox("* |NoName Polski Serwer RPG|Zako?czy?e? prac?")
end
end
end)
setElementData(aplayer,"Punkt",kwota) proponuje zmienic na :
setElementData(aplayer,"Punkt", getElementData(aplayer, "Punkt") + kwota)
kod:
addEventHandler('onResourceStart',getResourceRootElement(),
function()
call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Score")
for theKey,thePlayer in ipairs(getElementsByType ( "player" )) do
setElementData(thePlayer,"Punkt",0)
end
end)
addEventHandler('onPlayerJoin',getRootElement(),
function()
setElementData(source,"Punkt",0)
end)
function addScore(points)
setElementData(source, "points", getElementData(source, "points") + points)
end
addEvent("addScore", true)
addEventHandler("addScore", getRootElement(), addScore)
---------dawanie score
addCommandHandler ( "dajpunkt",
function ( player, cmd, nick, kwota )
if nick and kwota then
local aplayer = getPlayerFromName ( nick )
if aplayer then
kwota = tonumber(kwota)
setElementData(aplayer,"Punkt",kwota)
--givePlayerMoney ( aplayer, kwota )
outputChatBox ( "Punkty dodane" )
else
outputChatBox( "Nie jestes H@", getRootElement())
outputChatBox ( "Nieudana proba dodania Punkty." )
end
end
end )
zamie? na :
addEventHandler('onResourceStart',getResourceRootElement(),
function()
call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Score")
for theKey,thePlayer in ipairs(getElementsByType ( "player" )) do
setElementData(thePlayer,"Punkt",0)
end
end)
addEventHandler('onPlayerJoin',getRootElement(),
function()
setElementData(source,"Punkt",0)
end)
function addScore(points)
setElementData(source, "Punkt", getElementData(source, "Punkt") + points)
end
addEvent("addScore", true)
addEventHandler("addScore", getRootElement(), addScore)
---------dawanie score
addCommandHandler ( "dajpunkt",
function ( player, cmd, nick, kwota )
if nick and kwota then
local aplayer = getPlayerFromName ( nick )
if aplayer then
kwota = tonumber(kwota)
setElementData(aplayer,"Punkt",kwota)
--givePlayerMoney ( aplayer, kwota )
outputChatBox ( "Punkty dodane" )
else
outputChatBox ( "Nieudana proba dodania Punkty." )
end
end
end )
oraz kod :
local districtsBus = {
{-2267.09, 513.41, 35.21},
{-2361.05, 508.25, 29.70},
{-2334.35, 446.11, 33.93},
{-2251.87, 324.60, 35.32},
{-2252.09, 137.86, 35.32},
{-2255.90, -53.92, 35.32},
{-2179.74, -70.35, 35.32},
{-2157.58, 29.73, 35.32},
{-2008.12, 32.28, 32.92},
{-2006.04, 152.42, 27.70},
{-2003.16, 327.24, 35.20},
{-2000.66, 582.50, 35.20},
{-1866.77, 602.79, 35.20},
{-1711.04, 640.27, 24.82},
{-1658.49, 728.29, 17.35},
{-1542.51, 753.95, 7.20},
{-1554.45, 849.46, 7.20},
{-1737.17, 849.34, 24.89},
{-1941.91, 849.34, 40.29},
{-1906.05, 920.55, 35.20},
{-1671.73, 920.66, 24.82},
{-1568.30, 1005.91, 7.20},
{-1619.79, 1233.35, 7.20},
{-1880.92, 1348.59, 7.20},
{-2094.87, 1274.71, 15.28},
{-2265.25, 1182.31, 55.78},
{-2265.34, 928.57, 66.66},
{-2265.42, 724.64, 49.49},
{-2265.30, 548.17, 35.22},
}
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",resourceRoot,jobVehicle)
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)
outputChatBox("* |NoName Polski Serwer RPG|Zako?czy?e?/a? prac?.")
else
showMarker()
playSoundFrontEnd(12)
triggerServerEvent("givePlayerMoney", localPlayer, 2, 0)
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,23,214,255,140)
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)
outputChatBox("* |NoName Polski Serwer RPG|Rozpocz??e?/a? prac?.")
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()
outputChatBox("* |NoName Polski Serwer RPG|Zako?czy?e? prac?")
end
end
end)
Zamie? na :
local districtsBus = {
{-2267.09, 513.41, 35.21},
{-2361.05, 508.25, 29.70},
{-2334.35, 446.11, 33.93},
{-2251.87, 324.60, 35.32},
{-2252.09, 137.86, 35.32},
{-2255.90, -53.92, 35.32},
{-2179.74, -70.35, 35.32},
{-2157.58, 29.73, 35.32},
{-2008.12, 32.28, 32.92},
{-2006.04, 152.42, 27.70},
{-2003.16, 327.24, 35.20},
{-2000.66, 582.50, 35.20},
{-1866.77, 602.79, 35.20},
{-1711.04, 640.27, 24.82},
{-1658.49, 728.29, 17.35},
{-1542.51, 753.95, 7.20},
{-1554.45, 849.46, 7.20},
{-1737.17, 849.34, 24.89},
{-1941.91, 849.34, 40.29},
{-1906.05, 920.55, 35.20},
{-1671.73, 920.66, 24.82},
{-1568.30, 1005.91, 7.20},
{-1619.79, 1233.35, 7.20},
{-1880.92, 1348.59, 7.20},
{-2094.87, 1274.71, 15.28},
{-2265.25, 1182.31, 55.78},
{-2265.34, 928.57, 66.66},
{-2265.42, 724.64, 49.49},
{-2265.30, 548.17, 35.22},
}
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",resourceRoot,jobVehicle)
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)
outputChatBox("* |NoName Polski Serwer RPG|Zako?czy?e?/a? prac?.")
else
showMarker()
playSoundFrontEnd(12)
triggerServerEvent("givePlayerMoney", localPlayer, 2, 0)
triggerEvent("addScore", localPlayer, 1)
outputChatBox("bla bla bla wjechales w marker i teraz masz punktow: "..getElementData(localPlayer, "Punkt"))
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,23,214,255,140)
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)
outputChatBox("* |NoName Polski Serwer RPG|Rozpocz??e?/a? prac?.")
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()
outputChatBox("* |NoName Polski Serwer RPG|Zako?czy?e? prac?")
end
end
end)
daj znac czy dzia?a
ps. element data sie kasuje po wyjsciu z serwera, wiec nie zdziw sie jezeli nie bedziesz mial punktow po ponownym wejsciu na serwer. dodatkowo przy onPlayerJoin znow ustawiasz punkty na 0
Podpis
Jedyny kontakt ze mną to PW forum
local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
setElementData(aplayer,"Punkt",kwota) proponuje zmienic na :
setElementData(aplayer,"Punkt", getElementData(aplayer, "Punkt") + kwota)
kod:
addEventHandler('onResourceStart',getResourceRootElement(),
function()
call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Score")
for theKey,thePlayer in ipairs(getElementsByType ( "player" )) do
setElementData(thePlayer,"Punkt",0)
end
end)
addEventHandler('onPlayerJoin',getRootElement(),
function()
setElementData(source,"Punkt",0)
end)
function addScore(points)
setElementData(source, "points", getElementData(source, "points") + points)
end
addEvent("addScore", true)
addEventHandler("addScore", getRootElement(), addScore)
---------dawanie score
addCommandHandler ( "dajpunkt",
function ( player, cmd, nick, kwota )
if nick and kwota then
local aplayer = getPlayerFromName ( nick )
if aplayer then
kwota = tonumber(kwota)
setElementData(aplayer,"Punkt",kwota)
--givePlayerMoney ( aplayer, kwota )
outputChatBox ( "Punkty dodane" )
else
outputChatBox( "Nie jestes H@", getRootElement())
outputChatBox ( "Nieudana proba dodania Punkty." )
end
end
end )
zamie? na :
addEventHandler('onResourceStart',getResourceRootElement(),
function()
call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Score")
for theKey,thePlayer in ipairs(getElementsByType ( "player" )) do
setElementData(thePlayer,"Punkt",0)
end
end)
addEventHandler('onPlayerJoin',getRootElement(),
function()
setElementData(source,"Punkt",0)
end)
function addScore(points)
setElementData(source, "Punkt", getElementData(source, "Punkt") + points)
end
addEvent("addScore", true)
addEventHandler("addScore", getRootElement(), addScore)
---------dawanie score
addCommandHandler ( "dajpunkt",
function ( player, cmd, nick, kwota )
if nick and kwota then
local aplayer = getPlayerFromName ( nick )
if aplayer then
kwota = tonumber(kwota)
setElementData(aplayer,"Punkt",kwota)
--givePlayerMoney ( aplayer, kwota )
outputChatBox ( "Punkty dodane" )
else
outputChatBox ( "Nieudana proba dodania Punkty." )
end
end
end )
oraz kod :
local districtsBus = {
{-2267.09, 513.41, 35.21},
{-2361.05, 508.25, 29.70},
{-2334.35, 446.11, 33.93},
{-2251.87, 324.60, 35.32},
{-2252.09, 137.86, 35.32},
{-2255.90, -53.92, 35.32},
{-2179.74, -70.35, 35.32},
{-2157.58, 29.73, 35.32},
{-2008.12, 32.28, 32.92},
{-2006.04, 152.42, 27.70},
{-2003.16, 327.24, 35.20},
{-2000.66, 582.50, 35.20},
{-1866.77, 602.79, 35.20},
{-1711.04, 640.27, 24.82},
{-1658.49, 728.29, 17.35},
{-1542.51, 753.95, 7.20},
{-1554.45, 849.46, 7.20},
{-1737.17, 849.34, 24.89},
{-1941.91, 849.34, 40.29},
{-1906.05, 920.55, 35.20},
{-1671.73, 920.66, 24.82},
{-1568.30, 1005.91, 7.20},
{-1619.79, 1233.35, 7.20},
{-1880.92, 1348.59, 7.20},
{-2094.87, 1274.71, 15.28},
{-2265.25, 1182.31, 55.78},
{-2265.34, 928.57, 66.66},
{-2265.42, 724.64, 49.49},
{-2265.30, 548.17, 35.22},
}
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",resourceRoot,jobVehicle)
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)
outputChatBox("* |NoName Polski Serwer RPG|Zako?czy?e?/a? prac?.")
else
showMarker()
playSoundFrontEnd(12)
triggerServerEvent("givePlayerMoney", localPlayer, 2, 0)
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,23,214,255,140)
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)
outputChatBox("* |NoName Polski Serwer RPG|Rozpocz??e?/a? prac?.")
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()
outputChatBox("* |NoName Polski Serwer RPG|Zako?czy?e? prac?")
end
end
end)
Zamie? na :
local districtsBus = {
{-2267.09, 513.41, 35.21},
{-2361.05, 508.25, 29.70},
{-2334.35, 446.11, 33.93},
{-2251.87, 324.60, 35.32},
{-2252.09, 137.86, 35.32},
{-2255.90, -53.92, 35.32},
{-2179.74, -70.35, 35.32},
{-2157.58, 29.73, 35.32},
{-2008.12, 32.28, 32.92},
{-2006.04, 152.42, 27.70},
{-2003.16, 327.24, 35.20},
{-2000.66, 582.50, 35.20},
{-1866.77, 602.79, 35.20},
{-1711.04, 640.27, 24.82},
{-1658.49, 728.29, 17.35},
{-1542.51, 753.95, 7.20},
{-1554.45, 849.46, 7.20},
{-1737.17, 849.34, 24.89},
{-1941.91, 849.34, 40.29},
{-1906.05, 920.55, 35.20},
{-1671.73, 920.66, 24.82},
{-1568.30, 1005.91, 7.20},
{-1619.79, 1233.35, 7.20},
{-1880.92, 1348.59, 7.20},
{-2094.87, 1274.71, 15.28},
{-2265.25, 1182.31, 55.78},
{-2265.34, 928.57, 66.66},
{-2265.42, 724.64, 49.49},
{-2265.30, 548.17, 35.22},
}
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",resourceRoot,jobVehicle)
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)
outputChatBox("* |NoName Polski Serwer RPG|Zako?czy?e?/a? prac?.")
else
showMarker()
playSoundFrontEnd(12)
triggerServerEvent("givePlayerMoney", localPlayer, 2, 0)
triggerEvent("addScore", localPlayer, 1)
outputChatBox("bla bla bla wjechales w marker i teraz masz punktow: "..getElementData(localPlayer, "Punkt"))
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,23,214,255,140)
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)
outputChatBox("* |NoName Polski Serwer RPG|Rozpocz??e?/a? prac?.")
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()
outputChatBox("* |NoName Polski Serwer RPG|Zako?czy?e? prac?")
end
end
end)
daj znac czy dzia?a
ps. element data sie kasuje po wyjsciu z serwera, wiec nie zdziw sie jezeli nie bedziesz mial punktow po ponownym wejsciu na serwer. dodatkowo przy onPlayerJoin znow ustawiasz punkty na 0
tylko na czacie mam info ze bla bla bla wjechales w marker i teraz masz punktow: 69 a nic nie dostaje
Ca?y czas jak wjezdzasz w markery masz 69 punktow?
Podpis
Jedyny kontakt ze mną to PW forum
local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
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