Wysłany: 2015-11-01, 12:59
jg2aviva1
Rusek :D
Wiek: 25 Na forum: 4134 dni Posty: 445
Nick w MP: _Wolfenstei[N]^.^
Piwa : 1033
Witam. Mam problem z panelem logowania kt?ry ?ci?gn??em a nawet zg?osi?em ten b??d . Ale do rzeczy. Kiedy wejd? na serwer to t?o tego panelu logowania jest czarne a powinien by? ten efekt ruszaj?cej sie kamery. Wida? go tylko kiedy odpale go kiedy jestem w grze. Mo?e to kto? poprawi? bo nie wiem jak
mojeW , mojeH = 800 , 600
sW , sH = guiGetScreenSize ()
w , h = ( sW / mojeW ), ( sH / mojeH )
local sm = {}
sm . moov = 0
sm . object1 , sm . object2 = nil , nil
local function removeCamHandler ()
if( sm . moov == 1 ) then
sm . moov = 0
end
end
local function camRender ()
if ( sm . moov == 1 ) then
local x1 , y1 , z1 = getElementPosition ( sm . object1 )
local x2 , y2 , z2 = getElementPosition ( sm . object2 )
setCameraMatrix ( x1 , y1 , z1 , x2 , y2 , z2 )
setCameraTarget ( sm . object1 )
end
end
addEventHandler ( "onClientPreRender" , root , camRender )
function smoothMoveCamera ( x1 , y1 , z1 , x1t , y1t , z1t , x2 , y2 , z2 , x2t , y2t , z2t , time )
if( sm . moov == 1 ) then return false end
sm . object1 = createObject ( 1337 , x1 , y1 , z1 )
sm . object2 = createObject ( 1337 , x1t , y1t , z1t )
setElementAlpha ( sm . object1 , 0 )
setElementAlpha ( sm . object2 , 0 )
setObjectScale ( sm . object1 , 0.01 )
setObjectScale ( sm . object2 , 0.01 )
moveObject ( sm . object1 , time , x2 , y2 , z2 , 0 , 0 , 0 , "InOutQuad" )
moveObject ( sm . object2 , time , x2t , y2t , z2t , 0 , 0 , 0 , "InOutQuad" )
sm . moov = 1
setTimer ( removeCamHandler , time , 1 )
setTimer ( destroyElement , time , 1 , sm . object1 )
setTimer ( destroyElement , time , 1 , sm . object2 )
return true
end
function musicSettings ( opcja )
if opcja == "on" then
sound = playSound ( "muza.mp3" , true )
elseif opcja == "off" then
stopSound ( sound )
end
end
-- GUI
loguj = guiCreateButton ( 379 * w , 346 * h , 210 * w , 40 * h , "Zaloguj " , false )
rejestruj = guiCreateButton ( 379 * w , 396 * h , 210 * w , 40 * h , "Zarejestruj" , false )
login = guiCreateEdit ( 379 * w , 206 * h , 214 * w , 32 * h , "" , false )
haslo = guiCreateEdit ( 379 * w , 296 * h , 214 * w , 32 * h , "" , false )
guiEditSetMasked ( haslo , true )
guiSetVisible ( loguj , false )
guiSetVisible ( haslo , false )
guiSetVisible ( rejestruj , false )
guiSetVisible ( login , false )
-- DX
function panelek ()
dxDrawRectangle ( 236 * w , 140 * h , 367 * w , 318 * h , tocolor ( 0 , 0 , 0 , 170 ), false )
dxDrawText ( "Login:" , 379 * w , 165 * h , 446 * w , 206 * h , tocolor ( 0 , 200 , 0 ), 1.10 * w , "pricedown" , "left" , "top" , false , false , true , false , false )
dxDrawText ( "Has?o:" , 379 * w , 259 * h , 454 * w , 296 * h , tocolor ( 0 , 200 , 0 ), 1.10 * w , "pricedown" , "left" , "top" , false , false , true , false , false )
dxDrawText ( "Center RPG" , 302 * w , 116 * h , 530 * w , 154 * h , tocolor ( 0 , 200 , 0 ), 1.20 * w , "bankgothic" , "left" , "top" , false , false , true , false , false )
dxDrawText ( "Center RPG to serwer RPG kt?ry zaciekawi Ciebie i twoich znajomych! Zapro? ich do gry a Twoja rozgrywka b?dzie jeszcze lepsza!" , 251 * w , 269 * h , 365 * w , 306 * h , tocolor ( 255 , 255 , 255 , 255 ), 1.00 * w , "default" , "center" , "top" , false , true , true , false , false )
dxDrawRectangle ( 236 * w , 458 * h , 367 * w , 18 * h , tocolor ( 0 , 200 , 0 ), false )
end
-- FUNKCJA WYCISZ
function wycisz ()
if getSoundVolume ( sound ) <= 0 then
stopSound ( sound )
killTimer ( timer )
return end
volume = tonumber ( getSoundVolume ( sound ) )
volume = volume - 0.05
setSoundVolume ( sound , volume )
end
addEventHandler ( "onClientResourceStart" , getResourceRootElement ( getThisResource ()),
function()
addEventHandler ( "onClientRender" , getRootElement (), panelek )
guiSetVisible ( loguj , true )
guiSetVisible ( haslo , true )
guiSetVisible ( rejestruj , true )
guiSetVisible ( login , true )
showPlayerHudComponent ( "all" , false )
showCursor ( true )
musicSettings ( "on" )
smoothMoveCamera ( 1561.7541503906 , - 1373.9388427734 , 100 , 0 , - 2500 , 0 , 1823.3835449219 , - 1820.5555419922 , 36 , - 999999 , - 999999 , - 10000 , 2 * 70000 )
end
)
function zaloguj ( button , state )
if button == "left" and state == "up" then
local username = guiGetText ( login )
local password = guiGetText ( haslo )
if username and password then
triggerServerEvent ( "submitLogin" , getRootElement (), localPlayer , username , password )
else
outputChatBox ( "Wpisz login i has?o." )
end
end
end
addEventHandler ( "onClientGUIClick" , loguj , zaloguj , false )
function zarejestuj ( button , state )
if button == "left" and state == "up" then
local username = guiGetText ( login )
local password = guiGetText ( haslo )
if username and password then
if ( string . len ( username )>= 4 ) then
if ( string . len ( password )>= 4 ) then
triggerServerEvent ( "submitRegister" , getRootElement (), localPlayer , username , password )
else
outputChatBox ( "Has?o musi zawiera? minimalnie 4 znaki" )
end
else
outputChatBox ( "Login musi zawiera? minimalnie 4 znaki." )
end
else
outputChatBox ( "Wpisz sw?j login i has?o" )
end
end
end
addEventHandler ( "onClientGUIClick" , rejestruj , zarejestuj , false )
function hideLoginWindow ()
removeEventHandler ( "onClientRender" , getRootElement (), panelek )
removeEventHandler ( "onClientPreRender" , getRootElement (), camRender )
guiSetVisible ( loguj , false )
guiSetVisible ( haslo , false )
guiSetVisible ( rejestruj , false )
guiSetVisible ( login , false )
fadeCamera ( true )
timer = setTimer ( wycisz , 150 , 0 )
setElementPosition ( localPlayer , 835.13849 , - 2831.10522 , 243.55536 )
setElementDimension ( localPlayer , 0 )
setCameraTarget ( localPlayer )
showCursor ( false )
setElementFrozen ( localPlayer , false )
end
addEvent ( "schowajlogina" , true )
addEventHandler ( "schowajlogina" , getResourceRootElement ( getThisResource ()), hideLoginWindow )
Podpis
GTAO Member: 2015-08-23, 14:26
Wysłany: 2015-11-01, 14:22
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
Przy wej?ciu na serwer dodaj funkcj? fadeCamera
Więcej informacji znajdziesz w Wikipedii MTA: fadeCamera
Wysłany: 2015-11-01, 14:24
jg2aviva1
Rusek :D
Wiek: 25 Na forum: 4134 dni Posty: 445
Nick w MP: _Wolfenstei[N]^.^
Piwa : 1033
Wysłany: 2015-11-01, 14:26
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
jg2aviva1 , a chocia?by do tego dodaj
addEventHandler ( "onClientResourceStart" , getResourceRootElement ( getThisResource ()),
function()
addEventHandler ( "onClientRender" , getRootElement (), panelek )
guiSetVisible ( loguj , true )
guiSetVisible ( haslo , true )
guiSetVisible ( rejestruj , true )
guiSetVisible ( login , true )
showPlayerHudComponent ( "all" , false )
showCursor ( true )
musicSettings ( "on" )
smoothMoveCamera ( 1561.7541503906 , - 1373.9388427734 , 100 , 0 , - 2500 , 0 , 1823.3835449219 , - 1820.5555419922 , 36 , - 999999 , - 999999 , - 10000 , 2 * 70000 )
end
)
PS: Jaki? lag i si? zdublowa?y xD
Wysłany: 2015-11-01, 14:35
jg2aviva1
Rusek :D
Wiek: 25 Na forum: 4134 dni Posty: 445
Nick w MP: _Wolfenstei[N]^.^
Piwa : 1033
Dalej czarne t?o. Ta funkcja wygl?da tak:
addEventHandler ( "onClientResourceStart" , getResourceRootElement ( getThisResource ()),
function()
addEventHandler ( "onClientRender" , getRootElement (), panelek )
guiSetVisible ( loguj , true )
fadeCamera ( source , false , 1.0 , 255 , 0 , 0 )
guiSetVisible ( haslo , true )
guiSetVisible ( rejestruj , true )
guiSetVisible ( login , true )
showPlayerHudComponent ( "all" , false )
showCursor ( true )
musicSettings ( "on" )
smoothMoveCamera ( 1561.7541503906 , - 1373.9388427734 , 100 , 0 , - 2500 , 0 , 1823.3835449219 , - 1820.5555419922 , 36 , - 999999 , - 999999 , - 10000 , 2 * 70000 )
end
)
Podpis
GTAO Member: 2015-08-23, 14:26
Wysłany: 2015-11-01, 14:37
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
jg2aviva1 , nie false a true...
Wysłany: 2015-11-01, 14:49
jg2aviva1
Rusek :D
Wiek: 25 Na forum: 4134 dni Posty: 445
Nick w MP: _Wolfenstei[N]^.^
Piwa : 1033
Wysłany: 2015-11-01, 16:14
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
jg2aviva1 , ehhh my?la?em, ?e rozr??niasz client a server i nie sprawdza?em szczeg??owo...
Tagi: kamera
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: