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

Wysłany: 2018-05-12, 08:59


adisonboss







Wiek: 23
Na forum: 3473 dni
Posty: 237

Piwa: 6

Respekt: 50

Witam mam problem. Nie wiem jak zrobi? przycisk "anuluj". Za pomoc daje :piwo: i R* . 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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-12, 09:54


TeeNekk

Cienzaruwka :v






Wiek: 23
Na forum: 3351 dni
Posty: 264
Nick w MP: TeeNekk.

Piwa: 919

Respekt: 110,5
Respekt: 110,5

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
? Może zostawiłbyś za to piwko, lub respekt? Dzięki!
Mój projekt:
?
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-12, 17:04


adisonboss







Wiek: 23
Na forum: 3473 dni
Posty: 237

Piwa: 6

Respekt: 50

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) 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-12, 17:09


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8


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.

Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Mezo.
Wysłany: 2018-05-12, 17:15


adisonboss







Wiek: 23
Na forum: 3473 dni
Posty: 237

Piwa: 6

Respekt: 50

To sk?d mam wzi?? w?asne ?
Gui w og?le nie ogarniam

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-12, 17:18


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8


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

Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-12, 17:21


adisonboss







Wiek: 23
Na forum: 3473 dni
Posty: 237

Piwa: 6

Respekt: 50

Nadal nic, a mo?e musz? stworzy? taki przycisk jak na w??czanie syreny ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-12, 17:21


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8

?atwiej ci b?dzie dorobic przycisk za pomoc? dxDrawRectangle.

Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-12, 17:23


adisonboss







Wiek: 23
Na forum: 3473 dni
Posty: 237

Piwa: 6

Respekt: 50

A jest mo?e do tego jaki? poradnik bo kompletnie nie umiem Gui. Pierwszy raz mam z tym styczno??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-12, 17:25


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8

A moge wiedzie? za pomoc? czego otwierasz gui? Komenda, wej?cie w marker czy jak ?

Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-12, 17:25


adisonboss







Wiek: 23
Na forum: 3473 dni
Posty: 237

Piwa: 6

Respekt: 50

Wej?cie w marker i mam uruchom syrene OSP i chc? przycisk anuluj

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-12, 17:29


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8

Daj mi skrawek kodu z funkcj? addEventHandler("onMarkerHit"

Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-12, 17:32


adisonboss







Wiek: 23
Na forum: 3473 dni
Posty: 237

Piwa: 6

Respekt: 50

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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-12, 17:34


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8

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)



Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-12, 17:43


adisonboss







Wiek: 23
Na forum: 3473 dni
Posty: 237

Piwa: 6

Respekt: 50

1. Tylko ?e ja nie mog? si? rusza? w markerze
2. Nie dzia?a i jest taki oto b??d https://imgur.com/a/DUWPX8f

Postaw piwo autorowi tego posta
 

 
Tagi: przycisk :: quotanulujquot :: gui
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Przycisk "anuluj" w gui 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