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: 3877 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

--[[
    AuthorAteX<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(pojazdtrue)
        else
            setVehicleEngineState(pojazdfalse)
        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(pojazd2)
        else
            setVehicleOverrideLights(pojazd1)
        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(pojazdfalse)
        else
            setVehicleLocked(pojazdtrue)
        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(pojazdthen
                setElementFrozen(pojazdfalse)
            else
                setElementFrozen(pojazdtrue)
            end
        end
    end
end)

addEventHandler("onVehicleEnter"root, function(thePlayerseattheVehicle)
    if seat == 0 then
        setVehicleEngineState(sourcefalse)
    end
end)

addEventHandler("onVehicleExit"root, function(thePlayerseattheVehicle)
    if seat == 0 then
        setVehicleEngineState(sourcefalse)
        setVehicleLocked(sourcefalse)
    end
end)

--[[
    AuthorAteX<atexprogramming@gmail.com>
]]--


a to jest c.lua


--[[
    AuthorAteX<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(pojazdtrue)
        else
            setVehicleEngineState(pojazdfalse)
        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(pojazd2)
        else
            setVehicleOverrideLights(pojazd1)
        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(pojazdfalse)
        else
            setVehicleLocked(pojazdtrue)
        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(pojazdthen
                setElementFrozen(pojazdfalse)
            else
                setElementFrozen(pojazdtrue)
            end
        end
    end
end)

addEventHandler("onVehicleEnter"root, function(thePlayerseattheVehicle)
    if seat == 0 then
        setVehicleEngineState(sourcefalse)
    end
end)

addEventHandler("onVehicleExit"root, function(thePlayerseattheVehicle)
    if seat == 0 then
        setVehicleEngineState(sourcefalse)
        setVehicleLocked(sourcefalse)
    end
end)

--[[
    AuthorAteX<atexprogramming@gmail.com>
]]--


Postaw piwo autorowi tego posta
 

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


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 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: 3877 dni
Posty: 104

Piwa: 9

Respekt: 55,8

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

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

sh,sw guiGetScreenSize()

interakcja={}
interakcja.klawisz "lshift"

interakcja.menu={}     
interakcja.menu[1] = guiCreateStaticImage(0.340.840.060.08"silnik.png"true)
interakcja.menu[2] = guiCreateStaticImage(0.390.760.060.08"swiatla.png"true)
interakcja.menu[3] = guiCreateStaticImage(0.550.760.060.08"drzwi.png"trueinterakcja.menu[4] = guiCreateStaticImage(0.610.840.060.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.390.840.220.16"glowne.png"true)
info2 guiCreateLabel(0.160.530.680.27""trueinfo)
guiSetAlpha(info21)
czcionka guiCreateFont("Czcionka.ttf"10/800*sh,sw)
guiSetFont(info2czcionka)
guiLabelSetColor(info2255,255,255)
guiLabelSetHorizontalAlign(info2"center"false)
guiLabelSetVerticalAlign(info2"center")
guiSetVisible(infofalse)
guiSetVisible(info2false)

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(infotrue)
                guiSetVisible(info2true)
                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(infofalse)
                guiSetVisible(info2false)
            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(pojazdthen
            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"localPlayerend)

--[[
    AuthorAteX<atexprogramming@gmail.com>
]]--


Postaw piwo autorowi tego posta
 

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


AteX







Wiek: 26
Na forum: 4016 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

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(thePlayerseattheVehicle)
    if rowery[getElementModel(source)] then return end
    if seat == 0 then
        setVehicleEngineState(sourcefalse)
    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: 3877 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: 26
Na forum: 4016 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

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: 3877 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 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