Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

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

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Witam. Mam problem z panelem logowania kt?ry ?ci?gn??em a nawet zg?osi?em ten b??d :p . 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 :eye:

mojeW,mojeH 800600
sW,sH guiGetScreenSize()
w= (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 == 1then
        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*w346*h210*w40*h"Zaloguj "false)
rejestruj guiCreateButton(379*w396*h210*w40*h"Zarejestruj"false)
login guiCreateEdit(379*w206*h214*w32*h""false)
haslo guiCreateEdit(379*w296*h214*w32*h""false)
guiEditSetMasked(haslotrue)
guiSetVisible(logujfalse)
guiSetVisible(haslofalse)
guiSetVisible(rejestrujfalse)
guiSetVisible(loginfalse)

--DX
function panelek()
dxDrawRectangle(236*w140*h367*w318*htocolor(000170), false)
dxDrawText("Login:"379*w165*h446*w206*htocolor(0,200,0), 1.10*w"pricedown""left""top"falsefalsetruefalsefalse)
dxDrawText("Has?o:"379*w259*h454*w296*htocolor(0,200,0), 1.10*w"pricedown""left""top"falsefalsetruefalsefalse)
dxDrawText("Center RPG"302*w116*h530*w154*htocolor(0,200,0), 1.20*w"bankgothic""left""top"falsefalsetruefalsefalse)
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*w269*h365*w306*htocolor(255255255255), 1.00*w"default""center""top"falsetruetruefalsefalse)
dxDrawRectangle(236*w458*h367*w18*htocolor(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 soundvolume )
end

addEventHandler ("onClientResourceStart"getResourceRootElement(getThisResource()), 
function()
addEventHandler ("onClientRender"getRootElement(), panelek)
guiSetVisible(logujtrue)
guiSetVisible(haslotrue)
guiSetVisible(rejestrujtrue)
guiSetVisible(logintrue)
showPlayerHudComponent ("all"false)
showCursor (true)
musicSettings "on" )
smoothMoveCamera(1561.7541503906, -1373.93884277341000, -250001823.3835449219, -1820.555541992236, -999999, -999999, -100002*70000 )
end
)

function zaloguj(buttonstate)
       if button == "left" and state == "up" then
        local username guiGetText(login)
         local password guiGetText(haslo)
          if username and password then
           triggerServerEvent("submitLogin"getRootElement(), localPlayerusernamepassword)
          else
         outputChatBox "Wpisz login i has?o." )
      end    
   end
end
addEventHandler("onClientGUIClick"logujzalogujfalse)

function zarejestuj(buttonstate)
    if button == "left" and state == "up" then
        local username guiGetText(login)
        local password guiGetText(haslo)
        if username and password then
            if (string.len(username)>=4then
                if (string.len(password)>=4then             
                triggerServerEvent("submitRegister"getRootElement(), localPlayerusernamepassword)
                 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"rejestrujzarejestujfalse)

function hideLoginWindow()
removeEventHandler ("onClientRender"getRootElement(), panelek)
removeEventHandler "onClientPreRender"getRootElement(), camRender )
guiSetVisible(logujfalse)
guiSetVisible(haslofalse)
guiSetVisible(rejestrujfalse)
guiSetVisible(loginfalse)
fadeCamera true )
timer setTimer wycisz150)
setElementPosition (localPlayer,835.13849, -2831.10522243.55536)
setElementDimension (localPlayer0)
setCameraTarget localPlayer )
showCursor (false)
setElementFrozen localPlayerfalse )
end
addEvent("schowajlogina"true)
addEventHandler("schowajlogina"getResourceRootElement(getThisResource()), hideLoginWindow)


Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-01, 14:22


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
Przy wej?ciu na serwer dodaj funkcj? fadeCamera


Więcej informacji znajdziesz w Wikipedii MTA:

fadeCamera


Postaw piwo autorowi tego posta
 

 
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

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
"DestroY" napisał/a:

Przy wej?ciu na serwer dodaj funkcj? fadeCamera


Więcej informacji znajdziesz w Wikipedii MTA:

fadeCamera


Wiesz mniej-wi?cej gdzie? Bo pr?bowa?em do eventu "onClientPreRender" i grzyb z tego wyszed? ;)


PS. Zdublowa?e? posty xD

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-01, 14:26


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
jg2aviva1, a chocia?by do tego dodaj


addEventHandler ("onClientResourceStart"getResourceRootElement(getThisResource()), 
function()
addEventHandler ("onClientRender"getRootElement(), panelek)
guiSetVisible(logujtrue)
guiSetVisible(haslotrue)
guiSetVisible(rejestrujtrue)
guiSetVisible(logintrue)
showPlayerHudComponent ("all"false)
showCursor (true)
musicSettings "on" )
smoothMoveCamera(1561.7541503906, -1373.93884277341000, -250001823.3835449219, -1820.555541992236, -999999, -999999, -100002*70000 )
end
)



PS: Jaki? lag i si? zdublowa?y xD

Postaw piwo autorowi tego posta
 

 
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

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Dalej czarne t?o. Ta funkcja wygl?da tak:

addEventHandler ("onClientResourceStart"getResourceRootElement(getThisResource()), 
function()
addEventHandler ("onClientRender"getRootElement(), panelek)
guiSetVisible(logujtrue)
fadeCamera sourcefalse1.02550guiSetVisible(haslotrue)
guiSetVisible(rejestrujtrue)
guiSetVisible(logintrue)
showPlayerHudComponent ("all"false)
showCursor (true)
musicSettings "on" )
smoothMoveCamera(1561.7541503906, -1373.93884277341000, -250001823.3835449219, -1820.555541992236, -999999, -999999, -100002*70000 )
end
)


Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-01, 14:37


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
jg2aviva1, nie false a true...

Postaw piwo autorowi tego posta
 

 
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

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
"DestroY" napisał/a:

jg2aviva1, nie false a true...


wci?? to samo ;(

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-01, 16:14


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
jg2aviva1, ehhh my?la?em, ?e rozr??niasz client a server i nie sprawdza?em szczeg??owo...


fadeCamera (true


Postaw piwo autorowi tego posta
 

 
Tagi: kamera
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku