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

Wysłany: 2018-06-13, 23:10


Grubyyy







Wiek: 22
Na forum: 3121 dni
Posty: 22
Nick w MP: GrubyMTA



Respekt: 50

Hej! To znowu ja.

Od jakiego? czasu na gtao.pl jest skrypt "Custom Markers" ( link http://gtao.pl/%3Cfont-co...rs-vt115427.htm )

Przyznam szczerze ?e markery bardzo mi si? spodoba?y tylko mam pewien problem.
Nie wiem jak w gotowym kodzie podmieni? normalne markery, na te takie paradajsowe.


Podaje ca?y kod, w kt?rym chcia?bym podmieni? markery

 

local m1 createMarker(-1754.20962.3524.88-.9"cylinder"3.00186255)
local t createElement('text')
setElementPosition(t,-1754.20962.3524.88)
setElementData(t,"name","Rozpocz?cie pracy autobus?w")
local vehs = {}

createBlip(-1754.20962.3524.8846,2,0,0,0,0,0,275)

local code "Autobusy"
        local zone createColCuboid(-1542.65320599.935496.183167.60083007812542.4381103515637.0280956268311)

addEventHandler("onMarkerHit"m1, function(elmd)
    if getElementData(el"vehicle_job_owner"then
        outputChatBox("praca w trakcie poprawek"el)
        return
    end
    
    if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end
    if getElementData(el,"player:reputation") < 200 then outputChatBox("Aby rozpocz?? t? prac? potrzebujesz minimum 200 RP!",el) return end
    if getElementData(el,"player:job"then return end
    if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("*Parking zaj?ty czekaj a? wyjedzie!",el) return end
    local x,y,getElementPosition(el)
    local autbus createVehicle(431, -1755.78951.7624.84359.5360.0269.7)
    setElementFrozen(el,true)
    setElementData(autbus"vehicle_job_owner"el)
    setElementData(autbus"vehicle:fuel"100000)
    setElementData(autbus"vehicle:mileage"math.random(50000,80000))
    setVehicleHandling(autbus"maxVelocity"100.0)
    setElementData(el,"player:job",code)
    setTimer(warpPedIntoVehicle,2000,1,elautbus)
    setTimer(setElementFrozen,2000,1,elfalse)
    triggerClientEvent(el"STARTJobBus"resourceRootautbus)

    vehs[el] = autbus
end)

addEvent("STOPJobBus"true)
addEventHandler("STOPJobBus"resourceRoot, function()
    local pojazd getPedOccupiedVehicle(localPlayer)
    if pojazd then
        destroyElement(pojazd)
    end
end)

addEvent("destroyVeh"true)
addEventHandler("destroyVeh"getRootElement(),
function()
     if vehs[sourcethen
          if isElement(vehs[source]) then destroyElement(vehs[source]) end
     end
end)

addEvent("onPlayerQuit"true)
addEventHandler "onPlayerQuit"getRootElement(), function()
     if vehs[sourcethen
          if isElement(vehs[source]) then destroyElement(vehs[source]) end
    end
end


Oraz drugi kod z checkpointami (tras?)
 local code "Autobusy"
local districtsBus = {
{-1734.31941.3124.84359.50.0212.1},
{-1581.19918.697.58358.8359.7270.1},
{-1562.08789.627.14359.50.0180.5},
{-1566.04505.877.14359.50.0170.2},
{-1802.76254.3614.663.21.2143.5},
{-1801.11, -40.3914.90354.80.4181.5},
{-1801.62, -308.3425.05358.70.1177.1},
{-1880.40, -575.4924.55359.50.090.5},
{-2195.72, -447.8850.332.50.045.4},
{-2252.01, -165.1735.28359.5359.61.0},
{-2249.09197.9635.27359.50.0358.9},
{-2677.44159.564.28359.5359.990.5},
{-2708.173.654.28359.50.0181.6},
{-2689.33, -212.744.28359.5359.9272.1},
{-2419.26, -88.4235.27359.4359.3359.2},
{-2035.42, -72.3135.26359.5359.9270.0},
{-2003.60140.1827.64359.5360.0357.7},
{-1999.89424.2035.12359.50.2359.6},
{-2000.23734.4845.46358.61.20.6},
{-1894.90907.8035.12359.5359.7342.2},
{-1755.33951.9024.84359.50.0270.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 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)
        triggerServerEvent("givePlayerMoney"localPlayer30000)
        outputChatBox("Za dojazd otrzymujesz 3000 $")
    end
end

function showMarker()
if isElement(blipthen
destroyElement(blip)
end
    if jobMarker and isElement(jobMarkerthen
        destroyElement(jobMarker)
        jobMarker nil
    end
    
    jobTarget jobTarget 1
    jobMarker createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "corona"40255255)
    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("* Rozpocz??e?/a? prac?.")
    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()
            outputChatBox("Zako?czy?e? prac?")
        end
    end
end


Mi?o by by?o gdyby kto? wyt?umaczy?. :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-13, 23:29


nanKy







Wiek: 22
Na forum: 3865 dni
Posty: 498
Nick w MP: nanky

Piwa: 1773

Respekt: 239
Respekt: 239Respekt: 239

Zmie? funkcje createMarker na:
exports.custom_markers:createCustomMarker
czyli

local m1 exports.custom_markers:createCustomMarker(-1754.20962.3524.88-.9"cylinder"3.00186255)

i tak dalej...

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Grubyyy
Wysłany: 2018-06-14, 11:07


Eitho







Wiek: 24
Na forum: 3489 dni
Posty: 330
Nick w MP: Eitho

Piwa: 746

Respekt: 256,5
Respekt: 256,5Respekt: 256,5Respekt: 256,5

Albo wklej sobie na samej g?rze kodu to:
function createMarker(x,ztyprozmiarrgba)
    local marker exports['custom_markers']:createCustomMarker(xyztyp or 'cylinder'rozmiar or '3'or 0or 0or 255or 255)
    return marker
end


Podpis
good old days :]
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Grubyyy
Wysłany: 2018-06-14, 21:10


Grubyyy







Wiek: 22
Na forum: 3121 dni
Posty: 22
Nick w MP: GrubyMTA



Respekt: 50

Dzi?kuje pi?knie za pomoc!

Postaw piwo autorowi tego posta
 

 
Tagi: customowe :: markery :: jak :: poprawnie :: użyć?
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