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

Wysłany: 2018-10-12, 10:41


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Witam ot?? usuniecie mi linijki kt?re teleportuj? pojazd do przecho po zamontowaniu neon?w?
kod

defs_c.lua
function isEventHandlerAdded(sEventNamepElementAttachedTofunc)
    if type(sEventName) == 'string' and isElement(pElementAttachedTo) and type(func) == 'function' then
    local aAttachedFunctions getEventHandlers(sEventNamepElementAttachedTo)
    if type(aAttachedFunctions) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs(aAttachedFunctions) do if v == func then return true end end end 
    end return false
end

function secondsToClock(seconds)
    seconds seconds or 0
    if seconds <= 0 then
        return "00:00:00"
    else
        hours string.format("%02.f"math.floor(seconds/3600))
        mins string.format("%02.f"math.floor(seconds/60 - (hours*60)))
        secs string.format("%02.f"math.floor(seconds hours*3600 mins *60))
        return ""..hours.." godzin "..mins
    end
end


s.lua

elements = {}
elements["positions"] = {
    ["EZ 3"]={
        marker = {-2138.74, -110.3334.88},
        cuboid = {-2138.74, -110.3334.884},
        text "Monta? wzmocnie?"
    },
}

local napis=createElement("text")
setElementData(napis"name""Montarz PaintJob'a\nCena 5kk")
setElementPosition(napis, -2138.74, -110.3334.88)

for i,v in pairs(elements["positions"]) do
    v.cuboid ColShape.Sphere(unpack(v.cuboid))
    v.marker Marker(v.marker[1], v.marker[2], v.marker[3]-0.90"cylinder"225501500)
        setElementData(v.marker"markery3"true)
end

