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

Wysłany: 2017-02-14, 11:07


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Witam chce aby w Pracy trzeba by?o mie? prawo jazdy Kat. L
I Moge normalnie wchodzic do samolotu jak nie mam Licencji

//Tylko w pracy aby dzia?a?o to (Nie chce aby by?o trzeba mie? prawko Og?lnie)


Oto kod

-- Od?wie?anie tabeli
function refreshingb(client)
    -- Pobieramy UID gracza
    local uid=getElementData(client,"player:uid")
    if not uid then return end

end

local categoryL={592,553,577,488,511,497,548,563,512,476,593,447,425,519,520,460,417,469,487,513}

-- Kod s?u??cy od sprawdzania prawa jazdy
function getVehicleLicense(plr,type)
local qr exports['ogrpg-db']:dbGet("SELECT * FROM ogrpg_users WHERE id AND pjL=?"id"0")
if #qr == 1 then outputChatBox("Nie Posiadasz Licencji na Drony!", source, 255, 255, 255) return end
        query=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","L"getPlayerSerial(target))
        local result=exports["ogrpg-db"]:pobierzWyniki(query)
        if (resultthen
            cancelEvent()
            outputChatBox("* Posiadasz zawieszon? Licencje do "..result["time"]..", za: "..result["reason"], plr25500)
        else
            exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?""L"getPlayerSerial(plr))
        end
    end





Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-14, 11:17


venzikk

LUA, MODELER






Wiek: 24
Na forum: 3823 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

Do kodu z prac? dodaj co? takiego :

     if getElementData(plr,"player:license:pjL") ~= 1 then
        outputChatBox("* Aby tu pracowa? musisz mie? licencj? na Drony!!"plr25500)
        return


Zamiast tego :
local qr exports['ogrpg-db']:dbGet("SELECT * FROM ogrpg_users WHERE id AND pjL=?"id"0")
if #qr == 1 then outputChatBox("Nie Posiadasz Licencji na Drony!", source, 255, 255, 255) return end


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
mixLoLmix2
Wysłany: 2017-02-14, 11:21


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Juz sobie poradzi?em ale i tak dam ci piwo

[ Dodano: 2017-02-14, 12:39 ]
Jeszcze cos
Jak zdam prawko na Drona To jak wjade w ostatni Punkt To nic sie nie dzeje

local marker2=createMarker(-2050.29,-106.16,35.24,"corona",2,170,200,0)

addEventHandler("onMarkerHit"marker2, function(el,md)
 setElementPosition(el,-2044.69,-94.57,35.17 )
endaddEvent("license:do",true)
addEventHandler("license:do"resourceRoot, function(cost,selected)
    if tonumber(cost) <= getPlayerMoney(clientthen
        takePlayerMoney(client,cost)
    end

    local veh=nil
    if selected == "A" then veh=createVehicle(586160.04, -168.151.24359.5360.087.3)
    elseif selected == "B" then veh=createVehicle(436,160.04, -168.151.24359.5360.087.3 )
    elseif selected == "C" then veh=createVehicle(482160.04, -168.151.24359.5360.087.3) 
    elseif selected == "Dron" then veh=createVehicle(511428.862495.5917.103.1359.880.3end
    if not veh then return end
    if selected == "Dron" then
    setElementData(veh,"vehicle:desc","Egzamin Licencji Lotniczej\nKategoria "..selected)
    else
    setElementData(veh,"vehicle:desc","Egzamin prawa jazdy\nKategoria "..selected)
    end
    setElementData(veh,"vehicle:mileage",16442)
    setElementData(veh,"vehicle:fuel",100)
    setElementData(veh,"vehicle:lic",true)

    setElementDimension(client,0)
    setElementInterior(client,0)
    warpPedIntoVehicle(client,veh)
    triggerClientEvent(client"license:start"resourceRootselectedveh)

    outputChatBox(""root25500)
end)

addEvent("license:vehdel"true)
addEventHandler("license:vehdel"resourceRoot, function(veh)
    destroyElement(veh)
end)

addEventHandler("onPlayerQuit"root, function()
    local veh=getPedOccupiedVehicle(source)
    if not veh then return end
    if getVehicleController(veh) ~= source then return end
    if not getElementData(veh,"vehicle:lic"then return end
    destroyElement(veh)
end)

addEventHandler("onVehicleDamage"resourceRoot, function(loss)
    local kierowca=getVehicleController(source)
    if not kierowca then return end
    if not getElementData(source,"vehicle:lic"then return end
    destroyElement(source)
    outputChatBox("* Uszkodzi?e?(a?) pojazd, nie zdajesz egzaminu! :c"kierowca25500)
    triggerClientEvent(kierowca"license:finish"resourceRoottrue)
end)

addEventHandler("onVehicleStartExit"resourceRoot, function()
    cancelEvent()
end)



[ Dodano: 2017-02-14, 12:40 ]


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"resourceRootfinishLicense)

function showMarker()
    local pos=categoryPositions[licenseCategory][licenseTarget]
    if licenseCategory ~= "Dron" then
    licenseMarker=createMarker(pos[1], pos[2], pos[3], "checkpoint"100255155)
    else
    licenseMarker=createMarker(pos[1], pos[2], pos[3], "ring"300255155)
    end
    licenseBlip=createBlip(pos[1], pos[2], pos[3], 0125500)
    if categoryPositions[licenseCategory][licenseTarget+1then
          e=categoryPositions[licenseCategory][licenseTarget+1]
        setMarkerTarget(licenseMarkere[1], e[2], e[3])
    end
    addEventHandler("onClientMarkerHit"licenseMarker, function(el,md)
        if not md or el~=localPlayer then return end
        if not getPedOccupiedVehicle(elthen return end
        if licenseTarget #categoryPositions[licenseCategory] then
            local sound=playSound(":ogrpg-misc/misc/point.wav")
            --setSoundVolume(sound1.0)
            
            finishLicense(false)
            licenseTarget=licenseTarget+1
            showMarker()
        else
            local sound=playSound(":ogrpg-misc/misc/success.flac")
            --setSoundVolume(sound1.0)

            outputChatBox("* Zda?e?(a?) egzamin. Gratulacje!")
            triggerServerEvent("license:vehdel"resourceRootlicenseVehicle)
            setElementData(localPlayer,"player:license:pj"..licenseCategory1)
            finishLicense(true)
        end
    end)
end


Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-14, 13:49


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

mixLoLmix2, Panie Programisto Lua proponowa?bym usun?? ten podpisik bo tylko si? pogr??asz lol - Co do problemu, masz tabele 'categoryPositions' ? Ponadto ten warunek
    if licenseTarget #categoryPositions[licenseCategory] then
jest dziwny. Je?li licenseTarget jest mniejsze ni? tabela wtedy cos tam... Ojj ci Programi?ci tacy zapominalscy a przecie? dla nich takie rzeczy to b?achostki powinny by?...

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Tagi: prawo :: jazdy
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