Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-05-01, 20:25


Arztin

floki






Wiek: 25
Na forum: 3164 dni
Posty: 66
Nick w MP: Kachi

Piwa: 4

Respekt: 10,5

Ostrzeżeń: 20%
Podmieni?em kordy pracy autobus?w, ale jak wchodz? w marker praca wgl si? nie odpala. ZA POMOC DAJE :piwo:

--[[
Praca busa

]]--

local code = "Autobusy"
local districtsBus 


local districtsBus = {
 {-211.65,1200.89,20.73},
 {-1711.17,951.17,24.14},
 {-172.91,1200.91,20.71},
 {-43.86,1201.09,20.35},
 {-0.48,1201.25,20.57},
 {47.82,1201.28,19.93},
 {123.83,1188.14,18.27},
 {191.09,1070.76,20.33},
 {224.07,968.66,29.47},
 {152.05,898.86,21.86},
 {31.18,887.75,25.34},
 {-66.92,854.48,19.09},
 {-152.77,816.76,22.77},
 {-263.93,791.28,17.58},
 {-257.73,828.08,15.09},
 {-213.71,870.92,11.53},
 {-189.94,978.75,20.10},
 {-187.71,1018.77,20.73},
 {-247.31,1020.31,20.74},
 {-273.89,1063.29,20.73},
 {-315.05,1084.09,20.73},
 {-344.14,1130.12,20.73},
 {-287.51,1146.32,20.73},
 {-272.03,1188.89,20.72},
 {-239.23,1210.57,20.88},
 }


local districtsBus2 = {
 {-211.65,1200.89,20.73},
 {-1711.17,951.17,24.14},
 {-172.91,1200.91,20.71},
 {-43.86,1201.09,20.35},
 {-0.48,1201.25,20.57},
 {47.82,1201.28,19.93},
 {123.83,1188.14,18.27},
 {191.09,1070.76,20.33},
 {224.07,968.66,29.47},
 {152.05,898.86,21.86},
 {31.18,887.75,25.34},
 {-66.92,854.48,19.09},
 {-152.77,816.76,22.77},
 {-263.93,791.28,17.58},
 {-257.73,828.08,15.09},
 {-213.71,870.92,11.53},
 {-189.94,978.75,20.10},
 {-187.71,1018.77,20.73},
 {-247.31,1020.31,20.74},
 {-273.89,1063.29,20.73},
 {-315.05,1084.09,20.73},
 {-344.14,1130.12,20.73},
 {-287.51,1146.32,20.73},
 {-272.03,1188.89,20.72},
 {-239.23,1210.57,20.88},
 }


local districtsBus3 = {
 {-211.65,1200.89,20.73},
 {-1711.17,951.17,24.14},
 {-172.91,1200.91,20.71},
 {-43.86,1201.09,20.35},
 {-0.48,1201.25,20.57},
 {47.82,1201.28,19.93},
 {123.83,1188.14,18.27},
 {191.09,1070.76,20.33},
 {224.07,968.66,29.47},
 {152.05,898.86,21.86},
 {31.18,887.75,25.34},
 {-66.92,854.48,19.09},
 {-152.77,816.76,22.77},
 {-263.93,791.28,17.58},
 {-257.73,828.08,15.09},
 {-213.71,870.92,11.53},
 {-189.94,978.75,20.10},
 {-187.71,1018.77,20.73},
 {-247.31,1020.31,20.74},
 {-273.89,1063.29,20.73},
 {-315.05,1084.09,20.73},
 {-344.14,1130.12,20.73},
 {-287.51,1146.32,20.73},
 {-272.03,1188.89,20.72},
 {-239.23,1210.57,20.88},
 }


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  
if getElementData(localPlayer,"player:job") == code then
setElementData(localPlayer,"player:job",false)
end
triggerServerEvent("destroyVeh", localPlayer)
end
addEventHandler ( "onClientPlayerWasted", getLocalPlayer(),finishJob)


addEvent("finishJob",true)
addEventHandler("finishJob",root,function(plr)
if plr ~= localPlayer then return end
finishJob()
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(2)

        --outputChatBox("#ffffff[#41E0FFInformacja#ffffff]#41E0FF Zako?czy?e?/a? prac?.",255,255,255,true)
        addEventHandler("onClientRender",root,render3)
        setTimer(renderstop3,2000,1)
    else
        kasa = math.random(1000,1750)
        showMarker()
        playSoundFrontEnd(12)
        if getElementData(el,"player:premium") then
        --outputChatBox("* Zidentyfikowa?e?(a?) punkt i otrzymujesz 100 PLN.")
        triggerServerEvent("givePlayerMoney", el, kasa*1.3, 0)
        setElementData(el,"player:srp", getElementData(el,"player:srp")+math.random(0,1))
        addEventHandler("onClientRender",root,render2)
        setTimer(renderstop2,1000,1)
        else
        --outputChatBox("* Zidentyfikowa?e?(a?) punkt i otrzymujesz 75 PLN.")
        triggerServerEvent("givePlayerMoney", el, kasa, 0)
        setElementData(el,"player:srp", getElementData(el,"player:srp")+math.random(0,1))
        addEventHandler("onClientRender",root,render2)
        setTimer(renderstop2,1000,1)
        end
    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, 0, 255, 255)
    
    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)
    trasa = math.random(1,3)
    if trasa==1 then
        districtsBus = districtsBus
    elseif trasa==2 then
        districtsBus = districtsBus2
    elseif trasa==3 then
        districtsBus = districtsBus3
    end
    maxTarget = #districtsBus
    addEventHandler("onClientRender",root,render1)
        setTimer(renderstop1,4000,1)
    --outputChatBox("* Rozpocz??e?/a? prac? StreetView.")
    --outputChatBox("* Je?dzij po punktach i uzupe?niaj map?.")
    jobVehicle = veh
    jobTarget = 0
    showMarker()
