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

Wysłany: 2014-05-12, 23:21


zuraw13







Wiek: 27
Na forum: 5074 dni
Posty: 95
Nick w MP: zuraw113

Piwa: 191

Respekt: 50

Gdy wchodz? na serwer to nie ma kamery, kt?ra powinna by? podczas rejstracji/logiwania, dopiero po wej?ciu na serwer gdy si? zresetuj? ten skrypt, to b?dzie ta kamera, ale i tak przeskakuje. Gdy wyjd? z serwera, to zn?w jak wejd? to nie ma tej kamery.

Film poni?ej:
http://www.youtube.com/wa...eature=youtu.be


Skrypt strona klienta:
sWidthsHeight guiGetScreenSize()
anims = {"dnce_M_b","DAN_Left_A","DAN_Down_A","DAN_Loop_A"}
StartSkin 0
NewSkin false
local localPlayer getLocalPlayer()
local x 1024
local y 768
local sm = {}
sm.moov 0
sm.object1sm.object2 nilnil
local months = {
        [0] = "stycznia",
        [1] = "lutego",
        [2] = "marca",
        [3] = "kwietnia",
        [4] = "maja",
        [5] = "czerwca",
        [6] = "lipca",
        [7] = "sierpnia",
        [8] = "wrze?nia",
        [9] = "pa?dziernika",
        [10] = "listopada",
        [11] = "grudnia"
        }

local function camRender ()
    if isElement(sm.object1) and (sm.object2then
        local x1y1z1 getElementPosition sm.object1 )
        local x2y2z2 getElementPosition sm.object2 )
        setCameraMatrix x1y1z1x2y2z2 )
    end
end

local function removeCamHandler ()
    if(sm.moov == 1then
        sm.moov 0
        removeEventHandler "onClientPreRender"getRootElement(), camRender )
    end
end
 

function smoothMoveCamera x1y1z1x1ty1tz1tx2y2z2x2ty2tz2ttime )
    if(sm.moov == 1then return false end
    sm.object1 createObject 1337x1y1z1 )
    sm.object2 createObject 1337x1ty1tz1t )
    setElementAlpha sm.object1)
    setElementAlpha sm.object2)
    setObjectScale(sm.object10.01)
    setObjectScale(sm.object20.01)
    moveObject sm.object1timex2y2z2000"InOutQuad" )
    moveObject sm.object2timex2ty2tz2t000"InOutQuad" )
 
    addEventHandler "onClientPreRender"getRootElement(), camRender )
    sm.moov 1
    return true
end

login_edit guiCreateEdit((461/x)*sWidth, (400/y)*sHeight, (150/x)*sWidth, (30/y)*sHeight""..getPlayerName(getLocalPlayer()), false)
guiEditSetMaxLength(login_edit50)
haslo_edit guiCreateEdit((461/x)*sWidth, (450/y)*sHeight, (150/x)*sWidth, (30/y)*sHeight""false)
guiEditSetMasked(haslo_edittrue)
guiEditSetMaxLength(haslo_edit50)
login_btn guiCreateButton((250/x)*sWidth, (500/y)*sHeight, (200/x)*sWidth, (50/y)*sHeight"Zaloguj si?"false)
guiSetProperty(login_btn"NormalTextColour""FFAAAAAA")
register_btn guiCreateButton((550/x)*sWidth, (500/y)*sHeight, (200/x)*sWidth, (50/y)*sHeight"Zarejestruj si?"false)
guiSetProperty(register_btn"NormalTextColour""FFAAAAAA")
gosc_btn guiCreateButton((250/x)*sWidth, (575/y)*sHeight, (500/x)*sWidth, (50/y)*sHeight"Wejd? jako Go??"false)
guiSetProperty(gosc_btn"NormalTextColour""FFAAAAAA")

function renderujemy()
        dxDrawRectangle((200/x)*sWidth, (220/y)*sHeight, (600/x)*sWidth, (430/y)*sHeighttocolor(000200), false)
        dxDrawImage((300/x)*sWidth, (210/y)*sHeight, (350/x)*sWidth, (200/y)*sHeight":Polskie_Party/pliki/logo.png"000tocolor(255255255255), true)
        dxDrawLine((200/x)*sWidth, (220/y)*sHeight, (800/x)*sWidth, (220/y)*sHeighttocolor(25500255), 2true)
        dxDrawLine((200/x)*sWidth, (650/y)*sHeight, (800/x)*sWidth, (650/y)*sHeighttocolor(25500255), 2true)        
        dxDrawLine((200/x)*sWidth, (220/y)*sHeight, (200/x)*sWidth, (650/y)*sHeighttocolor(25500255), 2true)
        dxDrawLine((800/x)*sWidth, (220/y)*sHeight, (800/x)*sWidth, (650/y)*sHeighttocolor(25500255), 2true)        
        dxDrawText("Nick:", (350/x)*sWidth, (390/y)*sHeight, (10/x)*sWidth, (10/y)*sHeighttocolor(25500255), 1.6"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Has?o:", (312/x)*sWidth, (440/y)*sHeight, (10/x)*sWidth, (10/y)*sHeighttocolor(25500255), 1.6"bankgothic""left""top"falsefalsetruefalsefalse)
end
addEventHandler("onClientRender"rootrenderujemy)

function callServerFunction(funcname, ...)
    local arg = { ... }
    if (arg[1]) then
        for keyvalue in nextarg do
            if (type(value) == "number"then arg[key] = tostring(valueend
        end
    end
    triggerServerEvent("onClientCallsServerFunction"resourceRoot funcnameunpack(arg))
end

function init()
triggerServerEvent("destroyPP"rootgetLocalPlayer())
smoothMoveCamera(-159275680, -15927568021401348702140134870150000)
muzyka playSound(":Polskie_Party/pliki/Long_and_Junior_-_Polskie_party.mp3")
setSoundVolume(muzyka0.70)
showCursor(true)
showPlayerHudComponent("all"false)
showChat(false)
guiSetInputEnabled(true)
removeEventHandler("onClientRender"getRootElement(), td)
end
addEventHandler("onClientResourceStart"getResourceRootElement(getThisResource()), init)

function tdInit()
addEventHandler("onClientRender"getRootElement(), td)
end
addEvent("renderTD"true)
addEventHandler("renderTD"getRootElement(), tdInit)

function login(buttonstate)
    if button == "left" and state == "up" then
        local username guiGetText(login_edit)
        local password guiGetText(haslo_edit)
            if string.len(username) < or string.len(password) < 5 then
            showBox("error""D?ugo?? nicku lub has?a jest zbyt kr?tka.")
            return 
            end
        if username and password then
            triggerServerEvent("probaLogowania"getRootElement(), localPlayerusernamepassword)
        else
        showBox("info","Wpisz sw?j login i has?o.")
        end
    end
end

function register(buttonstate)
    if button == "left" and state == "up" then
        local username guiGetText(login_edit)
        local password guiGetText(haslo_edit)
        if string.len(username) < or string.len(password) < 5 then
            showBox("error""D?ugo?? nicku lub has?a jest zbyt kr?tka.")
            return 
        end
        if username and password then
            triggerServerEvent("probaRejestracji"getRootElement(), localPlayerusernamepassword)
        else
            showBox("info","Wpisz sw?j login i has?o.")
        end
    end
end

function wybieralkaInfo()
dxDrawText("#ffffffWybierz sw?j model postaci. Aby przewija? modele - u?yj #FF9900strza?ek, #ffffffaby zatwierdzi? naci?nij klawisz #FF9900ENTER.", (0/1680)*sWidth, (856/1024)*sHeight, (1679/1680)*sWidth, (905/1024)*sHeighttocolor(255255255255), 1.5"default-bold""left""top"falsefalsetruetruefalse)
dxDrawText("Wybierz sw?j model postaci. Aby przewija? modele - u?yj strza?ek, aby zatwierdzi? naci?nij klawisz ENTER.", (2/1680)*sWidth, (856/1024)*sHeight, (1681/1680)*sWidth, (905/1024)*sHeighttocolor(000255), 1.5"default-bold""left""top"falsefalsefalsefalsefalse)
end

function wylaczPanelLogowania()
fadeCamera(false0000)
setTimer(fadeCamera20001true1.0)
removeEventHandler("onClientRender"getRootElement(), renderujemy)
showCursor(false)
guiSetInputEnabled(false)
setCameraTarget(getLocalPlayer())
destroyElement(login_btn)
destroyElement(register_btn)
destroyElement(gosc_btn) --------------------------------
destroyElement(login_edit)
destroyElement(haslo_edit)
destroyElement(sm.object1)
destroyElement(sm.object2)
removeCamHandler()
setCameraMatrix(1943, -2299271943, -230226)
skin createPed(StartSkin1942.9174804688, -2303.163085937524.9355583190920)
setPedAnimationskin"DANCING"anims[math.random(1,4)])
setElementFrozen(skintrue)
addEventHandler("onClientRender"rootwybieralkaInfo)
bindKey("arrow_r","down",NextSkin)
bindKey("arrow_l","down",LastSkin)
bindKey("enter""down"zalogowany)
end

function NextSkin()
    if StartSkin == 312 then
        StartSkin = -1
    elseif StartSkin == 2 then
        StartSkin 8
    end
        StartSkin StartSkin 1
        local x,y,getElementPosition(skin)
        setElementModel(skin,StartSkin)
        setPedAnimationskin"DANCING"anims[math.random(1,4)])
        fxAddGlass(x,y,0.5math.random(0255), math.random(0255), math.random(0255), 2550.155)
        setElementPosition(skin1942.9174804688, -2303.163085937524.935558319092)
end
function LastSkin()
    if StartSkin == 0 then
        StartSkin 313
    elseif StartSkin == 9 then
        StartSkin 3
    end
        StartSkin StartSkin 1
        local x,y,getElementPosition(skin)
        setElementModel(skin,StartSkin)
        setPedAnimationskin"DANCING"anims[math.random(1,4)] )
        fxAddGlass(x,y,0.5math.random(0255), math.random(0255), math.random(0255), 2550.155)
        setElementPosition(skin1942.9174804688, -2303.163085937524.935558319092)
end


function fadeOutAudio()
    if not muzyka then return end
    local vol=getSoundVolume(muzyka)
    vol=vol-0.1
    if (vol<0then
    stopSound(muzyka)

    muzyka=nil
    return
    end
    setSoundVolume(muzyka,vol)
    setTimer(fadeOutAudio3001)
end

function zalogowany()
stopSound(muzyka)
unbindKey("arrow_r","down",NextSkin)
unbindKey("arrow_l","down",LastSkin)
unbindKey("enter","down",zalogowany)
showPlayerHudComponent("all"true)
--showPlayerHudComponent("vehicle_name"true)
setElementData(localPlayer"skin"StartSkin)
setCameraTarget(getLocalPlayer())
setTimer(fadeOutAudio10001)
removeEventHandler("onClientRender"rootwybieralkaInfo)
addEventHandler("onClientRender"roottd)
callServerFunction("spawn"localPlayer)
local teraz getRealTime()
local lastonline getRealTime(getElementData(localPlayer"ostanioOnline")) or "To jest twoja pierwsza wizyta"
outputChatBox("Witaj, "..getPlayerName(localPlayer), 0102255)
outputChatBox("Twoja ranga : "..getElementData(localPlayer"Ranga") or "Gracz"0102255outputChatBox("Ostatnio online: "..lastonline.monthday.." "..months[lastonline.month].." ".. 1900 lastonline.year.." o "..("%02d"):format(lastonline.hour)..":"..("%02d"):format(lastonline.minute), 0102255)
outputChatBox("Mi?ej gry, ?yczy administracja.",  0102255)
setElementData(localPlayer"ostatnioOnline"tonumber(teraz.timestamp))
end



addEvent("HideGUI"true)
addEventHandler("HideGUI"rootwylaczPanelLogowania)
addEventHandler("onClientGUIClick"login_btnloginfalse)
addEventHandler("onClientGUIClick"register_btnregisterfalse)


Skrypt strona serwera:
function callServerFunction(funcname, ...)
    local arg = { ... }
    if (arg[1]) then
        for keyvalue in nextarg do arg[key] = tonumber(value) or value end
    end
    loadstring("return "..funcname)()(unpack(arg))
end
addEvent("onClientCallsServerFunction"true)
addEventHandler("onClientCallsServerFunction"resourceRoot callServerFunction)

function logowanie(playerusernamepassword)
    local account getAccount(usernamepassword)
    if (account ~= falsethen
        if (logIn(playeraccountpassword) == truethen
        setCameraTarget(player,player)
            triggerClientEvent (player"HideGUI"getRootElement())
        else
            triggerClientEvent(player"CreateBox"getRootElement(), "error""Uzupe?nij pole 'login' i 'has?o'.")
    end
end
end

addEvent("probaLogowania"true)
addEventHandler("probaLogowania"getRootElement(), logowanie)

function rejestracja(playerusernamepassword)
    local account getAccount(usernamepassword)
    if (account ~= falsethen
    else
        account addAccount(usernamepassword)
        if (logIn(playeraccountpassword) == truethen
        setCameraTarget(player,player)
        spawn(player)
        triggerClientEvent(player"CreateBox"getRootElement(), "info""Zarejestrowa?e? si? pomy?lnie! Witamy na serwerze Polskie Party.")
            triggerClientEvent(player"HideGUI"getRootElement())
            
        end
    end
end

addEvent("probaRejestracji"true)
addEventHandler("probaRejestracji"getRootElement(), rejestracja)


function resourceStop ()
    setElementData(source"admin"nil)
    setElementData(source"vip"nil)
    setElementData(source"Exp"nil)
    setElementData(source"money"nil)
    setElementData(source"datetime"nil)
    setElementData(source"loggedin"nil)
end
addEventHandler("onResourceStop"getRootElement(), resourceStop)
addEventHandler("onPlayerQuit"getRootElement(), resourceStop)


addEventHandler("onPlayerJoin"root,
function(gracz)
    if isElement(gracz) and getElementType(gracz) == "player" then
    fadeCamera(gracztrue)
    showPlayerHudComponent(gracz"all"true)
    setElementData(gracz"Exp"0)
    setElementData(gracz"Level"0)
    setElementData(gracz"Ranga""Gracz")
    serverDisplayo textCreateDisplay()                            
    textDisplayAddObserver serverDisplaygracz )                      
    serverTexto textCreateTextItem "Witaj na serwerze Polskie Party!\nAktualnie trwa pobieranie zasob?w serwera.\nJeste? ciekaw co dla ciebie oferujemy? Chcesz pozna? atrakcje serwera?\nZosta? z nami i poczekaj :)."0.750.5"high"01532552552551.5"right""bottom"200 )  
    textDisplayAddText serverDisplayserverText )                      
    spawn(gracz)
    end
end)

function destroyTextdispJoin(gracz)
    if isElement(gracz) and getElementType(gracz) == "player" then
    if serverDisplayo then
    textDisplayRemoveObserver(serverDisplayogracz)
    end
end
end
addEvent("destroyPP"true)
addEventHandler("destroyPP"rootdestroyTextdispJoin)
function logoutAll ()
    local players getElementsByType "player" ) 
        for kplayer in ipairs players ) do
            account getPlayerAccount player )
                if ( not isGuestAccount account ) ) then 
                    logOut player )
                end
        end
end

addEventHandler "onResourceStart"getResourceRootElement(getThisResource()), logoutAll )


Podpis
Moje skrypty i mapy:
-Baza by Zuraw [SAMP]
-RC Vehicles enter by Zuraw [SAMP]
-Neony by zuraw [SAMP]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-13, 07:02


Zgredek666

LUA






Wiek: 27
Na forum: 4722 dni
Posty: 251
Nick w MP: Zgredek

Piwa: 442

Respekt: 70,1

Do funkcji ktora pokazuje ci panel przy wejsciu na serwer uzyj setcameratarget, fade camera ewentualnie setcameramatrix

Podpis
Piszę skrypty lua na serwery Truck/RPG/Race/DayZ. Kontakt pw!

Pomogłem? Wystarczy jak postawisz :piwo:



Zapraszam na mój kanał na yt:
https://www.youtube.com/c...vgsF65M-Xw5hEDQ
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-13, 14:26


Vike4562

LUA <3






Wiek: 28
Na forum: 4937 dni
Posty: 144
Nick w MP: Vike4562

Piwa: 32

Respekt: 61

gdy zastosujesz setCameraTarget to camera nie b?dzie pod??a?a tylko pokazywa? twoja posta?

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-13, 14:53


zuraw13







Wiek: 27
Na forum: 5074 dni
Posty: 95
Nick w MP: zuraw113

Piwa: 191

Respekt: 50

Nie dzia?a

Podpis
Moje skrypty i mapy:
-Baza by Zuraw [SAMP]
-RC Vehicles enter by Zuraw [SAMP]
-Neony by zuraw [SAMP]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-13, 15:01


Zgredek666

LUA






Wiek: 27
Na forum: 4722 dni
Posty: 251
Nick w MP: Zgredek

Piwa: 442

Respekt: 70,1

Pokaz kod.

Podpis
Piszę skrypty lua na serwery Truck/RPG/Race/DayZ. Kontakt pw!

Pomogłem? Wystarczy jak postawisz :piwo:



