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

Wysłany: 2020-06-28, 11:56


IceBrick







Wiek: 26
Na forum: 3682 dni
Posty: 11

Piwa: 1

Respekt: 50

Witam mam problem, gdy? po zrobieniu prawa jazdy nie teleportuje mnie poza plac manewrowy.

function finishLicense(value)
    if isElement(licenseMarker) and licenseMarker then
        destroyElement(licenseMarker)
        licenseMarker=nil
    end
    if isElement(licenseBlip) and licenseBlip then
        destroyElement(licenseBlip)
        licenseBlip=nil
    end
    if value == true then
        licenseCategory=nil
        licenseVehicle=nil
        licenseMarker=nil
        licenseTarget=nil
        licenseBlip=nil
    end
end
addEvent("license:finish",true)
addEventHandler("license:finish", resourceRoot, finishLicense)

function showMarker()
    local pos=categoryPositions[licenseCategory][licenseTarget]
    if licenseCategory ~= "L" then
    licenseMarker=createMarker(pos[1], pos[2], pos[3], "checkpoint", 1.5, 0, 0, 255, 155)
    else
    licenseMarker=createMarker(pos[1], pos[2], pos[3], "ring", 3.5, 0, 0, 255, 155)
    end
    licenseBlip=createBlip(pos[1], pos[2], pos[3], 0, 1.15, 0, 255, 0)
    if categoryPositions[licenseCategory][licenseTarget+1] then
          e=categoryPositions[licenseCategory][licenseTarget+1]
        setMarkerTarget(licenseMarker, e[1], e[2], e[3])
    end
    addEventHandler("onClientMarkerHit", licenseMarker, function(el,md)
        if not md or el~=localPlayer then return end
        if not getPedOccupiedVehicle(el) then return end
        if licenseTarget < #categoryPositions[licenseCategory] then
            --local sound=playSound(":ogrpg-misc/misc/point.wav")
            --setSoundVolume(sound, 1.0)
            
            finishLicense(false)
            licenseTarget=licenseTarget+1
            showMarker()
        else
            --local sound=playSound(":ogrpg-misc/misc/success.flac")
            --setSoundVolume(sound, 1.0)

            outputChatBox("* Zda?e?(a?) egzamin. Gratulacje!")
            triggerServerEvent("license:vehdel", resourceRoot, licenseVehicle)
            setElementData(localPlayer,"player:license:pj"..licenseCategory, 1)
            setElementPosition(localPlayer, -2026.79,-97.43,35.16, true)
            finishLicense(true)
        end
    end)
end

addEvent("license:start",true)
addEventHandler("license:start", resourceRoot, function(category,vehicle)
    licenseTarget=1
    licenseBlip=nil
    licenseMarker=nil
    licenseCategory=category
    licenseVehicle=vehicle
    showMarker()
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-28, 12:12


P.Wiśnia

Programista LUA






Wiek: 25
Na forum: 4185 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 378

Respekt: 100
Respekt: 100

setElementPosition(localPlayer,-2026.79,-97.43,35.16)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-28, 12:27


IceBrick







Wiek: 26
Na forum: 3682 dni
Posty: 11

Piwa: 1

Respekt: 50

po usuni?ciu true nie pojawiaj? si? markery gdzie trzeba jecha?

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: działa :: teleport :: zrobieniu :: prawka
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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