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

Wysłany: 2015-08-27, 10:02


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Siemanko , gdzie moge doda? ten kod ? aby si? wy?wietla?a szcza?ka gdzie mamy jecha? ? do kt?rego markeru ;

addEventHandler('onClientRender', root,
    function ()
        local rotation = getScreenRotationFromWorldPosition( 0, 0, 0 )
        dxDrawImage( 100,100, 100,100, "arrow.png", rotation )
    end
)


a tutaj ten kod gdzie to dodac

--[[





@copyright 2013-2014 Split <split@go-life.pl>
@author Split <split@go-life.pl>
@version 1.0 beta
@changelog:
* Poprawiono prac?.

Nie masz prawa u?ywac tego kodu bez mojej zgody.
Napisz do mnie by? mo?e si? zgodz? na u?ycie kodu.
]]--
local districtsBus = {
 {1587.5682373047, 1639.0322265625, 9.90},
 {1522.6079101563, 1630.0537109375, 9.90},
 {1501.4533691406, 1559.3776855469, 9.90},
 {1551.7503662109, 1498.5023193359, 9.90},
 {1582.4689941406, 1417.3887939453, 9.90},
 {1572.2294921875, 1342.3723144531, 9.90},
 {1620.1942138672, 1273.1031494141, 9.90},
 {1577.0076904297, 1229.8157958984, 9.90},
 {1474.8508300781, 1235.5185546875, 9.90},
 {1397.1556396484, 1277.6910400391, 9.90},
 {1435.08984375, 1399.2395019531, 9.90},
 {1458.4331054688, 1435.2819824219, 9.90},
 {1460.69921875, 1438.7807617188, 9.90},
 {1508.1932373047, 1518.2768554688, 9.90},
 {1542.7019042969, 1589.5841064453, 9.90},
 {1603.6715087891, 1644.4538574219, 9.90},


    
    }

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)
        outputChatBox("* Zako?czy?e?/a? prac?.")
    else
        showMarker()
        playSoundFrontEnd(12)
        triggerServerEvent("giveGPoint", root) 
        triggerServerEvent("givePlayerMoney", el, 5 ,1)
    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], "cylinder", 4, 0, 0, 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)
    outputChatBox("* 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("* Zako?czy?e? prac?")
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-27, 11:13


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4536 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Prosz? ci?, nie bierz si? za programowanie, je?li nie znasz nawet prostych zasad LUA oraz nie potrafisz interpretowa? napisanego ju? kodu.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-27, 12:24


kubak14







Wiek: 24
Na forum: 5346 dni
Posty: 119
Nick w MP: Heavy

Piwa: 149

Respekt: 45,8

Ostrzeżeń: 20%
Ch?opie ty nawet podstaw nie znasz a takie rzeczy chcesz robi?...

Naucz si? podstaw p??niej r?b co? takiego

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-27, 14:22


Terr9909

Skrypter LUA






Wiek: 27
Na forum: 4375 dni
Posty: 346
Nick w MP: Split

Piwa: 1043

Respekt: 182,8
Respekt: 182,8Respekt: 182,8


Więcej informacji znajdziesz w Wikipedii MTA:

createPickup


Więcej informacji znajdziesz w Wikipedii MTA:

onClientPickupHit


Postaw piwo autorowi tego posta
 

 
Tagi: praca-strzałka
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