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

Wysłany: 2015-12-25, 21:07


Marcinos651







Wiek: 28
Na forum: 4480 dni
Posty: 18
Nick w MP: Marcin651



Respekt: 50

Zrobi ktos tak zeby nie pisalo zamykanie pojazdu w budowie tylko zeby zamykalo i otwieralo ten pojazd

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

addEvent("onChooseInteractionV1"true)
addEventHandler("onChooseInteractionV1"root, function()
    local vehicle getPedOccupiedVehicle(source)
    if vehicle then
        if getPedOccupiedVehicleSeat (source) == 0 then
        if isBike[getElementModel(vehicle)] then return end
        local engine getVehicleEngineState(vehicle)
        if engine == false then
            setVehicleEngineState(vehicletrue)
            outputChatBox("* Uruchomi?e? silnik."source)
        else
            if getElementData(vehicle"pojazd_paliwo") <= 0 then
                outputChatBox("* Nie mo?na odpali? silnika, brak paliwa."source)
                return
            end
            if getElementData(vehicle"pojazd_przebieg") == 10000 then
                outputChatBox("* Nie mo?na odpali? silnika, zbyt du?y przebieg."source)
                return
            end
            setVehicleEngineState(vehiclefalse)
            outputChatBox("* Zgasi?e? silnik."source)
        end
    end
end
end)

addEvent("onChooseInteractionV2"true)
addEventHandler("onChooseInteractionV2"root, function()
    local vehicle getPedOccupiedVehicle(source)
    if vehicle then
        if getPedOccupiedVehicleSeat (source) == 0 then
        if isBike[getElementModel(vehicle)] then return end
        if getVehicleOverrideLights(vehicle) ~= 2 then
            setVehicleOverrideLights(vehicle2)
            outputChatBox("* Zapali?e? ?wiat?a"source)
        else
            setVehicleOverrideLights(vehicle1)
            outputChatBox("* Zgasi?e? ?wiat?a."source)
        end
    end
end
end)

addEvent("onChooseInteractionV3"true)
addEventHandler("onChooseInteractionV3"root, function()
    local vehicle getPedOccupiedVehicle(source)
    if vehicle then
        if getPedOccupiedVehicleSeat (source) == 0 then
        if isBike[getElementModel(vehicle)] then return end
        outputChatBox("* Zamykanie pojazdu w budowie"source)
    end
end
end)

