Wysłany: 2013-04-21, 12:00
vipSEBOvip
A poor begginer
Wiek: 26 Na forum: 5178 dni Posty: 597
Nick w MP: xSebaPL
Piwa : 77
Witajcie, mam problem z usuwaniem button?w:
B??d
Bad 'element' pointer @ 'destroyElement'(1)
Kod:
local prawkoPed = createPed ( 17 , - 2035.14 , - 118.14 , 1035.171875 )
setElementInterior ( prawkoPed , 3 )
setElementRotation ( prawkoPed , 0 , 0 , 270 )
buttons = {}
addEventHandler ( "onClientClick" , getRootElement (),
function( button , state , absoluteX , absoluteY , worldX , worldY , worldZ , clickedElement )
if ( clickedElement == prawkoPed ) then
local x , y = getScreenFromWorldPosition (- 2035.14 , - 118.14 , 1035.171875 )
buttons [ 1 ] = guiCreateButton ( x , y , 100 , 20 , "Rozmowa" , false )
addEventHandler ( "onClientGUIClick" , buttons [ 1 ], startRozmowa )
else
for k , buttons in ipairs ( buttons ) do
destroyElement ( buttons )
end
end
end
)
function startRozmowa ()
for k , buttonss in ipairs ( buttons ) do
destroyElement ( buttonss )
end
end
Wysłany: 2013-04-21, 12:22
CRX
Wiek: 34 Na forum: 5671 dni Posty: 114
Piwa : 106
Czemu u?y?e? destroyElement, zamiast guiSetVisible ?
Wysłany: 2013-04-21, 12:27
Riot
3X
Wiek: 29 Na forum: 5729 dni Posty: 1123
Nick w MP: Riot/3X
Piwa : 286
Spr?buj doda? warunek czy taki element istnieje.
if isElement ( buttons ) then
destroyElement ( buttons )
end
Wysłany: 2013-04-21, 12:33
vipSEBOvip
A poor begginer
Wiek: 26 Na forum: 5178 dni Posty: 597
Nick w MP: xSebaPL
Piwa : 77
B??d znik?, ale button nie
Tagi: bad :: element :: pointer :: destroyelement(1)
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: