gora = guiCreateButton(0.05, 0.46, 0.43, 0.36, "Podwy?sz", true, rh)
dol = guiCreateButton(0.54, 0.46, 0.41, 0.36, "Obni?", true, 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")
s.lua
function getVehicleHandlingProperty ( element, property )
if isElement ( element ) and getElementType ( element ) == "vehicle" and type ( property ) == "string&q...
Na wst?pie mowie, ze zaden ze mnie luamaster XD Bawie sie w to 3 dni dokladnie... Ogarnalem se paczke PSSM'a i postanowi?em modyfickowac MK1. Uda?o si? zrobic dzia?ajace MK2, MK3. Teraz moje pytanie? jak ulepi? RH1 XD? bo to co ja ulepilem to elegancko dziala hud, ale funkcja jest do ** kompletnie. Jakie? wytyczne podstaw na co zwrocic uwage? Moje wypociny wrzuce na dole.
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:
[lua]
addEventHandler("onClientResourceStart", resourceRoot,
function()
rh = guiCreateWindow(0.00, 0.93, 0.14, 0.07, "Gwintowane zawieszenie", true)
guiWindowSetSizable(rh, false)
guiWindowSetMovable(rh, false)
gora = guiCreateButton(0.05, 0.46, 0.43, 0.36, "Podwy?sz", true, rh)
dol = guiCreateButton(0.54, 0.46, 0.41, 0.36, "Obni?", true, 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", roo...
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.
gora = guiCreateButton(0.05, 0.46, 0.43, 0.36, "Podwy?sz", true, rh)
dol = guiCreateButton(0.54, 0.46, 0.41, 0.36, "Obni?", true, 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")[/lua]
Server
[lua]function getVehicleHandlingProperty ( element, property )
if isElement ( element ) and get...
[b]Witam, mam ma?y problem mam sobie skrypt na gz chcia?bym ?eby po wjechaniu w marker i po wpisaniu "/zamontuj" odje?o graczowi 1000 PLN i da?o mu gz (rh1)
Da rade kto? mi to zwyk?y kod pod gz tak przerobi? xd ? lub wys?a? inny skrypt tak zrobiony xd ?[/b]
[code] 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 outputChatBox("Osi?gn??e? limit regulacji zawieszenia!", getVehicleController(c), 255, 255, 255) cancelEvent() return end
setVehicleHandling(c,"suspensionForceLevel",tonumber(s) - 0.19)
setElementData(c, "rh:up", gora+1)
outputChatBox("Obni?y?e? auto k****",getVehicleController(c),255,255,255,true)
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")
...
Witam mam rh podpi?te ?adnie wszystko i nie wiem czemu nie dzia?a podpi?te pod pystories
Server
[lua]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? lim...