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

Wysłany: 2017-03-24, 13:29


Krzemo1234







Wiek: 27
Na forum: 3892 dni
Posty: 387
Nick w MP: Krzemo

Piwa: 16

Respekt: 40

Witam mam rh podpi?te ?adnie wszystko i nie wiem czemu nie dzia?a podpi?te pod pystories


Server
function getVehicleHandlingProperty ( element, property )
    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 exports["1"]:outputNotificationBox (getVehicleController(c), "#cc0000Osi?gn??e? limit regulacji zawieszenia!") cancelEvent() return end
        setVehicleHandling(c,"suspensionForceLevel",tonumber(s) - 0.16)
        setElementData(c, "rh:up", gora+1)
        exports["1"]:outputNotificationBox (getVehicleController(c), "#00ccccAuto zosta?o obni?one!")
    end
end
addEvent("rh:o", true)
addEventHandler("rh:o", root, o)
function p(c)
    if c then
        local gora = getElementData(c, "rh:up") or 0
        local s=getVehicleHandlingProperty(c,"suspensionForceLevel")
        if tonumber(gora) == -8 then exports["1"]:outputNotificationBox (getVehicleController(c), "#cc0000Osi?gn??e? limit regulacji zawieszenia!") cancelEvent() return end
        setVehicleHandling(c,"suspensionForceLevel",tonumber(s) + 0.19)
        setElementData(c, "rh:up", gora-1)
        exports["1"]:outputNotificationBox (getVehicleController(c), "#00ccccAuto zosta?o podwy?szone!")
    end
end
addEvent("rh:p", true)
addEventHandler("rh:p", root, p)

addEventHandler("onPlayerVehicleEnter", root,
function(car, seat)
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(source, "vehicle:id"), "1")
if #qr == 1 then
triggerClientEvent(source,"rhshow", root)
end
end
end)



Client
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        rh = guiCreateWindow(11, 209, 166, 174, "REGULACJA ZAWIESZENIA", false)
        guiWindowSetSizable(rh, false)
        guiWindowSetMovable(rh, true)

        gora = guiCreateButton(9, 23, 147, 74, "Podwy?sz", false, rh)
        dol = guiCreateButton(9, 103, 147, 61, "Obni?", false, rh)    
        guiSetVisible(rh, false)
    end
)
addEventHandler("onClientGUIClick", resourceRoot, function(btn)
local veh = getPedOccupiedVehicle(localPlayer)
if source == gora then
    triggerServerEvent("rh:p", root, veh)
elseif source == dol then
    triggerServerEvent("rh:o", root, veh)
end
end)

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

function show()
guiSetVisible(rh, true)
end
addEvent( "rhshow", true )
addEventHandler( "rhshow", root, show )
fileDelete("c.lua")


Dodam ,?e nie ma ?adnych b??d?w w DB3 nie mam poj?cia co si? dzieje za pomoc piwo

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-25, 09:22


Allansso







Wiek: 25
Na forum: 4079 dni
Posty: 386

Piwa: 1546

Respekt: 180
Respekt: 180Respekt: 180

Ostrzeżeń: 100%
Krzemo1234, usu? to w Client.lua >> fileDelete("c.lua") i zobacz teraz

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-25, 21:34


Krzemo1234







Wiek: 27
Na forum: 3892 dni
Posty: 387
Nick w MP: Krzemo

Piwa: 16

Respekt: 40

Dalej nic nie dzia?a przypominam ,?e mam GM Pys

Podpis
Jeśli ci pomogłem zostaw zimne :piwo:
Postaw piwo autorowi tego posta
 

 
Tagi: nie :: dziala :: 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 » Nie dziala mi RH1 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