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

Wysłany: 2018-07-14, 09:21


adisonboss







Wiek: 23
Na forum: 3332 dni
Posty: 237

Piwa: 6

Respekt: 50

Witam mam problem ze skryptem na bramy poniewa? nie dzia?a. Za pomoc piwo i respekt

DEBUGSCRIPT 3
https://imgur.com/a/Mf6fkAC

SKRYPT

skiny = {[201]=true, [278]=true, [286]=true}
function bramystraz()
key1 createObject(2886,-124.90000152588,1034.3000488281,20.299999237061,0.0000000,0.0000000,180.0000000) --object(sec_keypad) (1)
key2 createObject(2886,-122.19999694824,1034.3000488281,20.299999237061,0.0000000,0.0000000,180.0000000) --object(sec_keypad) (2)
key3 createObject(2886,-151.80000305176,1038,20.39999961853,0.0000000,0.0000000,180.0000000) --object(sec_keypad) (3)
brama1 createObject(5422,-127.401033.9020.790090) --object(cxf_spraydoor1) (1)
brama2 createObject(5422,-119.69103420.790090) --object(cxf_spraydoor1) (2)
brama3 createObject(5422, -154.699996948241037.699951171920.899999618530090) --object(cxf_spraydoor1) (3)
setElementData(key1"cootwiera"brama1)
setElementData(key2"cootwiera"brama2)
setElementData(key3"cootwiera"brama3)

for k,o in ipairs(getElementsByType("object",resourceRoot)) do 
setElementData(o"zamkni?ty"true)
end
end
addEventHandler("onResourceStart"resourceRootbramystraz)

    function otworz(plr)
    if not skiny[getElementModel(plr)] then return end
    for k,o in ipairs(getElementsByType("object",resourceRoot)) do 
    local x,y,getElementPosition(plr)
    local x2,y2,z2 getElementPosition(o)
    local dist=getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)
    if getElementModel(o) == 2886 and dist <= 1 then
    local edata getElementData(o"cootwiera")
    local rx,ry,rz getElementRotation(edata)
    if rx == 0 then
        if rz == 90 and edata and getElementData(edata"zamkni?ty") == true and getElementData(edata"wruchu") == false then
            local ox,oy,oz getElementPosition(edata)
            moveObject(edata10000ox,oy,oz-4.10090)
            setElementData(edata"zamkni?ty"false)
            setElementData(edata"wruchu"true)
            setTimer(setElementData100001edata"wruchu"false)
        elseif rz == 90 and edata and getElementData(edata"zamkni?ty") == false and getElementData(edata"wruchu") == false then
            local ox,oy,oz getElementPosition(edata)
            moveObject(edata10000ox,oy,oz-4.10090)
            setElementData(edata"zamkni?ty"true)
            setElementData(edata"wruchu"true)
            setTimer(setElementData100001edata"wruchu"false)
        elseif rz == and edata and getElementData(edata"zamkni?ty") == true and getElementData(edata"wruchu") == false then
            local ox,oy,oz getElementPosition(edata)
            moveObject(edata10000ox,oy,oz-4.10090)
            setElementData(edata"zamkni?ty"false)
            setElementData(edata"wruchu"true)
            setTimer(setElementData100001edata"wruchu"false)
        elseif rz == and edata and getElementData(edata"zamkni?ty") == false and getElementData(edata"wruchu") == false then
            local ox,oy,oz getElementPosition(edata)
            moveObject(edata10000ox,oy,oz-4.10090)
            setElementData(edata"zamkni?ty"true)
            setElementData(edata"wruchu"true)
            setTimer(setElementData100001edata"wruchu"false)
        end
    elseif rx == 90 then
        if edata and getElementData(edata"zamkni?ty") == true and getElementData(edata"wruchu") == false then
            local ox,oy,oz getElementPosition(edata)
            moveObject(edata10000ox,oy,oz-4.1)
            setElementData(edata"zamkni?ty"false)
            setElementData(edata"wruchu"true)
            setTimer(setElementData100001edata"wruchu"false)
        elseif edata and getElementData(edata"zamkni?ty") == false and getElementData(edata"wruchu") == false then
            local ox,oy,oz getElementPosition(edata)
            moveObject(edata10000ox,oy,oz-4.1)
            setElementData(edata"zamkni?ty"true)
            setElementData(edata"wruchu"true)
            setTimer(setElementData100001edata"wruchu"false)
        end
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-14, 10:24


_jvneczek







Wiek: 22
Na forum: 4326 dni
Posty: 1513
Nick w MP: _jvneczek

Piwa: 3949

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

adisonboss, B??d jest z linijk?
21:
    for k,o in ipairs(getElementsByType("object",resourceRoot)) do 

25:
    if getElementModel(o) == 2886 and dist <= 1 then


Podpis

