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

Wysłany: 2016-03-05, 17:09


szeroki

BlueRP.pl Zapraszam GTA5






Wiek: 36
Na forum: 4018 dni
Posty: 104

Piwa: 9

Respekt: 55,8

Ostrzeżeń: 40%
witam mam Problem z Panelem dziala i wogle ale Rowerem nie mo?na jezdzic
S.lua

--[[
    Author: AteX<atexprogramming@gmail.com>
]]--

addEvent("silnik", true)
addEventHandler("silnik", root, function()
    local pojazd = getPedOccupiedVehicle(source)
    if pojazd then
        local engine = getVehicleEngineState(pojazd)
        if engine == false then
            setVehicleEngineState(pojazd, true)
        else
            setVehicleEngineState(pojazd, false)
        end
    end
end)

addEvent("?&#8250;wiat?&#8218;a", true)
addEventHandler("?&#8250;wiat?&#8218;a", root, function()
    local pojazd = getPedOccupiedVehicle(source)
    if pojazd then
        if getVehicleOverrideLights(pojazd) ~= 2 then
            setVehicleOverrideLights(pojazd, 2)
        else
            setVehicleOverrideLights(pojazd, 1)
        end
    end
end)

addEvent("drzwi", true)
addEventHandler("drzwi", root, function()
    local pojazd = getPedOccupiedVehicle(source)
    if pojazd then
        local drzwi = isVehicleLocked(pojazd)
        if drzwi == true then
            setVehicleLocked(pojazd, false)
        else
            setVehicleLocked(pojazd, true)
        end
    end
end)

addEvent("r?&#8482;czny", true)
addEventHandler("r?&#8482;czny", root, function()
    local pojazd = getPedOccupiedVehicle(source)
    if pojazd then
        local sx,sy,sz = getElementVelocity(pojazd)
        local kmh = ((sx^2+sy^2+sz^2)^(0.5)) * 100
        if kmh < 10 then
            if isElementFrozen(pojazd) then
                setElementFrozen(pojazd, false)
            else
                setElementFrozen(pojazd, true)
            end
        end
    end
end)

addEventHandler("onVehicleEnter", root, function(thePlayer, seat, theVehicle)
    if seat == 0 then
        setVehicleEngineState(source, false)
    end
end)

addEventHandler("onVehicleExit", root, function(thePlayer, seat, theVehicle)
    if seat == 0 then
        setVehicleEngineState(source, false)
        setVehicleLocked(source, false)
    end
end)

--[[
    Author: AteX<atexprogramming@gmail.com>
]]--


a to jest c.lua


--[[
    Author: AteX<atexprogramming@gmail.com>
]]--

addEvent("silnik", true)
addEventHandler("silnik", root, function()
    local pojazd = getPedOccupiedVehicle(source)
    if pojazd then
        local engine = getVehicleEngineState(pojazd)
        if engine == false then
            setVehicleEngineState(pojazd, true)
        else
            setVehicleEngineState(pojazd, false)
        end
    end
end)

addEvent("?&#8250;wiat?&#8218;a", true)
addEventHandler("?&#8250;wiat?&#8218;a", root, function()
    local pojazd = getPedOccupiedVehicle(source)
    if pojazd then
        if getVehicleOverrideLights(pojazd) ~= 2 then
            setVehicleOverrideLights(pojazd, 2)
        else
            setVehicleOverrideLights(pojazd, 1)
        end
    end
end)

addEvent("drzwi", true)
addEventHandler("drzwi", root, function()
    local pojazd = getPedOccupiedVehicle(source)
    if pojazd then
        local drzwi = isVehicleLocked(pojazd)
        if drzwi == true then
            setVehicleLocked(pojazd, false)
        else
            setVehicleLocked(pojazd, true)
        end
    end
end)

