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: 3729 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

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(napadfalse)
end)
napad guiCreateWindow(438185467306"Potwied? Napad na Bank"false)
        guiWindowSetSizable(napadfalse)
        guiSetAlpha(napad0.58)
        guiSetProperty(napad"CaptionColour""FFFEFEFE")
        buttonEmpty guiCreateButton(1941291515""falsenapad)
        buttonAccept guiCreateButton(2023311952"Akceptuj?"falsenapad)
        buttonRefuse guiCreateButton(31723414061"Odrzu?"falsenapad)    

local marker createMarker(1821.38318, -1683.3321513.38281 "cylinder")

addEventHandler("onClientMarkerHit"marker, function(elmd)
if el ~= localPlayer then return end
if not md then return end
guiSetVisible(napadtrue)
showCursor(truefalse)
end)

addEventHandler("onClientGUIClick"root, function(btnstate)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napadfalse)
      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 (btnstate)
    if source == buttonAccept then
        if btn == "left" and state == "up" then
        local element getElementsWithinMarker(marker)
            for iv in ipairs (element) do
             setElementPosition(v,314.5193.3000030517618.700000762939)
            end
        guiSetVisible(napadfalse)
        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: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8


addEventHandler("onClientResourceStart"root, function()
guiSetVisible(napadfalse)
end)
napad guiCreateWindow(438185467306"Potwied? Napad na Bank"false)
        guiWindowSetSizable(napadfalse)
        guiSetAlpha(napad0.58)
        guiSetProperty(napad"CaptionColour""FFFEFEFE")
        buttonEmpty guiCreateButton(1941291515""falsenapad)
        buttonAccept guiCreateButton(2023311952"Akceptuj?"falsenapad)
        buttonRefuse guiCreateButton(31723414061"Odrzu?"falsenapad)    

local marker createMarker(1821.38318, -1683.3321513.38281 "cylinder")

addEventHandler("onClientMarkerHit"marker, function(elmd)
if el ~= localPlayer then return end
if not md then return end
guiSetVisible(napadtrue)
showCursor(truefalse)
end)

addEventHandler("onClientGUIClick"root, function(btnstate)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napadfalse)
      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 (btnstate)
    if source == buttonAccept then
        if btn == "left" and state == "up" then
        local element getElementsWithinMarker(marker)
            for iv in ipairs (element) do
             local poz setElementPosition(v,314.5193.3000030517618.700000762939)
           local gp getElementPosition(v)
            end
        guiSetVisible(napadfalse)
        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: 3729 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

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: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

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(v314.5193.3000030517618.700000762939)
local gp getElementPosition(v)
end
if gp == poz then
if guiGetVisible(napad) == true then
guiSetVisibile(napadfalse)
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: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

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(438185467306"Potwied? Napad na Bank"false)
    guiSetVisible(napadfalse)
    guiWindowSetSizable(napadfalse)
    guiSetAlpha(napad0.58)
    guiSetProperty(napad"CaptionColour""FFFEFEFE")
    buttonEmpty guiCreateButton(1941291515""falsenapad)
    buttonAccept guiCreateButton(2023311952"Akceptuj?"falsenapad)
    buttonRefuse guiCreateButton(31723414061"Odrzu?"falsenapad)    
end)

local marker createMarker(1821.38318, -1683.3321513.38281 "cylinder")

addEventHandler("onClientMarkerHit"marker, 
    function(hitElementmd)
    if hitElement ~= localPlayer then return end
    if not md then return end
    if source ~= marker then return end
    guiSetVisible(napadtrue)
    showCursor(truefalse)
end)

addEventHandler("onClientGUIClick"root, function(btnstate)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napadfalse)
      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 (btnstate)
    if source == buttonAccept then
        if btn == "left" and state == "up" then
        local element getElementsWithinMarker(marker)
            for iv in ipairs (element) do
             setElementPosition(v,314.5193.3000030517618.700000762939)
            end
        guiSetVisible(napadfalse)
        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: 3729 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

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: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

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: 3729 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

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: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

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(v314.5193.3000030517618.700000762939)
local gp getElementPosition(v)
end
if gp == poz then
if guiGetVisible(napad) == true then
guiSetVisible(napadfalse)
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: 3729 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

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