Zapraszam na mój kanał na yt:
https://www.youtube.com/c...vgsF65M-Xw5hEDQ
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-13, 15:10


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4427 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

Mia?em ten sam problem ;/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-13, 16:47


Zgredek666

LUA






Wiek: 27
Na forum: 4722 dni
Posty: 251
Nick w MP: Zgredek

Piwa: 442

Respekt: 70,1


function init()
 fadeCamera(sourcetrue5)
 setCameraMatrix(source1468.8785400391, -919.25317382813100.1534652711468.388671875, -918.4247436523499.881813049316)
triggerServerEvent("destroyPP"rootgetLocalPlayer())
smoothMoveCamera(-159275680, -15927568021401348702140134870150000)
muzyka playSound(":Polskie_Party/pliki/Long_and_Junior_-_Polskie_party.mp3")
setSoundVolume(muzyka0.70)
showCursor(true)
showPlayerHudComponent("all"false)
showChat(false)
guiSetInputEnabled(true)
removeEventHandler("onClientRender"getRootElement(), td)
end
addEventHandler("onClientResourceStart"getResourceRootElement(getThisResource()), init)


Tak powinno dzia?a?.

Podpis
Piszę skrypty lua na serwery Truck/RPG/Race/DayZ. Kontakt pw!

Pomogłem? Wystarczy jak postawisz :piwo:



Zapraszam na mój kanał na yt:
https://www.youtube.com/c...vgsF65M-Xw5hEDQ
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-13, 17:00


Vike4562

LUA <3






Wiek: 28
Na forum: 4937 dni
Posty: 144
Nick w MP: Vike4562

Piwa: 32

Respekt: 61

aha, to ju? wiem dlaczego nie dzia?a xD

napisa?e? to po stronie client'a a "source" stosuje si? po stronie server'a

to:
Kod:

fadeCamera(source, true, 5)
setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316)


zast?p tym:
Kod:

fadeCamera(true)
setCameraMatrix( 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316)


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-13, 22:17


zuraw13







Wiek: 27
Na forum: 5074 dni
Posty: 95
Nick w MP: zuraw113

Piwa: 191

Respekt: 50

Dzia?a, kamera teraz ukazuje si? za ka?dym razem, ale kamera dalej "przeskakuje"

Podpis
Moje skrypty i mapy:
-Baza by Zuraw [SAMP]
-RC Vehicles enter by Zuraw [SAMP]
-Neony by zuraw [SAMP]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-14, 15:59


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

co znaczy przeskakuje

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-14, 17:51


zuraw13







Wiek: 27
Na forum: 5074 dni
Posty: 95
Nick w MP: zuraw113

Piwa: 191

Respekt: 50

Nagra?em film, od 35 sekundy jest w spowolnionym tempie, wtedy to lepiej wida?:
http://www.youtube.com/wa...rZaQB0Bt474svDg

Podpis
Moje skrypty i mapy:
-Baza by Zuraw [SAMP]
-RC Vehicles enter by Zuraw [SAMP]
-Neony by zuraw [SAMP]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-14, 19:00


Vike4562

LUA <3






Wiek: 28
Na forum: 4937 dni
Posty: 144
Nick w MP: Vike4562

Piwa: 32

Respekt: 61

Masz zapewne jakie? drobne b??dy w x y z

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-14, 20:39


Zgredek666

LUA






Wiek: 27
Na forum: 4722 dni
Posty: 251
Nick w MP: Zgredek

Piwa: 442

Respekt: 70,1

setCameraMatrix(1468.8785400391, -919.25317382813100.153465271)
Spr?buj tak

Podpis
Piszę skrypty lua na serwery Truck/RPG/Race/DayZ. Kontakt pw!

Pomogłem? Wystarczy jak postawisz :piwo:



Zapraszam na mój kanał na yt:
https://www.youtube.com/c...vgsF65M-Xw5hEDQ
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-14, 22:32


zuraw13







Wiek: 27
Na forum: 5074 dni
Posty: 95
Nick w MP: zuraw113

Piwa: 191

Respekt: 50

Uda?o mi si? naprawi?

Podpis
Moje skrypty i mapy:
-Baza by Zuraw [SAMP]
-RC Vehicles enter by Zuraw [SAMP]
-Neony by zuraw [SAMP]
Postaw piwo autorowi tego posta
 

 
Tagi: brak :: kamery :: podczas :: logowania/rejstaracji
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Brak kamery podczas logowania/rejstaracji 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