addEvent("r?&#8482;czny", true)
addEventHandler("r?&#8482;czny", root, function()
    local pojazd = getPedOccupiedVehicle(source)
    if pojazd then
        local sx,sy,sz = getElementVelocity(pojazd)
        local kmh = ((sx^2+sy^2+sz^2)^(0.5)) * 100
        if kmh < 10 then
            if isElementFrozen(pojazd) then
                setElementFrozen(pojazd, false)
            else
                setElementFrozen(pojazd, true)
            end
        end
    end
end)

addEventHandler("onVehicleEnter", root, function(thePlayer, seat, theVehicle)
    if seat == 0 then
        setVehicleEngineState(source, false)
    end
end)

addEventHandler("onVehicleExit", root, function(thePlayer, seat, theVehicle)
    if seat == 0 then
        setVehicleEngineState(source, false)
        setVehicleLocked(source, false)
    end
end)

--[[
    Author: AteX<atexprogramming@gmail.com>
]]--


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-05, 18:25


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4980 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Da?e? dwa razy server side

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-05, 18:34


szeroki

BlueRP.pl Zapraszam GTA5






Wiek: 36
Na forum: 4018 dni
Posty: 104

Piwa: 9

Respekt: 55,8

Ostrzeżeń: 40%
oj sory juz daje
--[[
    Author: AteX<atexprogramming@gmail.com>
]]--

rowery = {[509]=true, [481]=true, [510]=true}

sh,sw = guiGetScreenSize()

interakcja={}
interakcja.klawisz = "lshift"

interakcja.menu={}     
interakcja.menu[1] = guiCreateStaticImage(0.34, 0.84, 0.06, 0.08, "silnik.png", true)
interakcja.menu[2] = guiCreateStaticImage(0.39, 0.76, 0.06, 0.08, "swiatla.png", true)
interakcja.menu[3] = guiCreateStaticImage(0.55, 0.76, 0.06, 0.08, "drzwi.png", true) 
interakcja.menu[4] = guiCreateStaticImage(0.61, 0.84, 0.06, 0.08, "reczny.png", true)
guiSetVisible(interakcja.menu[1], false)
guiSetVisible(interakcja.menu[2], false)
guiSetVisible(interakcja.menu[3], false)
guiSetVisible(interakcja.menu[4], false)

info = guiCreateStaticImage(0.39, 0.84, 0.22, 0.16, "glowne.png", true)
info2 = guiCreateLabel(0.16, 0.53, 0.68, 0.27, "", true, info)
guiSetAlpha(info2, 1)
czcionka = guiCreateFont("Czcionka.ttf", 10/800*sh,sw)
guiSetFont(info2, czcionka)
guiLabelSetColor(info2, 255,255,255)
guiLabelSetHorizontalAlign(info2, "center", false)
guiLabelSetVerticalAlign(info2, "center")
guiSetVisible(info, false)
guiSetVisible(info2, false)

function pokazinterakcje(value)
    local pojazd = getPedOccupiedVehicle(localPlayer)
    if pojazd and getVehicleController(pojazd) == localPlayer then
        if rowery[getElementModel(pojazd)] then return end
        if value == true then
            for i,v in ipairs(interakcja.menu) do
                showCursor(true,false)
                guiSetVisible(interakcja.menu[i], true)
                guiSetVisible(info, true)
                guiSetVisible(info2, true)
                guiSetText(info2, "Wybierz opcj?&#8482;")
            end
        elseif value == false then
            for i,v in ipairs(interakcja.menu) do
                showCursor(false)
                guiSetVisible(interakcja.menu[i], false)
                guiSetVisible(info, false)
                guiSetVisible(info2, false)
            end
        end
    end
end

bindKey(interakcja.klawisz, "both", function(key,state)
    if state == "down" then
        pokazinterakcje(true)
    elseif state == "up" then
        pokazinterakcje(false)
    end
end)

addEventHandler("onClientMouseEnter", interakcja.menu[1], function()
    local pojazd = getPedOccupiedVehicle(localPlayer)
    if pojazd then
        local engine = getVehicleEngineState(pojazd)
        if engine == false then
            guiSetText(info2, "Zapal silnik")
        else
            guiSetText(info2, "Zga?&#8250; silnik")
        end
    end
end)