addEvent("pj0"true)
addEventHandler("pj0"getRootElement(), function()
    local hajs getPlayerMoney(source)
    local ccar getPedOccupiedVehicle(source)
    local cena 7000000
    
    if getElementData(ccar"vehicle:ownedPlayer") == getElementData(client"player:uid"then
    if hajs cena then triggerClientEvent(client"onClientAddNotification"client"Nie sta? Ci? aby zakupi? tej PaintJob!""error") return end
    local id getElementData(ccar"vehicle:id")
    if not id then triggerClientEvent(client"onClientAddNotification"client"To nie jest pojazd prywatny!""error") return end
    local pj getVehiclePaintjob(ccar)
    if pj == 0 then triggerClientEvent(client"onClientAddNotification"client"Posidasz ju? ten paintjob!""error") return end
    setVehiclePaintjob(ccar0)
    takePlayerMoney(sourcecena)
    exports["ogrpg-db"]:dbSet("update ez_logi set ile=ile+1 where usluga=? limit 1""pj0")
    else
        triggerClientEvent(client"onClientAddNotification"client"To nie jest Tw?j pojazd!""warning")
    end
end)

addEvent("pj1"true)
addEventHandler("pj1"getRootElement(), function()
    local hajs getPlayerMoney(source)
    local ccar getPedOccupiedVehicle(source)
    local cena 7000000
    
    if getElementData(ccar"vehicle:ownedPlayer") == getElementData(client"player:uid"then
    if hajs cena then triggerClientEvent(client"onClientAddNotification"client"Nie sta? Ci? aby zakupi? tej PaintJob!""error") return end
    local id getElementData(ccar"vehicle:id")
    if not id then triggerClientEvent(client"onClientAddNotification"client"To nie jest pojazd prywatny!""error") return end
    local pj getVehiclePaintjob(ccar)
    if pj == 1 then triggerClientEvent(client"onClientAddNotification"client"Posidasz ju? ten paintjob!""error") return end
    setVehiclePaintjob(ccar1)
    takePlayerMoney(sourcecena)
    exports["ogrpg-db"]:dbSet("update ez_logi set ile=ile+1 where usluga=? limit 1""pj1")
    else
        triggerClientEvent(client"onClientAddNotification"client"To nie jest Tw?j pojazd!""warning")
    end
end)

addEvent("pj2"true)
addEventHandler("pj2"getRootElement(), function()
    local hajs getPlayerMoney(source)
    local ccar getPedOccupiedVehicle(source)
    local cena 7000000
    
    if getElementData(ccar"vehicle:ownedPlayer") == getElementData(client"player:uid"then
    if hajs cena then triggerClientEvent(client"onClientAddNotification"client"Nie sta? Ci? aby zakupi? tej PaintJob!""error") return end
    local id getElementData(ccar"vehicle:id")
    if not id then triggerClientEvent(client"onClientAddNotification"client"To nie jest pojazd prywatny!""error") return end
    local pj getVehiclePaintjob(ccar)
    if pj == 2 then triggerClientEvent(client"onClientAddNotification"client"Posidasz ju? ten paintjob!""error") return end
    setVehiclePaintjob(ccar2)
    takePlayerMoney(sourcecena)
    exports["ogrpg-db"]:dbSet("update ez_logi set ile=ile+1 where usluga=? limit 1""pj2")
    else
        triggerClientEvent(client"onClientAddNotification"client"To nie jest Tw?j pojazd!""warning")
    end
end)

addEvent("pj3"true)
addEventHandler("pj3"getRootElement(), function()
    local hajs getPlayerMoney(source)
    local ccar getPedOccupiedVehicle(source)
    local cena 0
    
    if getElementData(ccar"vehicle:ownedPlayer") == getElementData(client"player:uid"then
    if hajs cena then triggerClientEvent(client"onClientAddNotification"client"Nie sta? Ci? aby zakupi? tej PaintJob!""error") return end
    local id getElementData(ccar"vehicle:id")
    if not id then triggerClientEvent(client"onClientAddNotification"client"To nie jest pojazd prywatny!""error") return end
    local pj getVehiclePaintjob(ccar)
    if pj == 3 then triggerClientEvent(client"onClientAddNotification"client"Posidasz ju? ten paintjob!""error") return end
    setVehiclePaintjob(ccar3)
    takePlayerMoney(sourcecena)
    exports["ogrpg-db"]:dbSet("update ez_logi set ile=ile+1 where usluga=? limit 1""pj3")
    else
        triggerClientEvent(client"onClientAddNotification"client"To nie jest Tw?j pojazd!""warning")
    end
end)

addEvent("pjx"true)
addEventHandler("pjx"getRootElement(), function()
    local hajs getPlayerMoney(source)
    local ccar getPedOccupiedVehicle(source)
    local cena 0
    
    if getElementData(ccar"vehicle:ownedPlayer") == getElementData(client"player:uid"then
    if hajs cena then triggerClientEvent(client"onClientAddNotification"client"Nie sta? Ci? aby zakupi? tej PaintJob!""error") return end
    local id getElementData(ccar"vehicle:id")
    if not id then triggerClientEvent(client"onClientAddNotification"client"To nie jest pojazd prywatny!""error") return end
    setVehiclePaintjob(ccar3)
    takePlayerMoney(sourcecena)
    exports["ogrpg-db"]:dbSet("update ez_logi set ile=ile+1 where usluga=? limit 1""pjx")
    else
        triggerClientEvent(client"onClientAddNotification"client"To nie jest Tw?j pojazd!""warning")
    end
end)


main_c.lua

local screenSize Vector2(guiGetScreenSize())
local ticks = {alphaTick getTickCount(), animTick getTickCount(), upperTick getTickCount(), gui = {getTickCount(), getTickCount(), getTickCount()}}
local data = {showed falseupper falseupperLock falsegridlist falseedits = {}, actual falselink}
local serials = {}

local function isMouseInPosition(xywidthheight)
    if not isCursorShowing() then return false end
    
    local cursor = {getCursorPosition()}
    local cxcy = (cursor[1]*screenSize.x), (cursor[2]*screenSize.y)
    if (cx >= and cx <= width) and (cy >= and cy <= heightthen return true else return false end
end

local function scaleElement(sxsy)
    return (screenSize.sx)/2, (screenSize.sy)/2
end

local icon_xicon_y scaleElement(128128)
local function drawGUI()
    local up interpolateBetween(10000000, (getTickCount()-ticks.animTick)/2000"OutBack") 

    if anim == "fadein" then
        progress = (getTickCount()-ticks.alphaTick)/1000
        alpha interpolateBetween(alpha0025500progress"Linear")
        if alpha == 255 then
            ticks.alphaTick getTickCount()
            anim nil
        end
    elseif anim == "fadeout" then
        progress = (getTickCount()-ticks.alphaTick)/500
        alpha interpolateBetween(alpha00000progress"Linear")
        if alpha == 0 then
            removeEventHandler("onClientRender"rootdrawGUI)
            ticks.alphaTick nil
            anim nil
        end
    end
    
    if isMouseInPosition(icon_x-300icon_y128128then color_one_down = {150150150} else color_one_down = {255255255end
    if isMouseInPosition(icon_x-150icon_y128128then color_two_down = {150150150} else color_two_down = {255255255end
    if isMouseInPosition(icon_xicon_y128128then color_three_down = {150150150} else color_three_down = {255255255end
    if isMouseInPosition(icon_x+150icon_y128128then color_four_down = {150150150} else color_four_down = {255255255end
    if isMouseInPosition(icon_x+300icon_y128128then color_five_down = {150150150} else color_five_down = {255255255end
    
    if not data.upper then
        dxDrawImage(icon_x-300icon_y+up128128"images/pj0.png"000tocolor(color_one_down[1], color_one_down[2], color_one_down[3], alpha), false)
        dxDrawImage(icon_x-150icon_y+up128128"images/pj1.png"000tocolor(color_two_down[1], color_two_down[2], color_two_down[3], alpha), false)
        dxDrawImage(icon_xicon_y+up128128"images/pj2.png"000tocolor(color_three_down[1], color_three_down[2], color_three_down[3], alpha), false)
        dxDrawImage(icon_x+150icon_y+up128128"images/pj3.png"000tocolor(color_four_down[1], color_four_down[2], color_four_down[3], alpha), false)
        dxDrawImage(icon_x+300icon_y+up128128"images/pjx.png"000tocolor(color_five_down[1], color_five_down[2], color_five_down[3], alpha), false)
    else
    if not data.upperLock then
        progress = (getTickCount()-ticks.upperTick)/1500
        change interpolateBetween(30000000progress"Linear")
        dxDrawImage(icon_x-300icon_y-300+change128128"images/pj0png"000tocolor(color_one_down[1], color_one_down[2], color_one_down[3], alpha), false)
        dxDrawImage(icon_x-150icon_y-300+change128128"images/pj1.png"000tocolor(color_two_down[1], color_two_down[2], color_two_down[3], alpha), false)
        dxDrawImage(icon_xicon_y-300+change128128"images/pj2.png"000tocolor(color_three_down[1], color_three_down[2], color_three_down[3], alpha), false)
        dxDrawImage(icon_x+150icon_y-300+change128128"images/pj3.png"000tocolor(color_four_down[1], color_four_down[2], color_four_down[3], alpha), false)
        dxDrawImage(icon_x+300icon_y-300+change128128"images/pjx.png"000tocolor(color_five_down[1], color_five_down[2], color_five_down[3], alpha), false)
    else
        dxDrawImage(icon_x-300icon_y-300128128"images/pj0.png"000tocolor(color_one_down[1], color_one_down[2], color_one_down[3], alpha), false)
        dxDrawImage(icon_x-150icon_y-300128128"images/pj1.png"000tocolor(color_two_down[1], color_two_down[2], color_two_down[3], alpha), false)
        dxDrawImage(icon_xicon_y-300128128"images/pj2.png"000tocolor(color_three_down[1], color_three_down[2], color_three_down[3], alpha), false)
        dxDrawImage(icon_x+150icon_y-300128128"images/pj3.png"000tocolor(color_four_down[1], color_four_down[2], color_four_down[3], alpha), false)
        dxDrawImage(icon_x+300icon_y-300128128"images/pjx.png"000tocolor(color_five_down[1], color_five_down[2], color_five_down[3], alpha), false)
    end
    end
end

local function closeGUI()
    alpha 255
    showChat(true)
    anim "fadeout"
    showCursor(false)
    ticks.animTick getTickCount()
    ticks.alphaTick getTickCount()
    setPlayerHudComponentVisible("radar"true)
    localPlayer:setData("player:blackwhite"false)
    localPlayer:setData("player:hud_visible"false)
end

addEventHandler("onClientMarkerHit"resourceRoot, function(playerdimension)
    if player == localPlayer and dimension then
        if player.vehicle then
            if player.vehicle.controller == player then
                if player.vehicle.health 800 then
                    showCursor(truefalse)
                    --showChat(false)
                    alpha 0
                    anim "fadein"
                    --showChat(false)
                    showCursor(truefalse)
                    ticks.animTick getTickCount()
                    ticks.alphaTick getTickCount()
                    player:setData("player:blackwhite"true)
                    player:setData("player:hud_visible"true)
                    setPlayerHudComponentVisible("radar"false)
                    addEventHandler("onClientRender"rootdrawGUI)
                else
                    triggerEvent("onClientAddNotification"player"Tw?j pojazd nie jest jest wystarczaj?co sprawny!""error")
                end
            end
        end
    end
end)

addEventHandler("onClientMarkerLeave"resourceRoot, function(playerdimension)
    if player == localPlayer and dimension then
        showCursor(false)
        --showChat(true)
        player:setData("player:blackwhite"false)
        player:setData("player:hud_visible"false)
        setPlayerHudComponentVisible("radar"true)
        if isEventHandlerAdded("onClientRender"rootdrawGUIthen removeEventHandler("onClientRender"rootdrawGUIend
    end
end)

local player getLocalPlayer()

addEventHandler("onClientClick"root, function(buttonstate)
    if button == "left" and state == "down" then
        if isEventHandlerAdded("onClientRender"rootdrawGUIthen
            if isMouseInPosition(icon_x-300icon_y128128then
                    closeGUI()
                    triggerServerEvent ("pj0"playerplayer)
                elseif isMouseInPosition(icon_x-150icon_y128128then
                    closeGUI()
                    triggerServerEvent ("pj1"playerplayer)
                elseif isMouseInPosition(icon_xicon_y128128then
                    closeGUI()
                    triggerServerEvent ("pj2"playerplayer)
                elseif isMouseInPosition(icon_x+150icon_y128128then
                    closeGUI()
                    triggerServerEvent ("pj3"playerplayer)
                elseif isMouseInPosition(icon_x+300icon_y128128then
                    closeGUI()
                    triggerServerEvent ("pjx"playerplayer)
                end
            end
        end
end)


Za dobr? odpowied? stawiam zimne :piwo: :piwo: :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-13, 13:53


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Kod, kt?ry wys?a?e? dotyczy montowania pointjob?w.

Postaw piwo autorowi tego posta
 

 
Tagi: usuwanie :: możliwośći :: przecho
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Usuwanie możliwośći tp do przecho 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