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

Wysłany: 2020-05-27, 19:19


Arbuzikk







Wiek: 27
Na forum: 2373 dni
Posty: 5



Respekt: 50

dlaczego jak zamontuje silnik 2.2 i oddam do przecho to zostaje ten co by? 1.4?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-27, 22:32


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Najwyra?niej nie masz zapisu pojemno?ci silnika po schowaniu pojazdu.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-27, 22:55


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

wklej kod

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-28, 13:10


Irvs







Wiek: 30
Na forum: 2680 dni
Posty: 48

Piwa: 3

Respekt: 50

Przy oddawaniu do przecho zapisz pojemno?? do odpowiedniej kolumnie w bazie.
Przy wyci?ganiu sprawdz jak? ma warto?? w bazie i przypisz do samochodu. Jak poka?esz kod to co? wymy?limy.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-28, 15:11


Arbuzikk







Wiek: 27
Na forum: 2373 dni
Posty: 5



Respekt: 50

jak da? wam ten kod bo nie czaje teraz? :P

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-28, 17:02


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

Arbuzikk, kod czyli zawarto?? plik?w wejd? w skrypt przechowywalni i podaj.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-28, 17:59


Arbuzikk







Wiek: 27
Na forum: 2373 dni
Posty: 5



Respekt: 50

chowalnie = {
{{-2533.93, -15.2616.43},createMarker(-2533.93, -15.2616.43-4"cylinder"50,64,25550),setElementData(createColCuboid(-2535.86, -16.7715.423.633.493.59),"przecho:chowanie:id",1),{['Automobile']=true,['Bike']=true,['BMX']=true,['Quad']=true,['Monster Truck']=true,},"Samochody i motocykle"},
{{217.87,24.95,2.58},createMarker(217.87,24.95,2.58-4"cylinder"50,64,25550),setElementData(createColCuboid(216.0223.251.583.533.293.24),"przecho:chowanie:id",2),{['Automobile']=true,['Bike']=true,['BMX']=true,['Quad']=true,['Monster Truck']=true,},"Samochody i motocykle"},
{{-2040.31483.2535.17},createMarker(-2040.31483.2535.17-5"cylinder"50,64,25550),setElementData(createColCuboid(-2043.15480.4434.175.665.813.88),"przecho:chowanie:id",3),{['Automobile']=true,['Bike']=true,['BMX']=true,['Quad']=true,['Monster Truck']=true,},"Samochody i motocykle"},
}

for _,c in pairs(chowalnie) do
createBlip(c[1][1],c[1][2],c[1][3], 35,2,0,0,0,0,0,250)
local t=createElement("text")
setElementData(t,"scale",1.0)
setElementData(t,"name","Pozostawianie pojazd?w")
setElementPosition(t,c[1][1],c[1][2],c[1][3])
end

addEvent("onParkingGetRekords"true)
addEventHandler("onParkingGetRekords"root, function(id)
    local sid=getElementData(client,"player:sid")
    if not sid then return end
    local org getElementData(client,"player:organization") or "BRAK"
    local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE (ownedPlayer=? OR ownedGroup=?) AND parking=1",sid,org)
    if #result > 0 then
        triggerClientEvent(client"onParkingGetVehicles"rootresult,id)
    end
end)

addEventHandler("onColShapeHit"root, function(el,md)
    local id_chow getElementData(source,"przecho:chowanie:id")
    if not id_chow then return end
    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 chowalnie[id_chow][4][getVehicleType(veh)] then
        if isTimer(timeroddaniathen return end
        setElementFrozen(veh,true)
        --outputChatBox("Trwa oddawanie  pojazdu."el,255,255,255,true)
        toggleControl(el,"enter_exit",false)
        timeroddania=setTimer(function()
            setElementFrozen(veh,false)
            local id=getElementData(veh,"vehicle:id")
            if not id then return end
            exports["pystories-vehicles"]:onSaveVehicle(veh)
            destroyElement(veh)
            exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET parking=1,tp_to_parking=? WHERE id=?","Schowany recznie(kierowca)"id)
            toggleControl(el,"enter_exit",true)
            outputChatBox("#06B200(✔) #FFFFFFPomy?lnie zapisano pojazd."el255255 ,255 ,true)
        end30001)
        end
    elseif getElementType(el) == "vehicle" then
        local gracz=getVehicleController(el)
        if gracz then return end
        local id=getElementData(el,"vehicle:id")
        if not id then return end
        if chowalnie[id_chow][4][getVehicleType(veh)] then
        if isTimer(timeroddaniathen return end
        timeroddania=setTimer(function()
            setElementFrozen(el,false)
            local id=getElementData(el,"vehicle:id")
            if not id then return end
            exports["pystories-vehicles"]:onSaveVehicle(el)
            destroyElement(el)
            exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET parking=1,tp_to_parking=? WHERE id=?","Schowany recznie(bez kierowcy)"id)
            outputChatBox("#06B200(✔) #FFFFFFPomy?lnie zapisano pojazd."el255255 ,255 ,true)
        end30001)
        setElementFrozen(el,true)
        setVehicleLocked(el,true)
        end
    end
end)

addEvent("onParkingVehicleSpawn"true)
addEventHandler("onParkingVehicleSpawn"root, function(id,miejsce)
    if not id then return end
    if not miejsce then return end
    local spawn=exports["pystories-vehicles"]:onRespawnVehicles(_,id,miejsce)
    if spawn then
    addEventHandler("onClientRender",root,render1)
    end
end)



function render1()
dxDrawText("Zrespiono pojazd"screenW 0.3656screenH 0.1553screenW 0.6273screenH 0.3193tocolor(255255255255), 2.50"pricedown""center""center"falsefalsefalsefalsefalse)
end


function renderstop1()
removeEventHandler("onClientRender",root,render1)
end
s.lua
local screenWscreenH guiGetScreenSize()
mojeW,mojeH 12801024
sW,sH guiGetScreenSize()
w= (sW/mojeW), (sH/mojeH)
local sxsy guiGetScreenSize ()
 
 przecho false
 
function mysz(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

local vehiclesNames = {
    ["Hotring Racer"] = "Deluxo",
    ["Hotring Racer 3"] = "Mercedes Benz c63",
}

function changeName(name)
    local changedName vehiclesNames[name]
    if changedName then
        return changedName
    else
        return name
    end
end

przechowalnie = {
{{-2532.75, -28.5916.48},setElementData(createMarker(-2532.75, -28.5916.48-1"cylinder"1.20,64,25550),"przecho:id",1),{['Automobile']=true,['Bike']=true,['BMX']=true,['Quad']=true,['Monster Truck']=true,},"Samochody i motocykle",createColCuboid(-2538.13, -25.6015.436.534.915.17),{-2534.64, -23.2016.190.5360.088.8}},
{{215.87,14.59,2.57},setElementData(createMarker(215.87,14.59,2.57-1"cylinder"1.20,64,25550),"przecho:id",2),{['Automobile']=true,['Bike']=true,['BMX']=true,['Quad']=true,['Monster Truck']=true,},"Samochody i motocykle",createColCuboid(215.885.091.573.735.684.60),{219.577.732.300.10.0270.7}},
{{-2032.27466.7135.17},setElementData(createMarker(-2032.27466.7135.17-1"cylinder"1.20,64,25550), "przecho:id",3),{['Automobile']=true,['Bike']=true,['BMX']=true,['Quad']=true,['Monster Truck']=true,},"Samochody i motocykle",createColCuboid(-2043.15480.4434.175.665.813.88),{-2026.92470.4836.173.632.81270}},
}

for i,p in pairs(przechowalnie) do
local t=createElement("text")
setElementData(t,"scale",1.0)
setElementData(t,"name",("Odbi?r pojazd?w\n (%s)"):format(p[4]))
setElementPosition(t,p[1][1],p[1][2],p[1][3])

end

ID_PRZECHO_DO_JAKIEJ_WLAZLES nil

local wm={}
wm.gridlist=guiCreateGridList(357*w393*h567*w218*hfalse)
guiGridListAddColumn(wm.gridlist"ID"0.19)
guiGridListAddColumn(wm.gridlist"Model"0.19)
guiGridListAddColumn(wm.gridlist"Paliwo (L)"0.19)
guiGridListAddColumn(wm.gridlist"Przebieg (KM)"0.19)
guiGridListAddColumn(wm.gridlist"Ostatni Kierowca"0.19)
guiGridListAddColumn(wm.gridlist"Pojemno??"0.19)
guiSetVisible(wm.gridlistfalse)
guiSetAlpha(wm.gridlist0.8)
guiSetFont(wm.gridlist"default-bold-small")
--guiSetProperty(wm.gridlist"NormalTextColour""FFFF0000")


addEvent("onParkingGetVehicles"true)
addEventHandler("onParkingGetVehicles"root, function(result,id)
    guiGridListClear(wm.gridlist)
    if not result then return end
    for i,v in pairs(result) do
        if v["mk1"] == "false" then
        v["mk1"] = "NIE"
        else
        v["mk1"] = "TAK"
        end
        local row=guiGridListAddRow(wm.gridlist)
        if przechowalnie[id][3][getVehicleType(v["model"])] then
        guiGridListSetItemText(wm.gridlistrow1v["id"], falsefalse)
        guiGridListSetItemText(wm.gridlistrow2changeName(getVehicleNameFromModel(v["model"])), falsefalse)
        guiGridListSetItemText(wm.gridlistrow3v["fuel"], falsefalse)
        guiGridListSetItemText(wm.gridlistrow4v["mileage"], falsefalse)
        guiGridListSetItemText(wm.gridlistrow5v["driver"]:gsub("#%x%x%x%x%x%x",""), falsefalse)
        --guiGridListSetItemColor(wm.gridlistrow50122255 )
        end
    end
end)

addEventHandler("onClientMarkerHit"root, function(el,md)
    local id getElementData(source,"przecho:id")
    if not id then return end
    if el~=localPlayer then return end
    if isPedInVehicle(elthen return end
    if guiGetVisible(wm.gridlist) == false then
        showCursor(true)
        guiSetVisible(wm.gridlist,true)
        if przecho == false then
        addEventHandler("onClientRender",root,gui)
        przecho true
        triggerServerEvent("onParkingGetRekords"root,id)
        ID_PRZECHO_DO_JAKIEJ_WLAZLES id
        --etCameraMatrix(-2056.26468.7738.49, -2048.08467.7335.17)
    end
    end
end)

addEventHandler("onClientClick"root, function(btnstate)
    if btn == "left" and state == "down" then
    if przecho == true then
    if mysz(718*w624*h210*w78*hthen
        if guiGetVisible(wm.gridlist) == true then
            showCursor(false)
            guiSetVisible(wm.gridlist,false)
            removeEventHandler("onClientRender",root,gui)
            przecho false
            setCameraTarget(localPlayerlocalPlayer)
        end
    end
    if przecho == true then
    if mysz(352*w624*h210*w78*hthen
        local selectedRow=guiGridListGetSelectedItem(wm.gridlist) or -1
        if selectedRow 0 then return end
        local vehicles=getElementsWithinColShape(przechowalnie[ID_PRZECHO_DO_JAKIEJ_WLAZLES][5],"vehicle")
        if #vehicles > 0 then
            triggerEvent('onClientAddNotification'localPlayer'Miejsce jest zastawione, nie mo?esz wyci?gn??\npojazdu.''error')
            return
        end
        local id=guiGridListGetItemText(wm.gridlistselectedRow1)
        local register=guiGridListGetItemText(wm.gridlistselectedRow3)
        if register == "NIE" then
        outputChatBox("*Zarejestruj pojazd w urz?dzie! Jego ID to "..id,255,0,0)
        return end
        guiGridListRemoveRow(wm.gridlistselectedRow)
        triggerServerEvent("onParkingVehicleSpawn"localPlayertonumber(id),przechowalnie[ID_PRZECHO_DO_JAKIEJ_WLAZLES][6])
    end
    end
    end
    end
end)


function gui()
        dxDrawImage(315*w313*h650*w400*h"przechowalnia-psrpg.png"000tocolor(255255255255), false)
end

function render1()
dxDrawText(" Nie ma miejsca aby wyci?gn?? pojazd"screenW 0.3656screenH 0.1553screenW 0.6273screenH 0.3193tocolor(0122255255), 1.50"pricedown""center""center"falsefalsefalsefalsefalse)
end

function renderstop1()
removeEventHandler("onClientRender",root,render1)
end

c.lua

[ Dodano: 2020-05-28, 18:00 ]
TheSebaPL, no i co?

Komentarz Wilq dodany 2020-05-28, 21:41Stosuj bbcode [lua] na przyszłość
Ostatnio zmieniony przez Wilq 2020-05-28, 21:40, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Tagi: pojemnosci :: silników
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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