Support Team: 04.10.2020 - 01.09.2020
Test Moderator: 03.05.2021 - 01.09.2021
Moderator: 01.09.2021 - 23.10.2021

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-15, 21:32


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Sprawd? to:
skiny = {[201]=true, [278]=true, [286]=true}
function bramystraz()
key1 createObject(2886,-124.90000152588,1034.3000488281,20.299999237061,0.0000000,0.0000000,180.0000000) --object(sec_keypad) (1)
key2 createObject(2886,-122.19999694824,1034.3000488281,20.299999237061,0.0000000,0.0000000,180.0000000) --object(sec_keypad) (2)
key3 createObject(2886,-151.80000305176,1038,20.39999961853,0.0000000,0.0000000,180.0000000) --object(sec_keypad) (3)
brama1 createObject(5422,-127.401033.9020.790090) --object(cxf_spraydoor1) (1)
brama2 createObject(5422,-119.69103420.790090) --object(cxf_spraydoor1) (2)
brama3 createObject(5422, -154.699996948241037.699951171920.899999618530090) --object(cxf_spraydoor1) (3)
setElementData(key1"cootwiera"brama1)
setElementData(key2"cootwiera"brama2)
setElementData(key3"cootwiera"brama3)

for k,o in ipairs(getElementsByType("object",resourceRoot)) do 
setElementData(o"zamkni?ty"true)
end
end
addEventHandler("onResourceStart"resourceRootbramystraz)

    function otworz(plr)
    if not skiny[getElementModel(plr)] then return end
    for k,o in ipairs(getElementsByType("object",resourceRoot)) do 
    local x,y,getElementPosition(plr)
    local x2,y2,z2 getElementPosition(o)
    local dist=getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)
    if getElementModel(o) == 2886 and dist <= 1 then
    local edata getElementData(o"cootwiera")
    local rx,ry,rz getElementRotation(edata)
    if rx == 0 then
        if rz == 90 and edata and getElementData(edata"zamkni?ty") == true and getElementData(edata"wruchu") == false then
            local ox,oy,oz getElementPosition(edata)
            moveObject(edata10000ox,oy,oz-4.10090)
            setElementData(edata"zamkni?ty"false)
            setElementData(edata"wruchu"true)
            setTimer(setElementData100001edata"wruchu"false)
        elseif rz == 90 and edata and getElementData(edata"zamkni?ty") == false and getElementData(edata"wruchu") == false then
            local ox,oy,oz getElementPosition(edata)
            moveObject(edata10000ox,oy,oz-4.10090)
            setElementData(edata"zamkni?ty"true)
            setElementData(edata"wruchu"true)
            setTimer(setElementData100001edata"wruchu"false)
        elseif rz == and edata and getElementData(edata"zamkni?ty") == true and getElementData(edata"wruchu") == false then
            local ox,oy,oz getElementPosition(edata)
            moveObject(edata10000ox,oy,oz-4.10090)
            setElementData(edata"zamkni?ty"false)
            setElementData(edata"wruchu"true)
            setTimer(setElementData100001edata"wruchu"false)
        elseif rz == and edata and getElementData(edata"zamkni?ty") == false and getElementData(edata"wruchu") == false then
            local ox,oy,oz getElementPosition(edata)
            moveObject(edata10000ox,oy,oz-4.10090)
            setElementData(edata"zamkni?ty"true)
            setElementData(edata"wruchu"true)
            setTimer(setElementData100001edata"wruchu"false)
        end
    elseif rx == 90 then
        if edata and getElementData(edata"zamkni?ty") == true and getElementData(edata"wruchu") == false then
            local ox,oy,oz getElementPosition(edata)
            moveObject(edata10000ox,oy,oz-4.1)
            setElementData(edata"zamkni?ty"false)
            setElementData(edata"wruchu"true)
            setTimer(setElementData100001edata"wruchu"false)
        elseif edata and getElementData(edata"zamkni?ty") == false and getElementData(edata"wruchu") == false then
            local ox,oy,oz getElementPosition(edata)
            moveObject(edata10000ox,oy,oz-4.1)
            setElementData(edata"zamkni?ty"true)
            setElementData(edata"wruchu"true)
            setTimer(setElementData100001edata"wruchu"false)
        end
    end
end
end
end

i ustaw kodowanie skryptu/pliku na UFT-8 za pomoc? Notepad++ lub zwyk?ym notatnikiem z Windows.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-17, 09:55


adisonboss







Wiek: 23
Na forum: 3332 dni
Posty: 237

Piwa: 6

Respekt: 50

U?wiadomi?em sobie jedn? rzecz. ?e nie napisa?em jak mam otworzy? t? bram?

[ Dodano: 2018-07-17, 10:17 ]
Kurde pr?buje to dopisa? ale w og?le nie idzie

[ Dodano: 2018-07-18, 11:24 ]
Bramy i niby pady to otwierania s? w DB3 nic nie ma ale nwm jak je otworzy?

Postaw piwo autorowi tego posta
 

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