Wysłany: 2018-05-12, 08:59
adisonboss
Wiek: 23 Na forum: 3331 dni Posty: 237
Piwa : 6
Witam mam problem. Nie wiem jak zrobi? przycisk "anuluj". Za pomoc daje i . Tak wygl?da kod
x , y = guiGetScreenSize ()
button = guiCreateButton ( 627 / 1440 * x , 510 / 900 * y , 209 / 1440 * x , 123 / 900 * y , "Uruchom Dzwonki" , false )
guiSetProperty ( button , "NormalTextColour" , "FFAAAAAA" )
guiSetVisible ( button , false )
function drawSyrena ()
dxDrawRectangle ( 600 / 1440 * x , 278 / 900 * y , 261 / 1440 * x , 372 / 900 * y , tocolor ( 0 , 0 , 33 , 184 ), false )
dxDrawRectangle ( 590 / 1440 * x , 265 / 900 * y , 289 / 1440 * x , 16 / 900 * y , tocolor ( 187 , 0 , 0 , 255 ), false )
dxDrawText ( "Dzwonki" , 616 / 1440 * x , 346 / 900 * y , 851 / 1440 * x , 445 / 900 * y , tocolor ( 255 , 255 , 255 , 255 ), 3.00 , "default" , "center" , "center" , false , false , false , false , false )
end
addEvent ( "showGUI" , true )
addEventHandler ( "showGUI" , getRootElement (), function()
guiSetVisible ( button , true )
addEventHandler ( "onClientRender" , getRootElement (), drawSyrena )
showCursor ( true )
end )
addEventHandler ( "onClientGUIClick" , button , function()
triggerServerEvent ( "playSyrena_sc" , getLocalPlayer ())
guiSetVisible ( button , false )
removeEventHandler ( "onClientRender" , getRootElement (), drawSyrena )
showCursor ( false )
end , false )
function Closegui ( button , state )
if panel and button == "left" and state == "down" then
if cursorPosition ( screenW * 0.5688 , screenH * 0.6094 , screenW * 0.6501 , screenH * 0.6549 ) then
removeEventHandler ( "onClientRender" , root , paneldx )
panel = false
showCursor ( false )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), Closegui )
addEvent ( "playSyrena_cc" , true )
addEventHandler ( "playSyrena_cc" , getRootElement (), function()
local syrena = playSound3D ( "pik.wav" ,- 2305 , - 174 , 42.5 , true )
setSoundMaxDistance ( syrena , 150 )
setTimer ( stopSound , 25 * 1000 , 1 , syrena )
end )
Wysłany: 2018-05-12, 09:54
TeeNekk
Cienzaruwka :v
Wiek: 23 Na forum: 3210 dni Posty: 264
Nick w MP: TeeNekk.
Piwa : 919
function Closegui ( button , state )
if panel and button == "left" and state == "down" then
if cursorPosition ( 590 / 1440 * x , 265 / 900 * y , 289 / 1440 * x , 16 / 900 * y ) then -- podmie ? tu pozycje , na pozycje buttona
removeEventHandler ( "onClientRender" , getRootElement (), drawSyrena )
panel = false
showCursor ( false )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), Closegui )
Podpis
Pomogłem Ci
[you]
? Może zostawiłbyś za to piwko, lub respekt? Dzięki!
Mój projekt:
?
Wysłany: 2018-05-12, 17:04
adisonboss
Wiek: 23 Na forum: 3331 dni Posty: 237
Piwa : 6
Nadal nie dzia?a
function Closegui ( button , state )
if panel and button == "left" and state == "down" then
if cursorPosition ( screenW * 0.5688 , screenH * 0.6094 , screenW * 0.6501 , screenH * 0.6549 ) then
removeEventHandler ( "onClientRender" , getRootElement (), drawSyrena )
panel = false
showCursor ( false )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), Closegui )
Wysłany: 2018-05-12, 17:09
Hades.
Łiiiiiiiiii
Wiek: 22 Na forum: 4699 dni Posty: 372
Nick w MP: Hades
Piwa : 3214
function Closegui ( button , state )
if panel and button == "left" and state == "down" then
if cursorPosition ( screenW * 0.5688 , screenH * 0.6094 , screenW * 0.6501 , screenH * 0.6549 ) then -- sk ? d te kordy s ??
removeEventHandler ( "onClientRender" , root , paneldx )
panel = false
showCursor ( false )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), Closegui )
Sk?d wytrzasn??e? te kordy w if cursorPosition, je?li ich nie widze nigdzie w kodzie.
Więcej szczegółów
Wystawiono 1 piw(a):Mezo.
Wysłany: 2018-05-12, 17:15
adisonboss
Wiek: 23 Na forum: 3331 dni Posty: 237
Piwa : 6
To sk?d mam wzi?? w?asne ?
Gui w og?le nie ogarniam
Wysłany: 2018-05-12, 17:18
Hades.
Łiiiiiiiiii
Wiek: 22 Na forum: 4699 dni Posty: 372
Nick w MP: Hades
Piwa : 3214
function Closegui ( button , state )
if panel and button == "left" and state == "down" then
if cursorPosition ( 590 / 1440 * x , 265 / 900 * y , 289 / 1440 * x , 16 / 900 * y ) then
removeEventHandler ( "onClientRender" , root , paneldx )
panel = false
showCursor ( false )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), Closegui )
zobacz teraz
Wysłany: 2018-05-12, 17:21
adisonboss
Wiek: 23 Na forum: 3331 dni Posty: 237
Piwa : 6
Nadal nic, a mo?e musz? stworzy? taki przycisk jak na w??czanie syreny ?
Wysłany: 2018-05-12, 17:21
Hades.
Łiiiiiiiiii
Wiek: 22 Na forum: 4699 dni Posty: 372
Nick w MP: Hades
Piwa : 3214
?atwiej ci b?dzie dorobic przycisk za pomoc? dxDrawRectangle.
Wysłany: 2018-05-12, 17:23
adisonboss
Wiek: 23 Na forum: 3331 dni Posty: 237
Piwa : 6
A jest mo?e do tego jaki? poradnik bo kompletnie nie umiem Gui. Pierwszy raz mam z tym styczno??
Wysłany: 2018-05-12, 17:25
Hades.
Łiiiiiiiiii
Wiek: 22 Na forum: 4699 dni Posty: 372
Nick w MP: Hades
Piwa : 3214
A moge wiedzie? za pomoc? czego otwierasz gui? Komenda, wej?cie w marker czy jak ?
Wysłany: 2018-05-12, 17:25
adisonboss
Wiek: 23 Na forum: 3331 dni Posty: 237
Piwa : 6
Wej?cie w marker i mam uruchom syrene OSP i chc? przycisk anuluj
Wysłany: 2018-05-12, 17:29
Hades.
Łiiiiiiiiii
Wiek: 22 Na forum: 4699 dni Posty: 372
Nick w MP: Hades
Piwa : 3214
Daj mi skrawek kodu z funkcj? addEventHandler("onMarkerHit"
Wysłany: 2018-05-12, 17:32
adisonboss
Wiek: 23 Na forum: 3331 dni Posty: 237
Piwa : 6
To ?
local muker = createMarker ( - 2304 , - 178 , 41.5 , "cylinder" , 1.0 , 0 , 0 , 0 , 170 )
function marker ( el , md )
if getElementType ( el )~= "player" then return end
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( el )), aclGetGroup ( "PSP" )) then
triggerClientEvent ( el , "showGUI" , el )
end
end
addEventHandler ( "onMarkerHit" , muker , marker )
Wysłany: 2018-05-12, 17:34
Hades.
Łiiiiiiiiii
Wiek: 22 Na forum: 4699 dni Posty: 372
Nick w MP: Hades
Piwa : 3214
Zamiast przycisku zrobi?em ci zamkni?cie panelu odrazu po wyj?ciu z markera.
Do strony servera dodaj:
addEventHandler ( "onMarkerLeave" , marker , function( el , md )
if getElementType ( el ) ~= "player" then return end
triggerClientEvent ( el , "hideGUI" , el )
end )
A strone client'a daj tak?:
x , y = guiGetScreenSize ()
button = guiCreateButton ( 627 / 1440 * x , 510 / 900 * y , 209 / 1440 * x , 123 / 900 * y , "Uruchom Dzwonki" , false )
guiSetProperty ( button , "NormalTextColour" , "FFAAAAAA" )
guiSetVisible ( button , false )
function drawSyrena ()
dxDrawRectangle ( 600 / 1440 * x , 278 / 900 * y , 261 / 1440 * x , 372 / 900 * y , tocolor ( 0 , 0 , 33 , 184 ), false )
dxDrawRectangle ( 590 / 1440 * x , 265 / 900 * y , 289 / 1440 * x , 16 / 900 * y , tocolor ( 187 , 0 , 0 , 255 ), false )
dxDrawText ( "Dzwonki" , 616 / 1440 * x , 346 / 900 * y , 851 / 1440 * x , 445 / 900 * y , tocolor ( 255 , 255 , 255 , 255 ), 3.00 , "default" , "center" , "center" , false , false , false , false , false )
end
addEvent ( "showGUI" , true )
addEventHandler ( "showGUI" , getRootElement (), function()
guiSetVisible ( button , true )
addEventHandler ( "onClientRender" , getRootElement (), drawSyrena )
showCursor ( true , true )
end )
addEvent ( "hideGUI" , true )
addEventHandler ( "hideGUI" , getRootElement (), function()
guiSetVisible ( button , false )
removeEventHandler ( "onClientRender" , getRootElement (), drawSyrena )
showCursor ( false )
panel = false
end )
addEventHandler ( "onClientGUIClick" , button , function()
triggerServerEvent ( "playSyrena_sc" , getLocalPlayer ())
guiSetVisible ( button , false )
removeEventHandler ( "onClientRender" , getRootElement (), drawSyrena )
showCursor ( false )
end , false )
addEvent ( "playSyrena_cc" , true )
addEventHandler ( "playSyrena_cc" , getRootElement (), function()
local syrena = playSound3D ( "pik.wav" ,- 2305 , - 174 , 42.5 , true )
setSoundMaxDistance ( syrena , 150 )
setTimer ( stopSound , 25 * 1000 , 1 , syrena )
end )
Wysłany: 2018-05-12, 17:43
adisonboss
Wiek: 23 Na forum: 3331 dni Posty: 237
Piwa : 6
Tagi: przycisk :: quotanulujquot :: gui
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: