Wysłany: 2019-04-25, 12:51
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Witam ot?? chcia?bym zamiast cgui by?o gui w dx.
Tylko nie umiem tego zrobi? jedyne co ogarniam to to by tam wstawi?, lecz wi?cej nic
function gui ()
-- tutaj gui z guieditora
end
kod c.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" , root , show )
fileDelete ( "c.lua" )
s.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.19 )
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 [ 'ogrpg-db' ]: dbGet ( "SELECT * FROM ogrpg_vehicles WHERE id=? AND rh=?" , getElementData ( car , "vehicle:id" ), "1" )
if #qr == 1 then
triggerClientEvent ( source , "rhshow" , root )
end
end
end )
Prosi?bym o pomoc.
Wysłany: 2019-04-25, 13:08
AmaMa.
AmaMa.#3768
Wiek: 25 Na forum: 3208 dni Posty: 182
Nick w MP: AmaMa.
Piwa : 1825
Więcej informacji znajdziesz w Wikipedii MTA: dxDrawImage
Więcej informacji znajdziesz w Wikipedii MTA: dxDrawText
Więcej informacji znajdziesz w Wikipedii MTA: dxDrawLine
Wysłany: 2019-04-25, 13:45
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
AmaMa gui umiem zrobi? ale nie umiem go podpi?? pod rh
Wysłany: 2019-04-25, 13:50
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Je?li chcesz obs?u?y? klikni?cia myszk? w elementy DirectX u?yj eventu:
lub funkcji
Więcej informacji znajdziesz w Wikipedii MTA: getKeyState
Więcej szczegółów
Wystawiono 1 piw(a):Pyrek24
Wysłany: 2019-04-25, 19:11
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Dzi?kuje a zrobi?by? mi z tym linijk??
Wysłany: 2019-04-25, 19:30
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Tworzysz event, sprawdzasz czy kursor jest w danej pozycji.
Je?li wynik jest pozytywny wykonujesz akcj?.
Nic trudnego.
Wysłany: 2019-04-26, 07:25
AmaMa.
AmaMa.#3768
Wiek: 25 Na forum: 3208 dni Posty: 182
Nick w MP: AmaMa.
Piwa : 1825
Więcej szczegółów
Wystawiono 1 piw(a):Pyrek24
Wysłany: 2019-04-26, 13:06
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Dzi?kuje <3 Temat do zamkni?cia.
Tagi: edycja :: gui
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: