Wysłany: 2018-02-24, 22:23
jagoreq
Wiek: 24 Na forum: 3221 dni Posty: 221
Nick w MP: dwd
Piwa : 18
witam, powoli chcialem zaczac tworzyc panel logowania, ale wyskakuje blad:
ERROR: s-logowanie\c.lua:27: attempt to call global 'isMouseIn' (a nil value)
showPlayerHudComponent ( "all" , false )
local sx , sy = guiGetScreenSize ()
local px , py =( 1920 / sx ),( 1080 / sy )
edit1 = guiCreateEdit ( 634 * px , 301 * py , 297 * px , 33 * py , "" , false )
edit2 = guiCreateEdit ( 634 * px , 353 * py , 297 * px , 33 * py , "" , false )
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
end
)
addEventHandler ( "onClientRender" , root ,
function()
showCursor ( true )
dxDrawRectangle ( 585 * px , 256 * py , 807 * px , 292 * py , tocolor ( 184 , 126 , 70 , 255 ), false )
dxDrawRectangle ( 632 * px , 412 * py , 299 * px , 45 * py , tocolor ( 14 , 75 , 212 , 255 ), false )
dxDrawRectangle ( 632 * px , 473 * py , 299 * px , 45 * py , tocolor ( 14 , 75 , 212 , 255 ), false )
end
)
addEventHandler ( "onClientClick" , root , function( btn , state )
if btn == "left" and state == "down" then
text1 = guiGetText ( edit1 )
text2 = guiGetText ( edit2 )
if string . len ( text1 ) > 3 or string . len ( text2 ) > 3 then
if isMouseIn ( 585 * px , 256 * py , 807 * px , 292 * py ) then
triggerServerEvent ( "spawn" , localPlayer )
end
end
end
end )
Wysłany: 2018-02-24, 22:45
IgorPL222
LUA
Wiek: 26 Na forum: 3112 dni Posty: 133
Nick w MP: mxgvr
Piwa : 746
Dlatego i? MTA nie ma domy?lnie wbudowanej funkcji isMouseIn, musisz j? pobiera?.
A oto ona.
function isMouseIn ( psx , psy , pssx , pssy , abx , aby )
if not isCursorShowing () then return end
cx , cy = getCursorPosition ()
cx , cy = cx * sx , cy * sy
if cx >= psx and cx <= psx + pssx and cy >= psy and cy <= psy + pssy then
return true , cx , cy
else
return false
end
end
Więcej szczegółów
Wystawiono 1 piw(a):jagoreq
Wysłany: 2018-02-24, 22:47
jagoreq
Wiek: 24 Na forum: 3221 dni Posty: 221
Nick w MP: dwd
Piwa : 18
"IgorPL222" napisał/a :Dlatego i? MTA nie ma domy?lnie wbudowanej funkcji isMouseIn, musisz j? pobiera?.
A oto ona.
function isMouseIn ( psx , psy , pssx , pssy , abx , aby )
if not isCursorShowing () then return end
cx , cy = getCursorPosition ()
cx , cy = cx * sx , cy * sy
if cx >= psx and cx <= psx + pssx and cy >= psy and cy <= psy + pssy then
return true , cx , cy
else
return false
end
end
dzieki :>
do zamkniecia
Tagi: logowanie
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: