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

Wysłany: 2016-08-05, 08:35


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3869 dni
Posty: 477
Nick w MP: Rodzaje

Piwa: 877

Respekt: 70,5

Ostrzeżeń: 40%
Elo , ju? m?wi? co mnie dr?czy .
W Miejsce X gdzie wy?wietla si? GUI i po nacisi?ciu Buttona akceptuj , zmienia gracza pozycje w miejsce Y , tylko ,?e jak gracz wraca w miejsce Y , wy?wietla si? graczowi gui kt?ry jest w miejscu Y ,[To podkre?lone to m?j problem] Czyli , chcia?bym aby w miejscu Y , nie wy?wietla?o si? gui , nie chcia?em nic grzeba? czy usuwa? bo p??niej bym pogorszy? spraw? dlatego zwr?ci?em si? do was o pomoc .

addEventHandler("onClientResourceStart", root, function()
guiSetVisible(napad, false)
end)
napad = guiCreateWindow(438, 185, 467, 306, "Potwied? Napad na Bank", false)
        guiWindowSetSizable(napad, false)
        guiSetAlpha(napad, 0.58)
        guiSetProperty(napad, "CaptionColour", "FFFEFEFE")
        buttonEmpty = guiCreateButton(194, 129, 15, 15, "", false, napad)
        buttonAccept = guiCreateButton(20, 233, 119, 52, "Akceptuj?", false, napad)
        buttonRefuse = guiCreateButton(317, 234, 140, 61, "Odrzu?", false, napad)    

local marker = createMarker(1821.38318, -1683.33215, 13.38281 , "cylinder")

addEventHandler("onClientMarkerHit", marker, function(el, md)
if el ~= localPlayer then return end
if not md then return end
guiSetVisible(napad, true)
showCursor(true, false)
end)

addEventHandler("onClientGUIClick", root, function(btn, state)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napad, false)
      showCursor(false)
   end
 end
end)

function getElementsWithinMarker(marker)
    if (not isElement(marker) or getElementType(marker) ~= "marker") then
        return false
    end
    local markerColShape = getElementColShape(marker)
    local elements = getElementsWithinColShape(markerColShape)
    return elements
end

addEventHandler( "onClientGUIClick", buttonAccept, 
function (btn, state)
    if source == buttonAccept then
        if btn == "left" and state == "up" then
        local element = getElementsWithinMarker(marker)
            for i, v in ipairs (element) do
             setElementPosition(v,314.5, 193.30000305176, 18.700000762939)
            end
        guiSetVisible(napad, false)
        showCursor(false)
        end
    end
end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 13:03


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4290 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8


addEventHandler("onClientResourceStart", root, function()
guiSetVisible(napad, false)
end)
napad = guiCreateWindow(438, 185, 467, 306, "Potwied? Napad na Bank", false)
        guiWindowSetSizable(napad, false)
        guiSetAlpha(napad, 0.58)
        guiSetProperty(napad, "CaptionColour", "FFFEFEFE")
        buttonEmpty = guiCreateButton(194, 129, 15, 15, "", false, napad)
        buttonAccept = guiCreateButton(20, 233, 119, 52, "Akceptuj?", false, napad)
        buttonRefuse = guiCreateButton(317, 234, 140, 61, "Odrzu?", false, napad)    

local marker = createMarker(1821.38318, -1683.33215, 13.38281 , "cylinder")

addEventHandler("onClientMarkerHit", marker, function(el, md)
if el ~= localPlayer then return end
if not md then return end
guiSetVisible(napad, true)
showCursor(true, false)
end)

addEventHandler("onClientGUIClick", root, function(btn, state)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napad, false)
      showCursor(false)
   end
 end
end)

function getElementsWithinMarker(marker)
    if (not isElement(marker) or getElementType(marker) ~= "marker") then
        return false
    end
    local markerColShape = getElementColShape(marker)
    local elements = getElementsWithinColShape(markerColShape)
    return elements
end

addEventHandler( "onClientGUIClick", buttonAccept, 
function (btn, state)
    if source == buttonAccept then
        if btn == "left" and state == "up" then
        local element = getElementsWithinMarker(marker)
            for i, v in ipairs (element) do
             local poz = setElementPosition(v,314.5, 193.30000305176, 18.700000762939)
           local gp = getElementPosition(v)
            end
        guiSetVisible(napad, false)
        showCursor(false)
  if gp == poz then return end
        end
    end
end
)


mo?e co? takiego

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 13:33


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3869 dni
Posty: 477
Nick w MP: Rodzaje

Piwa: 877

Respekt: 70,5

Ostrzeżeń: 40%
tak , rozwi?za?e? problem tylko teraz nie zmienia pozycji gracza button Akcpetuj .

Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 13:39


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4290 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8

Jakie? b??dy /debugscript 3 ?

[ Dodano: 2016-08-05, 13:43 ]
Zobacz tak

function accept()
if source == buttonAccept then
local element = getElementsWithinMarker(marker)
for i,v in ipairs(element) do
local poz = setElementPosition(v, 314.5, 193.30000305176, 18.700000762939)
local gp = getElementPosition(v)
end
if gp == poz then
if guiGetVisible(napad) == true then
guiSetVisibile(napad, false)
showCursor(false)
end
end
end
end
addEventHandler("onClientGUIClick",root,accept)


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Ostatnio zmieniony przez marcin778 2016-08-05, 13:46, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 13:45


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

MartinPanZycia, ile by b?dziesz robi? jeszcze tych temat?w ?
na wiki wszystko pisz? i s? przyk?ady, jak powiano si? stosowa? event czy funkcj?.
A co do kodu:
addEventHandler("onClientResourceStart", root, function()
    napad = guiCreateWindow(438, 185, 467, 306, "Potwied? Napad na Bank", false)
    guiSetVisible(napad, false)
    guiWindowSetSizable(napad, false)
    guiSetAlpha(napad, 0.58)
    guiSetProperty(napad, "CaptionColour", "FFFEFEFE")
    buttonEmpty = guiCreateButton(194, 129, 15, 15, "", false, napad)
    buttonAccept = guiCreateButton(20, 233, 119, 52, "Akceptuj?", false, napad)
    buttonRefuse = guiCreateButton(317, 234, 140, 61, "Odrzu?", false, napad)    
end)

local marker = createMarker(1821.38318, -1683.33215, 13.38281 , "cylinder")

addEventHandler("onClientMarkerHit", marker, 
    function(hitElement, md)
    if hitElement ~= localPlayer then return end
    if not md then return end
    if source ~= marker then return end
    guiSetVisible(napad, true)
    showCursor(true, false)
end)

addEventHandler("onClientGUIClick", root, function(btn, state)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napad, false)
      showCursor(false)
   end
 end
end)

function getElementsWithinMarker(marker)
    if (not isElement(marker) or getElementType(marker) ~= "marker") then
        return false
    end
    local markerColShape = getElementColShape(marker)
    local elements = getElementsWithinColShape(markerColShape)
    return elements
end

addEventHandler( "onClientGUIClick", buttonAccept, 
function (btn, state)
    if source == buttonAccept then
        if btn == "left" and state == "up" then
        local element = getElementsWithinMarker(marker)
            for i, v in ipairs (element) do
             setElementPosition(v,314.5, 193.30000305176, 18.700000762939)
            end
        guiSetVisible(napad, false)
        showCursor(false)
        end
    end
end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 14:14


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3869 dni
Posty: 477
Nick w MP: Rodzaje

Piwa: 877

Respekt: 70,5

Ostrzeżeń: 40%
marcin778,

debug script

Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 14:17


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4290 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8

MartinPanZycia, Nieda rady jakiego? wi?kszego obrazka na tym nic nie wida? :/

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 14:28


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3869 dni
Posty: 477
Nick w MP: Rodzaje

Piwa: 877

Respekt: 70,5

Ostrzeżeń: 40%
marcin778, zaraz powi?ksze


kliknij to ci si? powi?kszy , zrobi?em w lepszej jako?ci

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 14:35


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4290 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8

function accept()
if source == buttonAccept then
local element = getElementsWithinMarker(marker)
for i,v in ipairs(element) do
local poz = setElementPosition(v, 314.5, 193.30000305176, 18.700000762939)
local gp = getElementPosition(v)
end
if gp == poz then
if guiGetVisible(napad) == true then
guiSetVisible(napad, false)
showCursor(false)
end
end
end
end
addEventHandler("onClientGUIClick",root,accept)


PS: Podaj linijke 45 tutaj

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 16:05


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3869 dni
Posty: 477
Nick w MP: Rodzaje

Piwa: 877

Respekt: 70,5

Ostrzeżeń: 40%
ok thx dzia?a , bardzo ci dzi?kuj? , i przepraszam za k?opot .

Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Postaw piwo autorowi tego posta
 

 
Tagi: piąte :: spotkanie :: 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 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