addEvent("onChooseInteractionV4"true)
addEventHandler("onChooseInteractionV4"root, function()
    local vehicle getPedOccupiedVehicle(source)
    if vehicle then
        if getPedOccupiedVehicleSeat (source) == 0 then

        --if not getElementData(vehicle"pojazd_zrespiony"then return end
        if isBike[getElementModel(vehicle)] then return end
        local sx,sy,sz getElementVelocity(vehicle)
        local aspeed = (sx^sy^sz^2)^(0.5)
        local kmh aspeed 180
        if kmh 2 then
            if isElementFrozen(vehiclethen
                setElementFrozen(vehiclefalse)
                outputChatBox("* Spu?ci?e? r?czny."source)
            else
                setElementFrozen(vehicletrue)
                outputChatBox("* Zaci?gn??e? r?czny."source)
            end
        end
end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-25, 23:04


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

Prosze funkcja do zamykania

Więcej informacji znajdziesz w Wikipedii MTA:

SetVehicleLocked


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-25, 23:04


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

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


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

addEvent("onChooseInteractionV1"true)
addEventHandler("onChooseInteractionV1"root, function()
    local vehicle getPedOccupiedVehicle(source)
    if vehicle then
        if getPedOccupiedVehicleSeat (source) == 0 then
        if isBike[getElementModel(vehicle)] then return end
        local engine getVehicleEngineState(vehicle)
        if engine == false then
            setVehicleEngineState(vehicletrue)
            outputChatBox("* Uruchomi?e? silnik."source)
        else
            if getElementData(vehicle"pojazd_paliwo") <= 0 then
                outputChatBox("* Nie mo?na odpali? silnika, brak paliwa."source)
                return
            end
            if getElementData(vehicle"pojazd_przebieg") == 10000 then
                outputChatBox("* Nie mo?na odpali? silnika, zbyt du?y przebieg."source)
                return
            end
            setVehicleEngineState(vehiclefalse)
            outputChatBox("* Zgasi?e? silnik."source)
        end
    end
end
end)

addEvent("onChooseInteractionV2"true)
addEventHandler("onChooseInteractionV2"root, function()
    local vehicle getPedOccupiedVehicle(source)
    if vehicle then
        if getPedOccupiedVehicleSeat (source) == 0 then
        if isBike[getElementModel(vehicle)] then return end
        if getVehicleOverrideLights(vehicle) ~= 2 then
            setVehicleOverrideLights(vehicle2)
            outputChatBox("* Zapali?e? ?wiat?a"source)
        else
            setVehicleOverrideLights(vehicle1)
            outputChatBox("* Zgasi?e? ?wiat?a."source)
        end
    end
end
end)

addEvent("onChooseInteractionV3"true)
addEventHandler("onChooseInteractionV3"root, function()
    local vehicle getPedOccupiedVehicle(source)
    if vehicle then
        if getPedOccupiedVehicleSeat (source) == 0 then
        if isBike[getElementModel(vehicle)] then return end
        local status isVehicleLocked(vehicle)
        setVehicleLocked(vehiclenot status)
        if status then
            outputChatBox("* Odblokowa?e? pojazd"source)
        else
            outputChatBox("* Zamkn??e? pojazd"source)
        end

    end
end
end)

addEvent("onChooseInteractionV4"true)
addEventHandler("onChooseInteractionV4"root, function()
    local vehicle getPedOccupiedVehicle(source)
    if vehicle then
        if getPedOccupiedVehicleSeat (source) == 0 then

        --if not getElementData(vehicle"pojazd_zrespiony"then return end
        if isBike[getElementModel(vehicle)] then return end
        local sx,sy,sz getElementVelocity(vehicle)
        local aspeed = (sx^sy^sz^2)^(0.5)
        local kmh aspeed 180
        if kmh 2 then
            if isElementFrozen(vehiclethen
                setElementFrozen(vehiclefalse)
                outputChatBox("* Spu?ci?e? r?czny."source)
            else
                setElementFrozen(vehicletrue)
                outputChatBox("* Zaci?gn??e? r?czny."source)
            end
        end
end
    end
end)


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: 2015-12-26, 14:30


Marcinos651







Wiek: 28
Na forum: 4480 dni
Posty: 18
Nick w MP: Marcin651



Respekt: 50

Nie dzia?a :/
Pomoze ktos?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-26, 15:50


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

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)


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

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

 
Wysłany: 2015-12-26, 18:39


Marcinos651







Wiek: 28
Na forum: 4480 dni
Posty: 18
Nick w MP: Marcin651



Respekt: 50

Nie dzia?a :/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-05, 17:40


Emm

***** ***






Wiek: 32
Na forum: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .


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

addEvent("onChooseInteractionV1"true)
addEventHandler("onChooseInteractionV1"root, function()
    local vehicle getPedOccupiedVehicle(source)
    if vehicle then
        if getPedOccupiedVehicleSeat (source) == 0 then
        if isBike[getElementModel(vehicle)] then return end
        local engine getVehicleEngineState(vehicle)
        if engine == false then
            setVehicleEngineState(vehicletrue)
            outputChatBox("* Uruchomi?e? silnik."source)
        else
            if getElementData(vehicle"pojazd_paliwo") <= 0 then
                outputChatBox("* Nie mo?na odpali? silnika, brak paliwa."source)
                return
            end
            if getElementData(vehicle"pojazd_przebieg") == 10000 then
                outputChatBox("* Nie mo?na odpali? silnika, zbyt du?y przebieg."source)
                return
            end
            setVehicleEngineState(vehiclefalse)
            outputChatBox("* Zgasi?e? silnik."source)
        end
    end
end
end)

addEvent("onChooseInteractionV2"true)
addEventHandler("onChooseInteractionV2"root, function()
    local vehicle getPedOccupiedVehicle(source)
    if vehicle then
        if getPedOccupiedVehicleSeat (source) == 0 then
        if isBike[getElementModel(vehicle)] then return end
        if getVehicleOverrideLights(vehicle) ~= 2 then
            setVehicleOverrideLights(vehicle2)
            outputChatBox("* Zapali?e? ?wiat?a"source)
        else
            setVehicleOverrideLights(vehicle1)
            outputChatBox("* Zgasi?e? ?wiat?a."source)
        end
    end
end
end)

addEvent("onChooseInteractionV3"true)
addEventHandler("onChooseInteractionV3"root, function()
    local vehicle getPedOccupiedVehicle(source)
    if vehicle then
        if getPedOccupiedVehicleSeat (source) == 0 then
        if isBike[getElementModel(vehicle)] then return end
        setVehicleLocked(vehiclefalse)
            outputChatBox("* Odblokowa?e? pojazd"source)
        else
        setVehicleLocked(vehicletrue)
            outputChatBox("* Zamkn??e? pojazd"source)
        end

    end
end
end)

addEvent("onChooseInteractionV4"true)
addEventHandler("onChooseInteractionV4"root, function()
    local vehicle getPedOccupiedVehicle(source)
    if vehicle then
        if getPedOccupiedVehicleSeat (source) == 0 then

        --if not getElementData(vehicle"pojazd_zrespiony"then return end
        if isBike[getElementModel(vehicle)] then return end
        local sx,sy,sz getElementVelocity(vehicle)
        local aspeed = (sx^sy^sz^2)^(0.5)
        local kmh aspeed 180
        if kmh 2 then
            if isElementFrozen(vehiclethen
                setElementFrozen(vehiclefalse)
                outputChatBox("* Spu?ci?e? r?czny."source)
            else
                setElementFrozen(vehicletrue)
                outputChatBox("* Zaci?gn??e? r?czny."source)
            end
        end
end
    end
end)


Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Postaw piwo autorowi tego posta
 

 
Tagi: edycja
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