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

Wysłany: 2017-12-03, 16:27


dawid465







Wiek: 31
Na forum: 4765 dni
Posty: 9
Nick w MP: David



Respekt: 50

Witam moim problemem jest przecho jak wida? po tytule

Gdy odaj? pojazd do przecho samo go naprawia po wyj?ciu

pom?g? by kto? wyt?umaczy? jak to naprawi? zeby auto by?o rozbit? takie jakie oda?em

Dzi?ki z g?ry
pozdrawiam

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-03, 16:38


CjPomarancza

:-)






Wiek: 17
Na forum: 3184 dni
Posty: 90

Piwa: 12

Respekt: 60

Wklej kod przechowalni.

Podpis
Pomogłem? Doceń mnie i postaw :piwo: :)
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-03, 17:02


dawid465







Wiek: 31
Na forum: 4765 dni
Posty: 9
Nick w MP: David



Respekt: 50

od strony clienta czy servera

[ Dodano: 2017-12-03, 17:15 ]
--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]

local mdestroy=createMarker(-2090.7895.6935.32-1"cylinder"605020550)
createBlipAttachedTo(mdestroy35)

local t=createElement("text")
setElementData(t,"scale",1.5)
setElementData(t,"name","Pozostawianie pojazd?w")
setElementPosition(t,-2090.7895.6935.32)


addEvent("onParkingGetRekords"true)
addEventHandler("onParkingGetRekords"root, function()
    local uid=getElementData(source,"player:uid")
    if not uid then return end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE ownedPlayer=? AND parking=1"uid)
    if #result > 0 then
        triggerClientEvent(source"onParkingGetVehicles"sourceresult)
    end
end)

addEventHandler("onMarkerHit"mdestroy, function(el,md)
    if getElementType(el) == "player" then
        local veh=getPedOccupiedVehicle(el)
        if not veh then return end
        if getVehicleController(veh) ~= el then return end
        local id=getElementData(veh,"vehicle:id")
        if not id then return end
        if isTimer(timeroddaniathen return end
        setElementFrozen(veh,true)
        toggleControl(el,"enter_exit",false)
        timeroddania=setTimer(function()
            exports["ogrpg-vehicles"]:onSaveVehicle(veh)
            destroyElement(veh)
            exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET parking=1 WHERE id=?"id)
            toggleControl(el,"enter_exit",true)
        end30001)
    end
end)

addEvent("onParkingVehicleSpawn"true)
addEventHandler("onParkingVehicleSpawn"root, function(id)
    if not id then return end
    local spawn=exports["ogrpg-vehicles"]:onRespawnVehicles(_,id,{-2099.5088.7935.320.3359.988.7})
    if spawn then
        outputChatBox("* Zrespawniono pojazd."source)
    end
end)



local marker=createMarker(-2089.3584.2635.31-0.9"cylinder"2205,50,0,50)
local sphere=createColSphere(-2089.3584.2635.31-0.96)

local t=createElement("text")
setElementData(t,"scale",1.5)
setElementData(t,"name","Odbi?r pojazd?w")
setElementPosition(t,-2089.3584.2635.31)

local wm={}
wm.window=guiCreateWindow(0.250.260.510.42"Odbieranie pojazd?w"true)
guiWindowSetSizable(wm.windowfalse)
guiWindowSetMovable(wm.windowfalse)
guiSetVisible(wm.windowfalse)
wm.gridlist=guiCreateGridList(0.040.090.920.65truewm.window)
guiGridListAddColumn(wm.gridlist"ID"0.4)
guiGridListAddColumn(wm.gridlist"Model"0.6)
wm.submit=guiCreateButton(0.040.760.470.19"Wyjmij pojazd"truewm.window)
wm.close=guiCreateButton(0.570.750.390.20"Zamknij"truewm.window)

addEvent("onParkingGetVehicles"true)
addEventHandler("onParkingGetVehicles"root, function(result)
    guiGridListClear(wm.gridlist)
    if not result then return end
    for i,v in pairs(result) do
        local row=guiGridListAddRow(wm.gridlist)
        guiGridListSetItemText(wm.gridlistrow1v["id"], falsefalse)
        guiGridListSetItemText(wm.gridlistrow2getVehicleNameFromModel(v["model"]), falsefalse)
    end
end)

addEventHandler("onClientMarkerHit"marker, function(el,md)
    if el~=localPlayer then return end
    if isPedInVehicle(elthen return end
    if guiGetVisible(wm.window) == false then
        showCursor(true)
        guiSetVisible(wm.window,true)
        triggerServerEvent("onParkingGetRekords"localPlayer)
    end
end)

addEventHandler("onClientGUIClick"resourceRoot, function()
    if source == wm.close then
        if guiGetVisible(wm.window) == true then
            showCursor(false)
            guiSetVisible(wm.window,false)
            setCameraTarget(localPlayerlocalPlayer)
        end
    end
    if source == wm.submit then
        local selectedRow=guiGridListGetSelectedItem(wm.gridlist) or -1
        if selectedRow 0 then return end
        local vehicles=getElementsWithinColShape(sphere,"vehicle")
        if #vehicles > 0 then
            outputChatBox("* Nie ma miejsca aby wyci?gn?? pojazd."25500)
            return
        end
        local id=guiGridListGetItemText(wm.gridlistselectedRow1)
        guiGridListRemoveRow(wm.gridlistselectedRow)
        triggerServerEvent("onParkingVehicleSpawn"localPlayertonumber(id))
    end
end)


[ Dodano: 2017-12-04, 14:06 ]
pomoze kto? ??

Komentarz _Mike dodany 2017-12-04, 16:18Dodałem znaczniki [lua][/lua], gdyż tak jest bardziej czytelnie.
Ostatnio zmieniony przez Atroth 2017-12-04, 16:18, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-04, 23:22


Eitho







Wiek: 24
Na forum: 3489 dni
Posty: 330
Nick w MP: Eitho

Piwa: 746

Respekt: 256,5
Respekt: 256,5Respekt: 256,5Respekt: 256,5

Przyda?by si? kod ogrpg-vehicles (skrypt u?ywa go do respienia pojazd?w: local spawn=exports["ogrpg-vehicles"]:onRespawnVehicles(_,id,{-2099.50, 88.79, 35.32, 0.3, 359.9, 88.7})), poniewa? tam mo?e nie by? odczytu lub zapisu uszkodze?, przez co pojazd otrzymujemy naprawiony.

Podpis
good old days :]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-05, 12:25


nomercy







Wiek: 31
Na forum: 3104 dni
Posty: 5
Nick w MP: nomercy*

Piwa: 1

Respekt: 50

Pewnie w tym twoim ?miesznym gamemodzie system pojazd?w nie zapisuje panelstates`?w.

Postaw piwo autorowi tego posta
 

 
Tagi: przecho :: naprawia :: auta
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