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

Wysłany: 2018-05-16, 18:20


Ivanpojara







Wiek: 28
Na forum: 4247 dni
Posty: 21

Piwa: 1

Respekt: 50

Witam , mam jeden problem odnosnie naprawy pojazdu , mam pliki Your Adventure i po przeniesieniu :NAPRAWY: oraz Cuboida po kliknieciu "NAPRAW WSZYSTKO" jest tylko napisane (Naprawiles wszystkie lementy w pojezdzie) a pojazd nadal stoi jak sta? , wie kto? moze czego to jest przyczyna ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-16, 18:24


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Poka? kod i b??dy z debugscript 3

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-16, 18:25


Ivanpojara







Wiek: 28
Na forum: 4247 dni
Posty: 21

Piwa: 1

Respekt: 50

local m_dostep="mechanik-sf1"

local doFixed={
    {"Silnik"1fn=function(veh) if getElementHealth(veh)>=2040 then return true end; return false end}, 
    {"Maska"2fn=function(veh) if getVehicleDoorState(veh0)==0 then return true end; return false end},
    {"Baga?nik"3fn=function(veh) if getVehicleDoorState(veh1)==0 then return true end; return false end},
    {"Drzwi lewy prz?d"4fn=function(veh) if getVehicleDoorState(veh2)==0 then return true end; return false end},
    {"Drzwi prawy prz?d"5fn=function(veh) if getVehicleDoorState(veh3)==0 then return true end; return false end},
    {"Drzwi lewy ty?"6fn=function(veh) if getVehicleDoorState(veh4)==0 then return true end; return false end},
    {"Drzwi prawy ty?"7fn=function(veh) if getVehicleDoorState(veh5)==0 then return true end; return false end},
    {"Szyba przednia"8fn=function(veh) if getVehiclePanelState(veh4)==0 then return true end; return false end},
    {"Zderzak przedni"9fn=function(veh) if getVehiclePanelState(veh5)==0 then return true end; return false end},
    {"Zderzak tylni"10fn=function(veh) if getVehiclePanelState(veh6)==0 then return true end; return false end},
    {"?wiat?o lewe przednie"11fn=function(veh) if getVehicleLightState(veh0)==0 then return true end; return false end},
    {"?wiat?a prawe przednie"12fn=function(veh) if getVehicleLightState(veh1)==0 then return true end; return false end},
    {"?wiat?a lewe tylnie"13fn=function(veh) if getVehicleLightState(veh2)==0 then return true end; return false end},
    {"?wiat?a prawe tylnie"14fn=function(veh) if getVehicleLightState(veh3)==0 then return true end; return false end},
}

local doCosts ={ 5020201515151540101020202020 }

local wm={}
local isVehicles=nil
wm.window guiCreateWindow(0.180.210.640.52""true)
guiWindowSetSizable(wm.windowfalse)
guiSetVisible(wm.windowfalse)
guiSetAlpha(wm.window1.00)
wm.gridlist guiCreateGridList(0.010.070.970.75truewm.window)
guiGridListAddColumn(wm.gridlist"Nazwa"0.5)
guiGridListAddColumn(wm.gridlist"Koszt"0.5)
guiGridListAddRow(wm.gridlist)
wm.fixall guiCreateButton(0.750.850.240.11"Napraw wszystko (200 PLN)"truewm.window)
wm.fixparts guiCreateButton(0.020.850.240.11"Napraw wybran? cz???"truewm.window)

local function refreshGUI()
    if not isVehicles then return end

    guiGridListClear(wm.gridlist)
    for i,v in pairs(doFixed) do
        if v.fn(isVehicles)==false then
            local row guiGridListAddRow(wm.gridlist)
            guiGridListSetItemText(wm.gridlistrow1v[1], falsefalse)
            guiGridListSetItemData(wm.gridlistrow1i)
            guiGridListSetItemText(wm.gridlistrow2doCosts[i].." PLN"falsefalse)
            guiGridListSetItemData(wm.gridlistrow2doCosts[i])
        end
    end
end
addEventHandler("onClientMarkerHit"resourceRoot, function(el,md)
    if not md or el~=localPlayer then return end
    local cs=getElementData(source"snn_cs")
    if not cs then return end
    local vehicles=getElementsWithinColShape(cs,"vehicle")
    if #vehicles < 1 then
        outputChatBox("* Na stanowisku naprawczym nie znajduje si? pojazd."25500)
        return
    end
    if #vehicles > 1 then
        outputChatBox("* Na stanowisku naprawczym znajduje si? zbyt du?a ilo?? pojazd?w."25500)
        return
    end
    --[[if getElementHealth(vehicles[1]) > 990 then
        outputChatBox("* Pojazd na stanowisku naprawczym jest sprawny.")
        return
    end]]
    showCursor(truefalse)
    guiSetVisible(wm.windowtrue)
    isVehicles vehicles[1]
    guiGridListClear(wm.gridlist)
    for i,v in pairs(doFixed) do
        if v.fn(isVehicles)==false then
            local row guiGridListAddRow(wm.gridlist)
            guiGridListSetItemText(wm.gridlistrow1v[1], falsefalse)
            guiGridListSetItemData(wm.gridlistrow1i)
            guiGridListSetItemText(wm.gridlistrow2doCosts[i].." PLN"falsefalse)
            guiGridListSetItemData(wm.gridlistrow2doCosts[i])
        end
    end
end)

addEventHandler("onClientMarkerLeave"resourceRoot, function(el,md)
    if el~=localPlayer then return end
    guiSetVisible(wm.windowfalse)
    isVehicles=nil
    showCursor(false)
end)

addEventHandler("onClientGUIClick"wm.fixparts, function()
    if not isVehicles or not isElement(isVehiclesthen return end
    selectedRow guiGridListGetSelectedItem(wm.gridlist) or -1
    if selectedRow 0 then return end
    local cost guiGridListGetItemData(wm.gridlistselectedRow2)
    if cost getPlayerMoney(localPlayerthen
        outputChatBox("* Nie masz tyle got?wki!")
        return
    end

    local part guiGridListGetItemData(wm.gridlistselectedRow1)
    outputChatBox('* Naprawiles ' .. tostring(getPartName(doFixedpart)))
    triggerServerEvent("takePlayerMoney"localPlayercost)
    triggerServerEvent("montazElementu"rootisVehicles"naprawa"partcost)
    setTimer(function()
        refreshGUI()
    end2002)
end)

addEventHandler("onClientGUIClick"wm.fixall, function()
    if not isVehicles or not isElement(isVehiclesthen return end
    if 200 getPlayerMoney(localPlayerthen
        outputChatBox("* Nie masz tyle got?wki!")
        return
    end

    local elementyDoNaprawy=0
    for i,v in pairs(doFixed) do
        if v.fn(isVehicles)==false then
            elementyDoNaprawy=elementyDoNaprawy+1
        end
    end
    if elementyDoNaprawy==0 then
        outputChatBox('* Pojazd jest juz naprawiony.')
        return
    end

    triggerServerEvent("takePlayerMoney"localPlayer200)
    outputChatBox('* Naprawiles wszystkie elementy w pojezdzie.')
    triggerServerEvent("montazElementu"rootisVehicles"naprawa""all"200)
    setTimer(function()
        refreshGUI()
    end2002)
end)

-- utils
function getPartName(tkey)
    for i,v in pairs(t) do
        if v[2]==key then
            return v[1]
        end
    end
end
fileDelete('c_naprawa.lua'


[ Dodano: 2018-05-16, 20:44 ]
Wie kto? oco chodzi ?

[ Dodano: 2018-05-16, 20:45 ]
Wie kto? o co chodzi?

[ Dodano: 2018-05-16, 20:47 ]
O co chodzi wie ktos ? pomoze ?

Komentarz Barcioo dodany 2018-05-25, 19:43Dodałem tag Lua [.lua] kod [./lua]
Ostatnio zmieniony przez Barcioo 2018-05-25, 19:43, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-17, 23:33


Hades.

Łiiiiiiiiii






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

Piwa: 3214

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

Nast?pnym razem daj ten kod w [lua], podejrzewam ?e nie masz w??czonego skryptu ogrpg-montaz (czy co? tego typu).

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-05-25, 19:29


Mezo.

Mod-Team






Wiek: 24
Na forum: 3211 dni
Posty: 548
Nick w MP: Mezo

Piwa: 6070

Respekt: 517
Respekt: 517

w??cz ogrpg-core, ogrpg-monta?-lampki i wszystko zwi?zane z mechanik? i zadzia?a w 100%

Podpis
- Na forum pomagam na miarę swoich możliwości, oraz bezpłatnie.
- Jeżeli potrzebujesz pomocy, pisz do mnie w prywatnej wiadomości, pomoc uzyskasz szybciej.
Współpraca - [email protected]


Użytkownik - 19.08.2017
GTAO MEMBER - 29.03.2019
Support-Team - 03.02.2019 - 07.05.2019
Moderator - 07.05.2019 - 02.08.2020
Mod-Team - 02.08.2020 - 25.03.2022

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
VaXo
Wysłany: 2018-05-25, 23:52


PatryKK.

Emeryt LUA






Wiek: 26
Na forum: 3061 dni
Posty: 1060
Nick w MP: PatryKK.

Piwa: 2322

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

Je?eli masz ju? w??czy?e? ogrpg-core, szukasz skryptu ogrpg-naprawa-pojazdow oraz ogrpg-montaz-lampki naprawa powinna dzia?a?. Je?eli nadal masz problem to ?mia?o pytaj :)

Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔

Aktualny projekt: BRAK
Postaw piwo autorowi tego posta
 

 
Tagi: naprawa :: nie :: działa
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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