Wysłany: 2018-05-16, 18:20
Ivanpojara
Wiek: 28 Na forum: 4247 dni Posty: 21
Piwa : 1
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 ?
Wysłany: 2018-05-16, 18:24
Ciastuuś
Truck soon...
Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa : 4297
Poka? kod i b??dy z debugscript 3
Wysłany: 2018-05-16, 18:25
Ivanpojara
Wiek: 28 Na forum: 4247 dni Posty: 21
Piwa : 1
local m_dostep = "mechanik-sf1"
local doFixed ={
{ "Silnik" , 1 , fn =function( veh ) if getElementHealth ( veh )>= 2040 then return true end ; return false end },
{ "Maska" , 2 , fn =function( veh ) if getVehicleDoorState ( veh , 0 )== 0 then return true end ; return false end },
{ "Baga?nik" , 3 , fn =function( veh ) if getVehicleDoorState ( veh , 1 )== 0 then return true end ; return false end },
{ "Drzwi lewy prz?d" , 4 , fn =function( veh ) if getVehicleDoorState ( veh , 2 )== 0 then return true end ; return false end },
{ "Drzwi prawy prz?d" , 5 , fn =function( veh ) if getVehicleDoorState ( veh , 3 )== 0 then return true end ; return false end },
{ "Drzwi lewy ty?" , 6 , fn =function( veh ) if getVehicleDoorState ( veh , 4 )== 0 then return true end ; return false end },
{ "Drzwi prawy ty?" , 7 , fn =function( veh ) if getVehicleDoorState ( veh , 5 )== 0 then return true end ; return false end },
{ "Szyba przednia" , 8 , fn =function( veh ) if getVehiclePanelState ( veh , 4 )== 0 then return true end ; return false end },
{ "Zderzak przedni" , 9 , fn =function( veh ) if getVehiclePanelState ( veh , 5 )== 0 then return true end ; return false end },
{ "Zderzak tylni" , 10 , fn =function( veh ) if getVehiclePanelState ( veh , 6 )== 0 then return true end ; return false end },
{ "?wiat?o lewe przednie" , 11 , fn =function( veh ) if getVehicleLightState ( veh , 0 )== 0 then return true end ; return false end },
{ "?wiat?a prawe przednie" , 12 , fn =function( veh ) if getVehicleLightState ( veh , 1 )== 0 then return true end ; return false end },
{ "?wiat?a lewe tylnie" , 13 , fn =function( veh ) if getVehicleLightState ( veh , 2 )== 0 then return true end ; return false end },
{ "?wiat?a prawe tylnie" , 14 , fn =function( veh ) if getVehicleLightState ( veh , 3 )== 0 then return true end ; return false end },
}
local doCosts ={ 50 , 20 , 20 , 15 , 15 , 15 , 15 , 40 , 10 , 10 , 20 , 20 , 20 , 20 }
local wm ={}
local isVehicles = nil
wm . window = guiCreateWindow ( 0.18 , 0.21 , 0.64 , 0.52 , "" , true )
guiWindowSetSizable ( wm . window , false )
guiSetVisible ( wm . window , false )
guiSetAlpha ( wm . window , 1.00 )
wm . gridlist = guiCreateGridList ( 0.01 , 0.07 , 0.97 , 0.75 , true , wm . window )
guiGridListAddColumn ( wm . gridlist , "Nazwa" , 0.5 )
guiGridListAddColumn ( wm . gridlist , "Koszt" , 0.5 )
guiGridListAddRow ( wm . gridlist )
wm . fixall = guiCreateButton ( 0.75 , 0.85 , 0.24 , 0.11 , "Napraw wszystko (200 PLN)" , true , wm . window )
wm . fixparts = guiCreateButton ( 0.02 , 0.85 , 0.24 , 0.11 , "Napraw wybran? cz???" , true , wm . 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 . gridlist , row , 1 , v [ 1 ], false , false )
guiGridListSetItemData ( wm . gridlist , row , 1 , i )
guiGridListSetItemText ( wm . gridlist , row , 2 , doCosts [ i ].. " PLN" , false , false )
guiGridListSetItemData ( wm . gridlist , row , 2 , doCosts [ 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." , 255 , 0 , 0 )
return
end
if #vehicles > 1 then
outputChatBox ( "* Na stanowisku naprawczym znajduje si? zbyt du?a ilo?? pojazd?w." , 255 , 0 , 0 )
return
end
--[[if getElementHealth ( vehicles [ 1 ]) > 990 then
outputChatBox ( "* Pojazd na stanowisku naprawczym jest sprawny." )
return
end ]]
showCursor ( true , false )
guiSetVisible ( wm . window , true )
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 . gridlist , row , 1 , v [ 1 ], false , false )
guiGridListSetItemData ( wm . gridlist , row , 1 , i )
guiGridListSetItemText ( wm . gridlist , row , 2 , doCosts [ i ].. " PLN" , false , false )
guiGridListSetItemData ( wm . gridlist , row , 2 , doCosts [ i ])
end
end
end )
addEventHandler ( "onClientMarkerLeave" , resourceRoot , function( el , md )
if el ~= localPlayer then return end
guiSetVisible ( wm . window , false )
isVehicles = nil
showCursor ( false )
end )
addEventHandler ( "onClientGUIClick" , wm . fixparts , function()
if not isVehicles or not isElement ( isVehicles ) then return end
selectedRow = guiGridListGetSelectedItem ( wm . gridlist ) or - 1
if selectedRow < 0 then return end
local cost = guiGridListGetItemData ( wm . gridlist , selectedRow , 2 )
if cost > getPlayerMoney ( localPlayer ) then
outputChatBox ( "* Nie masz tyle got?wki!" )
return
end
local part = guiGridListGetItemData ( wm . gridlist , selectedRow , 1 )
outputChatBox ( '* Naprawiles ' .. tostring ( getPartName ( doFixed , part )))
triggerServerEvent ( "takePlayerMoney" , localPlayer , cost )
triggerServerEvent ( "montazElementu" , root , isVehicles , "naprawa" , part , cost )
setTimer (function()
refreshGUI ()
end , 200 , 2 )
end )
addEventHandler ( "onClientGUIClick" , wm . fixall , function()
if not isVehicles or not isElement ( isVehicles ) then return end
if 200 > getPlayerMoney ( localPlayer ) then
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" , localPlayer , 200 )
outputChatBox ( '* Naprawiles wszystkie elementy w pojezdzie.' )
triggerServerEvent ( "montazElementu" , root , isVehicles , "naprawa" , "all" , 200 )
setTimer (function()
refreshGUI ()
end , 200 , 2 )
end )
-- utils
function getPartName ( t , key )
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 ?
Ostatnio zmieniony przez Barcioo 2018-05-25, 19:43, w całości zmieniany 1 raz
Wysłany: 2018-05-17, 23:33
Hades.
Łiiiiiiiiii
Wiek: 22 Na forum: 4700 dni Posty: 372
Nick w MP: Hades
Piwa : 3214
Nast?pnym razem daj ten kod w [lua], podejrzewam ?e nie masz w??czonego skryptu ogrpg-montaz (czy co? tego typu).
Wysłany: 2018-05-25, 19:29
Mezo.
Mod-Team
Wiek: 24 Na forum: 3211 dni Posty: 548
Nick w MP: Mezo
Piwa : 6070
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
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
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
Tagi: naprawa :: nie :: działa
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: