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

Wysłany: 2018-07-21, 00:27


BoomEq







Wiek: 35
Na forum: 3663 dni
Posty: 101
Nick w MP: BoomEqqq

Piwa: 20

Respekt: 70

Siemka, posiadam skrypt kt?ry po wejsciu w marker za pojazdem powinien dawa? pr?downice, pokazuje mi w DB3 taki b??d :
Kod:

s.lua:20:')' excepted (to close '(' at line 8) near 'end'


Ostatnio zmieniony przez BoomEq 2018-07-22, 15:57, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-22, 01:59


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8

Skoro b??d jest po stronie serwera to po co dajesz clienta?

Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-22, 06:10


PatryKK.

Emeryt LUA






Wiek: 27
Na forum: 3202 dni
Posty: 1059
Nick w MP: PatryKK.

Piwa: 2331

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-22, 15:56


BoomEq







Wiek: 35
Na forum: 3663 dni
Posty: 101
Nick w MP: BoomEqqq

Piwa: 20

Respekt: 70

Sorry, pomyli?o mi si?, oto S:
 for i,v in ipairs(getElementsByType("vehicle")) do
    if getElementModel(v) == 407 then
        marker = createMarker(0, 0, 0, "cylinder", 1.1, 255, 0, 0, 20)
        attachElements(marker, v, 0, -4.5, -1)
    end
end

addEventHandler("onMarkerHit", marker, function(hit)
    local frakcja = getElementData(hit, "player:duty")
    if frakcja and frakcja == "LVFD" then
            giveWeapon(hit, 42, 9999)
            setPedWeaponSlot(hit, 9)
        else
            takeWeapon(hit, 42)
        end
        setElementData(hit, "linia:LVFD", not getElementData(hit, "linia:LVFD"))
        triggerClientEvent(root, "linia:LVFD", root, hit, source)
        setElementData(hit, "wazm", source)
    end
end)

addEventHandler("onPlayerWeaponSwitch", root, function(last)
    if last == 42 and getElementData(source, "linia:LVFD") then
        setPedWeaponSlot(source, 9)
    end
end) 


[ Dodano: 2018-07-22, 15:58 ]
Linijka 8 :
addEventHandler("onMarkerHit", marker, function(hit)


xD -> Linijka 20:
 end) 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-22, 16:13


jagoreq







Wiek: 24
Na forum: 3362 dni
Posty: 221
Nick w MP: dwd

Piwa: 18

Respekt: 66,3

Ostrzeżeń: 20%
 for i,v in ipairs(getElementsByType("vehicle")) do
    if getElementModel(v) == 407 then
        marker = createMarker(0, 0, 0, "cylinder", 1.1, 255, 0, 0, 20)
        attachElements(marker, v, 0, -4.5, -1)
    end
end

addEventHandler("onMarkerHit", marker, function(hit)
    local frakcja = getElementData(hit, "player:duty")
    if frakcja and frakcja == "LVFD" then
            giveWeapon(hit, 42, 9999)
            setPedWeaponSlot(hit, 9)
        else
            takeWeapon(hit, 42)
    end
    setElementData(hit, "linia:LVFD", not getElementData(hit, "linia:LVFD"))
    triggerClientEvent(root, "linia:LVFD", root, hit, source)
    setElementData(hit, "wazm", source)
end)

addEventHandler("onPlayerWeaponSwitch", root, function(last)
    if last == 42 and getElementData(source, "linia:LVFD") then
        setPedWeaponSlot(source, 9)
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-22, 16:44


BoomEq







Wiek: 35
Na forum: 3663 dni
Posty: 101
Nick w MP: BoomEqqq

Piwa: 20

Respekt: 70

Teraz pokazuje w DB3:
Kod:

ERROR: Loading script failed: waz/c.lua:69 'end' excepted (to close 'function' at line 8) near '<eof>'


C:
engineImportTXD (engineLoadTXD("pradownica.txd"), 366)
engineReplaceModel(engineLoadDFF("pradownica.dff", 366), 366)

local img = dxCreateTexture("linia.png")
local posiadacze = { }
local pozycje = { }

addEventHandler("onClientRender", root, function()
    for i2,v2 in ipairs(posiadacze) do
        if v2[1] and isElement(v2[1]) and not isPedInVehicle(v2[1]) then
            for i,v in ipairs(pozycje) do
                if (pozycje[i + 1] ~= nil) then
                    dxDrawMaterialLine3D(pozycje[i].x, pozycje[i].y+0.2, pozycje[i].z+1, pozycje[i + 1].x, pozycje[i + 1].y+0.2, pozycje[i + 1].z+1, img, 0.10, tocolor(150,150,150,255))
                else
                    local x,y,z = getPedBonePosition(v2[1], 25)
                    dxDrawMaterialLine3D(pozycje[i].x, pozycje[i].y+0.2, pozycje[i].z+1, x, y, z, img, 0.10, tocolor(150,150,150,255))
            end
        end
    end
end

local x1, y1, z1 

addEventHandler("onClientRender", root, function()
    if getElementData(localPlayer, "linia:LVFD") then
        if getPedOccupiedVehicle(localPlayer) then return end
        if not x1 then
            x1, y1, z1 = getElementPosition(getElementData(localPlayer, "wazm"))
        end
        if #pozycje > 0 then
            for i, v in ipairs(pozycje) do
                if i == #pozycje then
                    x1, y1, z1 = v.x, v.y, v.z
                end
            end
        end
        local x2, y2, z2 = getElementPosition(localPlayer)
        local dystans = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2)
        outputChatBox(""..x1..", "..y1..", "..z1.."")
        if dystans > 1.5 then
            --outputChatBox(#pozycje)
            mark = createMarker(x2, y2, z2-1, "arrow", 1, 255, 255, 255, 50)
            addEventHandler("onClientMarkerHit", mark, destroyM)
            table.insert(pozycje, {marker = mark, x = x2, y = y2, z = z2-1.95})
            --x1, y1, z1 = x2, y2, z2-1
        end
    end
end)

function destroyM(gracz)
    if gracz ~= localPlayer then return end
    for i, v in ipairs(pozycje) do
        if v.marker == source then
            table.remove(pozycje, i)
            destroyElement(v.marker)
        end
    end
end

addEvent("linia:LVFD", true)
addEventHandler("linia:LVFD", root, function(plr,v)
    for i = 1,#posiadacze do
        if posiadacze[i][1] == plr then
            table.remove(posiadacze, i)
            return
        end
    end
    table.insert(posiadacze, {plr,v})
end) 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-22, 16:46


Kalizman







Wiek: 24
Na forum: 3792 dni
Posty: 1394

Piwa: 4624

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

Brak end?w od instrukcji if

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-22, 16:46


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8


engineImportTXD (engineLoadTXD("pradownica.txd"), 366)
engineReplaceModel(engineLoadDFF("pradownica.dff", 366), 366)

local img = dxCreateTexture("linia.png")
local posiadacze = { }
local pozycje = { }

addEventHandler("onClientRender", root, function()
    for i2,v2 in ipairs(posiadacze) do
        if v2[1] and isElement(v2[1]) and not isPedInVehicle(v2[1]) then
            for i,v in ipairs(pozycje) do
                if (pozycje[i + 1] ~= nil) then
                    dxDrawMaterialLine3D(pozycje[i].x, pozycje[i].y+0.2, pozycje[i].z+1, pozycje[i + 1].x, pozycje[i + 1].y+0.2, pozycje[i + 1].z+1, img, 0.10, tocolor(150,150,150,255))
                else
                    local x,y,z = getPedBonePosition(v2[1], 25)
                    dxDrawMaterialLine3D(pozycje[i].x, pozycje[i].y+0.2, pozycje[i].z+1, x, y, z, img, 0.10, tocolor(150,150,150,255))
                end
            end
        end
    end
end

local x1, y1, z1 

addEventHandler("onClientRender", root, function()
    if getElementData(localPlayer, "linia:LVFD") then
        if getPedOccupiedVehicle(localPlayer) then return end
        if not x1 then
            x1, y1, z1 = getElementPosition(getElementData(localPlayer, "wazm"))
        end
        if #pozycje > 0 then
            for i, v in ipairs(pozycje) do
                if i == #pozycje then
                    x1, y1, z1 = v.x, v.y, v.z
                end
            end
        end
        local x2, y2, z2 = getElementPosition(localPlayer)
        local dystans = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2)
        outputChatBox(""..x1..", "..y1..", "..z1.."")
        if dystans > 1.5 then
            --outputChatBox(#pozycje)
            mark = createMarker(x2, y2, z2-1, "arrow", 1, 255, 255, 255, 50)
            addEventHandler("onClientMarkerHit", mark, destroyM)
            table.insert(pozycje, {marker = mark, x = x2, y = y2, z = z2-1.95})
            --x1, y1, z1 = x2, y2, z2-1
        end
    end
end)

function destroyM(gracz)
    if gracz ~= localPlayer then return end
    for i, v in ipairs(pozycje) do
        if v.marker == source then
            table.remove(pozycje, i)
            destroyElement(v.marker)
        end
    end
end

addEvent("linia:LVFD", true)
addEventHandler("linia:LVFD", root, function(plr,v)
    for i = 1,#posiadacze do
        if posiadacze[i][1] == plr then
            table.remove(posiadacze, i)
            return
        end
    end
    table.insert(posiadacze, {plr,v})
end) 


Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-22, 16:52


BoomEq







Wiek: 35
Na forum: 3663 dni
Posty: 101
Nick w MP: BoomEqqq

Piwa: 20

Respekt: 70

Teraz pokazuje w DB3:
Kod:

ERROR: Loading script failed: waz\c.lua:23: ')' expected (to close '(' at line) near 'local'


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-22, 17:44


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8


engineImportTXD (engineLoadTXD("pradownica.txd"), 366)
engineReplaceModel(engineLoadDFF("pradownica.dff", 366), 366)

local img = dxCreateTexture("linia.png")
local posiadacze = { }
local pozycje = { }

addEventHandler("onClientRender", root, function()
    for i2,v2 in ipairs(posiadacze) do
        if v2[1] and isElement(v2[1]) and not isPedInVehicle(v2[1]) then
            for i,v in ipairs(pozycje) do
                if (pozycje[i + 1] ~= nil) then
                    dxDrawMaterialLine3D(pozycje[i].x, pozycje[i].y+0.2, pozycje[i].z+1, pozycje[i + 1].x, pozycje[i + 1].y+0.2, pozycje[i + 1].z+1, img, 0.10, tocolor(150,150,150,255))
                else
                    local x,y,z = getPedBonePosition(v2[1], 25)
                    dxDrawMaterialLine3D(pozycje[i].x, pozycje[i].y+0.2, pozycje[i].z+1, x, y, z, img, 0.10, tocolor(150,150,150,255))
                end
            end
        end
    end
end



addEventHandler("onClientRender", root, function()
    if getElementData(localPlayer, "linia:LVFD") then
        if getPedOccupiedVehicle(localPlayer) then return end
        local x1
        if not x1 then
            x1, y1, z1 = getElementPosition(getElementData(localPlayer, "wazm"))
        end
        if #pozycje > 0 then
            for i, v in ipairs(pozycje) do
                if i == #pozycje then
                    x1, y1, z1 = v.x, v.y, v.z
                end
            end
        end
        local x2, y2, z2 = getElementPosition(localPlayer)
        local dystans = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2)
        outputChatBox(""..x1..", "..y1..", "..z1.."")
        if dystans > 1.5 then
            --outputChatBox(#pozycje)
            mark = createMarker(x2, y2, z2-1, "arrow", 1, 255, 255, 255, 50)
            addEventHandler("onClientMarkerHit", mark, destroyM)
            table.insert(pozycje, {marker = mark, x = x2, y = y2, z = z2-1.95})
            --x1, y1, z1 = x2, y2, z2-1
        end
    end
end)

function destroyM(gracz)
    if gracz ~= localPlayer then return end
    for i, v in ipairs(pozycje) do
        if v.marker == source then
            table.remove(pozycje, i)
            destroyElement(v.marker)
        end
    end
end

addEvent("linia:LVFD", true)
addEventHandler("linia:LVFD", root, function(plr,v)
    for i = 1,#posiadacze do
        if posiadacze[i][1] == plr then
            table.remove(posiadacze, i)
            return
        end
    end
    table.insert(posiadacze, {plr,v})
end) 


Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-22, 18:05


BoomEq







Wiek: 35
Na forum: 3663 dni
Posty: 101
Nick w MP: BoomEqqq

Piwa: 20

Respekt: 70

Eh,
Kod:

ERROR: Loading script: waz\c.lua:25: ')' excepted (to close '(' at line 8) near 'addEventHandler'


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-22, 22:34


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8


engineImportTXD (engineLoadTXD("pradownica.txd"), 366)
engineReplaceModel(engineLoadDFF("pradownica.dff", 366), 366)

local img = dxCreateTexture("linia.png")
local posiadacze = { }
local pozycje = { }

addEventHandler("onClientRender", root, function()
    for i2,v2 in ipairs(posiadacze) do
        if v2[1] and isElement(v2[1]) and not isPedInVehicle(v2[1]) then
            for i,v in ipairs(pozycje) do
                if (pozycje[i + 1] ~= nil) then
                    dxDrawMaterialLine3D(pozycje[i].x, pozycje[i].y+0.2, pozycje[i].z+1, pozycje[i + 1].x, pozycje[i + 1].y+0.2, pozycje[i + 1].z+1, img, 0.10, tocolor(150,150,150,255))
                else
                    local x,y,z = getPedBonePosition(v2[1], 25)
                    dxDrawMaterialLine3D(pozycje[i].x, pozycje[i].y+0.2, pozycje[i].z+1, x, y, z, img, 0.10, tocolor(150,150,150,255))
                end
            end
        end
    end
end)



addEventHandler("onClientRender", root, function()
    if getElementData(localPlayer, "linia:LVFD") then
        if getPedOccupiedVehicle(localPlayer) then return end
        local x1
        if not x1 then
            x1, y1, z1 = getElementPosition(getElementData(localPlayer, "wazm"))
        end
        if #pozycje > 0 then
            for i, v in ipairs(pozycje) do
                if i == #pozycje then
                    x1, y1, z1 = v.x, v.y, v.z
                end
            end
        end
        local x2, y2, z2 = getElementPosition(localPlayer)
        local dystans = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2)
        outputChatBox(""..x1..", "..y1..", "..z1.."")
        if dystans > 1.5 then
            --outputChatBox(#pozycje)
            mark = createMarker(x2, y2, z2-1, "arrow", 1, 255, 255, 255, 50)
            addEventHandler("onClientMarkerHit", mark, destroyM)
            table.insert(pozycje, {marker = mark, x = x2, y = y2, z = z2-1.95})
            --x1, y1, z1 = x2, y2, z2-1
        end
    end
end)

function destroyM(gracz)
    if gracz ~= localPlayer then return end
    for i, v in ipairs(pozycje) do
        if v.marker == source then
            table.remove(pozycje, i)
            destroyElement(v.marker)
        end
    end
end

addEvent("linia:LVFD", true)
addEventHandler("linia:LVFD", root, function(plr,v)
    for i = 1,#posiadacze do
        if posiadacze[i][1] == plr then
            table.remove(posiadacze, i)
            return
        end
    end
    table.insert(posiadacze, {plr,v})
end) 


Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-22, 23:18


BoomEq







Wiek: 35
Na forum: 3663 dni
Posty: 101
Nick w MP: BoomEqqq

Piwa: 20

Respekt: 70

Ju? nie wywala b??d?w ale nie dzia?a na frakcyjnym poje?dzie. Jedynie jak zrespie fire trucka to dziala ;/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-22, 23:53


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8

Tu


 for i,v in ipairs(getElementsByType("vehicle")) do
    if getElementModel(v) == 407 then -- tutaj dodaj and getElementModel(V) == idpojazdu 
        marker = createMarker(0, 0, 0, "cylinder", 1.1, 255, 0, 0, 20)
        attachElements(marker, v, 0, -4.5, -1)
    end
end




Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-23, 17:24


BoomEq







Wiek: 35
Na forum: 3663 dni
Posty: 101
Nick w MP: BoomEqqq

Piwa: 20

Respekt: 70

Damian2511, ?le napisa?em. Na FRAKCYJNYM pojezdzie fire truck pojawia sie marker z ty?u ale nie daje nam pr?downicy, a gdy wejde w marker od respionego to daje

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: daje :: broni
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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