Wysłany: 2018-05-04, 22:02
Boysiak
Wiek: 23 Na forum: 3524 dni Posty: 18
Nick w MP: BoysiaQ
Witam,
mam ma?y problem, po klikni?ciu przycisku "Animacje" strona g??wna z tekstem normalnie znika i pojawia si? strona z animacja.
Lecz je?eli jestem ju? w zak?adce "Animacje" i ponownie klikn? przycisk przekierowywuj?cy na t? stron? to wywala b??dy w db3.
Jak zrobi? aby po klikni?ciu tego przycisku przekierowywuj?cego do "animacje" b?d?c w "animacje" przenosi?o na g??wn? stron?, lub nic si? nie dzia?o i nie wywala?o b??d?w w db.
Je?eli kto? dalej nie wie o co mi chodzi to poni?ej wstawiam film z b??dem:
https://www.youtube.com/watch?v=Yl5DDLW8cn0
Tak wygl?da linijka z funkcj? przekierowuj?c? do 'Animacje':
function Klawisze ( button , state )
if f4 and button == "left" and state == "down" then
if cursorPosition ( screenW * 0.240 , screenH * 0.4 , screenW * 0.145 , screenH * 0.0385 ) then
removeEventHandler ( "onClientRender" , getRootElement (), StronaGlowna )
addEventHandler ( "onClientRender" , getRootElement (), AnimGracz )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), Klawisze )
Wysłany: 2018-05-05, 03:18
nanKy
Wiek: 22 Na forum: 3866 dni Posty: 498
Nick w MP: nanky
Piwa : 1773
Gotowy kod:
function isEventHandlerAdded ( sEventName , pElementAttachedTo , func )
if type ( sEventName ) == 'string' and isElement ( pElementAttachedTo ) and type ( func ) == 'function' then
local aAttachedFunctions = getEventHandlers ( sEventName , pElementAttachedTo )
if type ( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
for i , v in ipairs ( aAttachedFunctions ) do
if v == func then
return true
end
end
end
end
return false
end
function Klawisze ( button , state )
if f4 and button == "left" and state == "down" then
if cursorPosition ( screenW * 0.240 , screenH * 0.4 , screenW * 0.145 , screenH * 0.0385 ) then
removeEventHandler ( "onClientRender" , getRootElement (), StronaGlowna )
if not isEventHandlerAdded ( "onClientRender" , getRootElement (), AnimGracz ) then
addEventHandler ( "onClientRender" , getRootElement (), AnimGracz )
else
removeEventHandler ( "onClientRender" , getRootElement (), AnimGracz )
addEventHandler ( "onClientRender" , getRootElement (), StronaGlowna )
end
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), Klawisze )
Więcej szczegółów
Wystawiono 1 piw(a):Boysiak
Wysłany: 2018-05-05, 16:37
Boysiak
Wiek: 23 Na forum: 3524 dni Posty: 18
Nick w MP: BoysiaQ
Dzia?a, wielkie dzi?ki
Tagi: ponowne :: kliknięcie :: funkcji :: błedy :: db3
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: