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
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
)
Wysłany: 2016-08-05, 13:03
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
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
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
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.
Wysłany: 2016-08-05, 13:39
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
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 )
Ostatnio zmieniony przez marcin778 2016-08-05, 13:46, w całości zmieniany 1 raz
Wysłany: 2016-08-05, 13:45
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
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
)
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
marcin778 ,
debug script
Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Wysłany: 2016-08-05, 14:17
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
MartinPanZycia , Nieda rady jakiego? wi?kszego obrazka na tym nic nie wida?
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
marcin778 , zaraz powi?ksze
kliknij to ci si? powi?kszy , zrobi?em w lepszej jako?ci
Wysłany: 2016-08-05, 14:35
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
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
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
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.
Tagi: piąte :: spotkanie :: gui
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: