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

Wysłany: 2018-08-24, 18:10


kajetan254







Wiek: 28
Na forum: 3184 dni
Posty: 42
Nick w MP: Kajetan

Piwa: 93

Respekt: 60

Tak jak w temacie nie dzia?a mi rh1 na pacze Pys 3.0
Kolumna w tabelce jest, w debugu brak b??d?w
Wiem, ?e ten temat by? poruszany na forum wiele razy ale nigdy ?aden nie zosta? rozwi?zany.

Kod:

Client
addEventHandler("onClientResourceStart"resourceRoot,
    function()
        rh guiCreateWindow(0.000.930.140.07"Gwintowane zawieszenie"true)
        guiWindowSetSizable(rhfalse)
        guiWindowSetMovable(rhfalse)

        gora guiCreateButton(0.050.460.430.36"Podwy?sz"truerh)
        dol guiCreateButton(0.540.460.410.36"Obni?"truerh)    
        guiSetVisible(rhfalse)
    end
)
addEventHandler("onClientGUIClick"resourceRoot, function(btn)
local veh getPedOccupiedVehicle(localPlayer)
if source == gora then
    triggerServerEvent("rh:p"rootveh)
elseif source == dol then
    triggerServerEvent("rh:o"rootveh)
end
end)

function patch()
local veh getPedOccupiedVehicle(localPlayer)
    if not veh then
        if rh and ( guiGetVisible rh ) == true then
        guiSetVisible(rhfalse)
        end
    end
end
addEventHandler("onClientRender"rootpatch)

function show()
guiSetVisible(rhtrue)
end
addEvent"rhshow"true )
addEventHandler"rhshow"rootshow )
fileDelete("c.lua")



Server
function getVehicleHandlingProperty elementproperty )
    if isElement element ) and getElementType element ) == "vehicle" and type property ) == "string" then
        local handlingTable getVehicleHandling element ) 
        local value handlingTable[property] 
 
        if value then
            return value
        end
    end
 
    return false
end

function o(c)
if c then
        local gora getElementData(c"rh:up") or 0
        local s=getVehicleHandlingProperty(c,"suspensionForceLevel")
        if tonumber(gora) == 4 then outputChatBox("Osi?gn??e? limit regulacji zawieszenia!"getVehicleController(c), 255255255cancelEvent() return end
        setVehicleHandling(c,"suspensionForceLevel",tonumber(s) - 0.19)
        setElementData(c"rh:up"gora+1)
        outputChatBox("Auto zosta?o obni?one.",getVehicleController(c),255,255,255,true)
    end
end
addEvent("rh:o"true)
addEventHandler("rh:o"rooto)
function p(c)
    if c then
        local gora getElementData(c"rh:up") or 0
        local s=getVehicleHandlingProperty(c,"suspensionForceLevel")
        if tonumber(gora) == -8 then outputChatBox("Osi?gn??e? limit regulacji zawieszenia!"getVehicleController(c), 255255255cancelEvent() return end
        setVehicleHandling(c,"suspensionForceLevel",tonumber(s) + 0.19)
        setElementData(c"rh:up"gora-1)
        outputChatBox("Auto zosta?o podwy?szone.",getVehicleController(c),255,255,255,true)
    end
end
addEvent("rh:p"true)
addEventHandler("rh:p"rootp)

addEventHandler("onPlayerVehicleEnter"root,
function(carseat)
if seat ~= 0 then return end
if getElementData(car"vehicle:id") and getElementData(source"player:uid"then
local qr exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND rh=?",getElementData(car"vehicle:id"), "1")
if #qr == 1 then
triggerClientEvent(source,"rhshow"root)
end
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-24, 18:38


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

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

Poka? zrzut ekranu z tabeli z pojazdami (chodzi mi g??wnie o kolumn? rh)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-24, 20:09


kajetan254







Wiek: 28
Na forum: 3184 dni
Posty: 42
Nick w MP: Kajetan

Piwa: 93

Respekt: 60

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-24, 21:33


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

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

poka? jaki? rekord (linijk?) z tej tabeli w kt?rej dany pojazd posiada rh ustawione na 1

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-25, 09:47


kajetan254







Wiek: 28
Na forum: 3184 dni
Posty: 42
Nick w MP: Kajetan

Piwa: 93

Respekt: 60

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-25, 10:24


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

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

Spr?buj taki kod, kt?ry po wej?ciu do pojazdu wy?wietla na czacie informacj?, ?e pojazd ma ustawione rh na 1:
addEventHandler("onPlayerVehicleEnter"root,
function(carseat)
if seat ~= 0 then return end
if getElementData(car"vehicle:id") and getElementData(source"player:uid"then
local qr exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND rh=?",getElementData(car"vehicle:id"), "1")
if #qr == 1 then
outputChatBox("ma wpisane RH"source)
triggerClientEvent(source,"rhshow"root)
end
end
end)


Je?eli wy?wietli si? informacja to b??d le?y z triggerClientEvent, je?eli nie, to jaki? warunek si? nie spe?nia

Postaw piwo autorowi tego posta
 

 
Tagi: pys :: 3.0 :: rh1 :: 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 » Pys 3.0 - rh1 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