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

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


Barto0o







Wiek: 26
Na forum: 2215 dni
Posty: 1



Respekt: 50

Cze??! Wiem, ?e temat rzeka, ale ostatnio postanowi?em si? pobawi? paczk? wymienion? w temacie. Kilka rzeczy ju? zrobi?em, ale m?czy mnie to niedzia?aj?ce RH1. Montuje si? normalnie, informacja na czacie si? pojawia, ale panelu ani nic takiego nie ma.

Inne tematy nie pomog?y z tego powodu, ?e jestem zielony w tym j?zyku i ma?o co jeszcze rozumiem. :>
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:o") or 0
        local s=getVehicleHandlingProperty(c,"suspensionForceLevel")
        if tonumber(gora) == 4 then outputChatBox("* Osi?gn??e?(a?) limit regulacji zawieszenia !"getVehicleController(c), 255255255cancelEvent() return end
        setVehicleHandling(c,"suspensionForceLevel",tonumber(s) - 0.24)
        setElementData(c"rh:o"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:p") or 0
        local s=getVehicleHandlingProperty(c,"suspensionForceLevel")
        if tonumber(gora) == -8 then outputChatBox("* Osi?gn??e?(a?) limit regulacji zawieszenia !"getVehicleController(c), 255255255cancelEvent() return end
        setVehicleHandling(c,"suspensionForceLevel",tonumber(s) + 0.24)
        setElementData(c"rh:p"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
    outputChatBox("Pomy?lnie zaprogramowano RH1"source)
triggerClientEvent(source,"rhshow"root)
end
end
end)

Z g?ry dzi?kuj? za pomoc, stawiam piwo! :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-16, 02:09


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

W jaki spos?b chcesz wy?wietli? interfejs RH1 je?li nigdzie w kodzie nie zosta? u?yty ?aden event, kt?ry m?g?by go wy?wietli??

Postaw piwo autorowi tego posta
 

 
Tagi: pystories :: 3.0 :: rh1
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » PYSTORIES 3.0 RH1 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