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

Wysłany: 2018-02-26, 16:12


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

Witam co ?le zrobi?em, ?e nie wy?wietla mi si? informacja ?e kto? nie posiada prawka + nie dzia?a tak jak powinno


local code "StreetView"
local districtsBus = {
        {1416.53, -1875.6113.480.45359.93271.49},
        {1501.19, -1875.4013.480.16359.53272.46},
        {1570.74, -1863.4013.480.010.630.48},
        {1571.57, -1797.5013.48359.830.250.25},
        {1597.21, -1735.3713.480.230.25270.22},
        {1691.00, -1723.3613.48359.850.22342.00},
        {1691.69, -1634.3013.48359.630.010.51},
        {1640.53, -1590.0813.54359.900.0789.83},
        {1530.89, -1589.7613.480.420.0089.83},
        {1433.35, -1562.8513.440.31359.80352.55},
        {1457.36, -1460.5713.45359.960.00354.19},
        {1422.54, -1422.0913.480.13359.84357.34},
        {1370.00, -1393.0613.55359.45358.2090.77},
        {1330.72, -1474.8513.48359.680.10162.36},
        {1296.38, -1564.3013.480.18359.77176.66},
        {1295.04, -1677.3513.48359.70359.98179.22},
        {1295.11, -1783.9013.48359.460.00180.08},
        {1329.21, -1855.8213.48359.960.02262.14},
        {1369.73, -1893.9113.60359.9359.7178.2},
}

local jobTarget
local jobMarker
local jobVehicle
local maxTarget #districtsBus

function finishJob()
    if jobMarker and isElement(jobMarkerthen
        destroyElement(jobMarker)
        jobMarker nil
    end
    if isElement(blipthen
destroyElement(blip)
end
    if jobTarget and isElement(jobTargetthen
        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 getVehicleLicense(plr,type)
    if getElementData(plr,"player:license:pj"..type.."") ~= 1 then
        outputChatBox("* Nie posiadasz prawa jazdy kategorii "..type..", zdaj je w urz?dzie miasta"plr25500)
        return true
    end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE serial=? AND type=? AND active=1 AND time>NOW()"getPlayerSerial(plr), tostring(type))
    if result and #result > 0 then
        v=result[1]
        outputChatBox("* Posiadasz zawieszone prawo jazdy do "..v.time.." za "..v.reasonplr)
        return true
    else
        exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE serial=? AND type=? AND active=1 AND time<NOW()"getPlayerSerial(plr), tostring(type))
        return false
    end
end

function busDriver(elmd)
    if el ~= localPlayer or not md then return end
    if jobTarget maxTarget and getPedOccupiedVehicle(elthen return end
    if jobTarget == maxTarget and not getPedOccupiedVehicle(elthen return end
    
    if jobTarget == #districtsBus then
        finishJob()
        playSoundFrontEnd(5)
        outputChatBox("* Zako?czy?e?/a? prac?.")
    else
        showMarker()
        playSoundFrontEnd(12)
        premium math.random(685,710)
        zwykly math.random(620,645)
        if getElementData(localPlayer,"player:premium"then
        triggerServerEvent("givePlayerMoney"localPlayerpremium0)
        outputChatBox("[Premium]Otrzymujesz "..premium.." PLN za zidentyfikowanie punktu.")
        else
        triggerServerEvent("givePlayerMoney"localPlayerzwykly0)
        outputChatBox("Otrzymujesz "..zwykly.." PLN za zidentyfikowanie punktu.")
        end
    end
end

function showMarker()
    if jobMarker and isElement(jobMarkerthen
        destroyElement(jobMarker)
        jobMarker nil
    end
    if isElement(blipthen
destroyElement(blip)
end
    jobTarget jobTarget 1
    jobMarker createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "corona"4255255255)
        blip createBlip(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3],12)
    if districtsBus[jobTarget+1then
        ile districtsBus[jobTarget+1]
        setMarkerTarget(jobMarkerile[1], ile[2], ile[3])
    end
    
    addEventHandler("onClientMarkerHit"jobMarkerbusDriver)
end

addEvent("STARTJobBus"true)
addEventHandler("STARTJobBus"resourceRoot, function(veh)
    outputChatBox("* Rozpocze?e?/a? prace.")
    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(plrseat)
    if seat == 0 then
        if plr == localPlayer then
            finishJob()
            setElementPosition(localPlayer1382.58, -1896.5713.49)
            outputChatBox("Praca przerwana. Wracasz na miejsce gdzie zaczyna si? praca Street View")
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-26, 16:47


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Posiadasz modu?y oraz w ACL'u admin dodane takie co? jak 'resource.*'?

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-26, 16:58


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

"Ciastuu?" napisał/a:

Posiadasz modu?y oraz w ACL'u admin dodane takie co? jak 'resource.*'?

oczywi?cie

Postaw piwo autorowi tego posta
 

 
Tagi: brak :: informacji
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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