end)

addEventHandler("onClientResourceStop", resourceRoot, function()
    if jobVehicle and getElementData(localPlayer, "player:job") then
        setElementData(localPlayer, "player:job", false)
    end
end)


addEventHandler("onClientVehicleExit", resourceRoot, function(plr, seat)
    if seat == 0 then
        if plr == localPlayer then
            finishJob()
            --outputChatBox("#ffffff[#41E0FFInformacja#ffffff]#41E0FF Zako?czy?e? prac?",255,255,255,true)
            addEventHandler("onClientRender",root,render3)
            setTimer(renderstop3,2000,1)
        end
    end
end)


local screenW, screenH = guiGetScreenSize()
function render1()
dxDrawText("Rozpocz??e? prac? Kierowcy PKS jed? po ludzi. \n Przydzielono ci lini? nr:"..trasa, screenW * 0.3656, screenH * 1.3553, screenW * 0.6273, screenH * 0.3193, tocolor(255, 255, 255, 255), 1.5, "default", "center", "center", false, false, false, false, false)
end

function render2()
dxDrawText("Zabra?e? pasa?er?w za bilety dostajesz "..kasa.."PLN", screenW * 0.3656, screenH * 1.3553, screenW * 0.6273, screenH * 0.3193, tocolor(255, 255, 255, 255), 1.5, "default", "center", "center", false, false, false, false, false)
end

function render3()
dxDrawText("Zako?czy?e? prac? kierowcy PKS'u.", screenW * 0.3656, screenH * 1.3553, screenW * 0.6273, screenH * 0.3193, tocolor(255, 255, 255, 255), 1.5, "default", "center", "center", false, false, false, false, false)
end

function render4()
dxDrawText("Zako?czy?e? prace kierowcy PKS'u.", screenW * 0.3656, screenH * 1.3553, screenW * 0.6273, screenH * 0.3193, tocolor(255, 255, 255, 255), 1.5, "default", "center", "center", false, false, false, false, false)
end

function render5()
dxDrawText("Posiadasz ju? aktywn? prac?.", screenW * 0.3656, screenH * 1.3553, screenW * 0.6273, screenH * 0.3193, tocolor(255, 255, 255, 255), 1.5, "default", "center", "center", false, false, false, false, false)
end






function renderstop1()
removeEventHandler("onClientRender",root,render1)
end
function renderstop2()
removeEventHandler("onClientRender",root,render2)
end
function renderstop3()
removeEventHandler("onClientRender",root,render3)
end
function renderstop4()
removeEventHandler("onClientRender",root,render4)
end
function renderstop5()
removeEventHandler("onClientRender",root,render5)
end


Podpis

Multi-Zone.gclan.pl
CZEKAMY NA CIEBIE!

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 3 piw(a):
lagereQQ, krystiankoxk, Tobiaszmatysik1
Wysłany: 2018-05-02, 10:08


Atroth







Wiek: 24
Na forum: 3818 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4813

Respekt: 540
Respekt: 540

Arztin, Jakie? db3? Jak tak to wska? konkretn? linijk? (podaj tre?? b??du).

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-02, 11:59


DylemaT929

Nikt






Wiek: 28
Na forum: 4182 dni
Posty: 340
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

Jest opcja ?e musisz zrobi? reconnect. W nie kt?rych pracach dorywczych tak jest.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Arztin
Wysłany: 2018-05-02, 12:40


Arztin

floki






Wiek: 25
Na forum: 3164 dni
Posty: 66
Nick w MP: Kachi

Piwa: 4

Respekt: 10,5

Ostrzeżeń: 20%
"DylemaT929" napisał/a:

Jest opcja ?e musisz zrobi? reconnect. W nie kt?rych pracach dorywczych tak jest.

Tak, dziala.

Podpis

Multi-Zone.gclan.pl
CZEKAMY NA CIEBIE!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-03, 20:49


Ciastuuś

As-salamu alaykum






Wiek: 27
Na forum: 3212 dni
Posty: 800
Nick w MP: Ciastuuś

Piwa: 4304

Respekt: 640
Respekt: 640Respekt: 640

"Arztin" napisał/a:

"DylemaT929" napisał/a:

Jest opcja ?e musisz zrobi? reconnect. W nie kt?rych pracach dorywczych tak jest.

Tak, dziala.


Czy?by problem rozwi?zany? Je?eli nie to podaj dalsze b??dy.

Podpis
As-salamu alaykum
Postaw piwo autorowi tego posta
 

 
Tagi: skrypt :: busy :: play :: your :: stories :: 3.0
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Skrypt na BUSY, Play Your Stories 3.0 Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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
Dodaj temat do Ulubionych
Wersja do druku