addEventHandler("onClientMouseEnter", interakcja.menu[2], function()
    local pojazd = getPedOccupiedVehicle(localPlayer)
    if pojazd then
        if getVehicleOverrideLights(pojazd) ~= 2 then
            guiSetText(info2, "Zapal ?&#8250;wiat?&#8218;a")
        else
            guiSetText(info2, "Zga?&#8250; ?&#8250;wiat?&#8218;a")
        end
    end
end)

addEventHandler("onClientMouseEnter", interakcja.menu[3], function()
    local pojazd = getPedOccupiedVehicle(localPlayer)
    if pojazd then
        local drzwi = isVehicleLocked(pojazd)
        if drzwi == true then
            guiSetText(info2, "Otw??rz drzwi")
        else
            guiSetText(info2, "Zamknij drzwi")
        end
    end
end)

addEventHandler("onClientMouseEnter", interakcja.menu[4], function()
    local pojazd = getPedOccupiedVehicle(localPlayer)
    if pojazd then
        if isElementFrozen(pojazd) then
            guiSetText(info2, "Spu?&#8250;?&#8225; r?&#8482;czny")
        else
            guiSetText(info2, "Zaci?&#8230;gnij r?&#8482;czny")
        end
    end
end)

for i,v in ipairs(interakcja.menu) do
    addEventHandler("onClientMouseLeave", interakcja.menu[i], function()
        guiSetText(info2, "Wybierz opcj?&#8482;")
    end)
end

addEventHandler("onClientGUIClick", interakcja.menu[1], function() 
    triggerServerEvent("silnik", localPlayer)
end)

addEventHandler("onClientGUIClick", interakcja.menu[2], function() 
    triggerServerEvent("?&#8250;wiat?&#8218;a", localPlayer)
end)

addEventHandler("onClientGUIClick", interakcja.menu[3], function() 
    triggerServerEvent("drzwi", localPlayer)
end)

addEventHandler("onClientGUIClick", interakcja.menu[4], function() 
    triggerServerEvent("r?&#8482;czny", localPlayer) 
end)

--[[
    Author: AteX<atexprogramming@gmail.com>
]]--


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-05, 18:37


AteX







Wiek: 27
Na forum: 4157 dni
Posty: 925
Nick w MP: #AteX

Piwa: 8366

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

W s.lua zmie? event onVehicleEnter na ten:


rowery = {[509]=true, [481]=true, [510]=true}
addEventHandler("onVehicleEnter", root, function(thePlayer, seat, theVehicle)
    if rowery[getElementModel(source)] then return end
    if seat == 0 then
        setVehicleEngineState(source, false)
    end
end)


Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-05, 18:50


szeroki

BlueRP.pl Zapraszam GTA5






Wiek: 36
Na forum: 4018 dni
Posty: 104

Piwa: 9

Respekt: 55,8

Ostrzeżeń: 40%
OK ale w Jakiej Linijce bo sa dwa onVehicleEnter

Podpis
**⚡┃CyanRP┃⚡ **

**💻┃*Adres IP:*** *wyspa.cyanrp.pl*
**📱┃*Link do serwera discord:*** *https://discord.gg/MJKqHksanU
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-05, 18:53


AteX







Wiek: 27
Na forum: 4157 dni
Posty: 925
Nick w MP: #AteX

Piwa: 8366

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Nie ma dw?ch. Jeden onVehicleEnter, a drugi onVehicleExit.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-05, 18:54


szeroki

BlueRP.pl Zapraszam GTA5






Wiek: 36
Na forum: 4018 dni
Posty: 104

Piwa: 9

Respekt: 55,8

Ostrzeżeń: 40%
a sory ok dzia?a Leci zimny Browar Nawet Skszynka

Podpis
**⚡┃CyanRP┃⚡ **

**💻┃*Adres IP:*** *wyspa.cyanrp.pl*
**📱┃*Link do serwera discord:*** *https://discord.gg/MJKqHksanU
Postaw piwo autorowi tego posta
 

 
Tagi: pronlem
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » pronlem 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