Wysłany: 2016-07-24, 17:42
ZlodziejPralek
Wiek: 29 Na forum: 4023 dni Posty: 17
Po klikni?ciu w odpowiednie miejsce ma ?ciemnia? ekran, ale tego nie robi.
function ifPlayerClosePanel ( state )
if isMouseInPosition ( 348 , 586 , 212 , 32 ) and state == "up" then
fadeCamera ( false , 5 )
setTimer ( fadeCameraPanelClose , 7000 , 1 )
end
end
addEventHandler ( "onClientClick" , getRootElement (), ifPlayerClosePanel )
Z debuga wychodzi takie co? :
Wysłany: 2016-07-24, 17:44
AteX
Wiek: 26 Na forum: 4015 dni Posty: 927
Nick w MP: #AteX
Piwa : 8360
Bo to nie jest funkcja wbudowana w MTA tylko u?yteczna funkcja z wiki. Trzeba troch? czyta?, a nie tylko kopiowa?.
Musisz wklei? ten kod:
function isMouseInPosition ( x , y , width , height )
if ( not isCursorShowing ( ) ) then
return false
end
local sx , sy = guiGetScreenSize ( )
local cx , cy = getCursorPosition ( )
local cx , cy = ( cx * sx ), ( cy * sy )
if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
return true
else
return false
end
end
Ostatnio zmieniony przez AteX 2016-07-24, 17:47, w całości zmieniany 1 raz
Wysłany: 2016-07-24, 17:45
GabWas
Wiek: 24 Na forum: 3881 dni Posty: 289
Nick w MP: GabWas
Piwa : 65
Funkcja isMouseInPosition nie jest domy?lnie wbudowana w silnik MTA, wi?c musisz j? doda? przed swoim skryptem:
function isMouseInPosition ( x , y , width , height )
if ( not isCursorShowing ( ) ) then
return false
end
local sx , sy = guiGetScreenSize ( )
local cx , cy = getCursorPosition ( )
local cx , cy = ( cx * sx ), ( cy * sy )
if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
return true
else
return false
end
end
Wysłany: 2016-07-24, 17:55
ZlodziejPralek
Wiek: 29 Na forum: 4023 dni Posty: 17
Tagi: ismouseinposition
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: