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

Wysłany: 2018-02-21, 15:02


Vxen







Wiek: 27
Na forum: 4086 dni
Posty: 293

Piwa: 1299

Respekt: 130,5
Respekt: 130,5

Zrobi?em sobie panel no i chcia?em zrobi? lataj?ca kamer? podczas logowania i mam problem kto? mi podpowie gdzie mam da? smoothMoveCamera


local swsh guiGetScreenSize()
local w= (sw/1366), (sh/768)

local gui = {
    login guiCreateEdit(0.390.290.230.08""true),
    pass guiCreateEdit(0.390.510.230.08""true),
}

function renderDX()
    dxDrawRectangle(475*w132*h417*w504*htocolor(000180), false)
    dxDrawLine(475*w530*h890*w530*htocolor(255255255127), 1false)
    dxDrawLine(475*w583*h890*w583*htocolor(255255255127), 1false)
    dxDrawText("Zaloguj si?"475*w531*h890*w583*htocolor(255255255255), 1.00"clear""center""center"falsefalsefalsefalsefalse)
    dxDrawText("Zarejestruj si?"475*w584*h890*w636*htocolor(255255255255), 1.00"clear""center""center"falsefalsefalsefalsefalse)
    dxDrawText("Login:"527*w191*h839*w225*htocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
    dxDrawText("Has?o:"527*w355*h839*w389*htocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
end



addEventHandler("onClientResourceStart"resourceRoot, function()
    showGUI(true)
    fadeCamera(true)
    guiEditSetMasked(gui.passtrue)
end)



addEvent("closePanel"true)
addEventHandler("closePanel"resourceRoot, function()
    showGUI(false)
end)



addEventHandler("onClientClick"root, function(btn,state)
    local login guiGetText(gui.login)
    local pass guiGetText(gui.pass)
    if guiGetVisible(gui.login) and guiGetVisible(gui.passthen
        if btn == "left" and state == "up" then
            if isMouseInPosition(475*w530*h415*w53*hthen
                triggerServerEvent("tryLogin"resourceRootloginpass)
            elseif isMouseInPosition(475*w583*h415*w53*hthen
                if #login >= 3 and #pass >= 3 then
                    triggerServerEvent("tryRegister"resourceRootloginpass)
                else
                    outputChatBox("* Login i/lub has?o musz? mie? minimalnie 3 znaki!")
                end
            end
        end
    end
end)



function showGUI(value)
    if value then
        showCursor(true)
        setPlayerHudComponentVisible("all"false)
        playSound("files/intro.mp3")
        
        addEventHandler("onClientRender"rootrenderDX)
        guiSetVisible(gui.logintrue)
        guiSetVisible(gui.passtrue)
    else
        showCursor(false)
        setPlayerHudComponentVisible("all"true)
        destroyElement(s)
        
        removeEventHandler("onClientRender"rootrenderDX)
        guiSetVisible(gui.loginfalse)
        guiSetVisible(gui.passfalse)
    end
end



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 >= and cx <= width) and (cy >= and cy <= heightthen
        return true
    else
        return false
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-21, 16:26


TeeNekk

Cienzaruwka :v






Wiek: 23
Na forum: 3210 dni
Posty: 264
Nick w MP: TeeNekk.

Piwa: 919

Respekt: 110,5
Respekt: 110,5

po;
addEventHandler("onClientResourceStart"resourceRoot, function()


Podpis
Pomogłem Ci
? Może zostawiłbyś za to piwko, lub respekt? Dzięki!
Mój projekt:
?
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-21, 19:02


Barcioo

Kiedyś to było ST






Wiek: 26
Na forum: 4049 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1887

Respekt: 460
Respekt: 460

Vxen, z czego co widz? nie da?e? obowi?zkowego kodu do tej funkcji

Więcej informacji znajdziesz w Wikipedii MTA:

SmoothMoveCamera


Podpis
Kanał Youtube;
A tu zapraszam
, pomogłem Ci? Wynagrodź mnie :piwo: :)


SUPPORT TEAM- 2016-09-03 do 2018-05-25
Test Mod- 2018-05-25
1k dni na Forum - 2018-01-28


GG: 62111935
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-21, 21:34


Vxen







Wiek: 27
Na forum: 4086 dni
Posty: 293

Piwa: 1299

Respekt: 130,5
Respekt: 130,5

Zrobi?em lot kamery klikam zaloguj i kamera stoi
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)
    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



local swsh guiGetScreenSize()
local w= (sw/1366), (sh/768)

local gui = {
    login guiCreateEdit(0.390.290.230.08""true),
    pass guiCreateEdit(0.390.510.230.08""true),
}

function renderDX()
    dxDrawRectangle(475*w132*h417*w504*htocolor(000180), false)
    dxDrawLine(475*w530*h890*w530*htocolor(255255255127), 1false)
    dxDrawLine(475*w583*h890*w583*htocolor(255255255127), 1false)
    dxDrawText("Zaloguj si?"475*w531*h890*w583*htocolor(255255255255), 1.00"clear""center""center"falsefalsefalsefalsefalse)
    dxDrawText("Zarejestruj si?"475*w584*h890*w636*htocolor(255255255255), 1.00"clear""center""center"falsefalsefalsefalsefalse)
    dxDrawText("Login:"527*w191*h839*w225*htocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
    dxDrawText("Has?o:"527*w355*h839*w389*htocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
end

addEventHandler("onClientResourceStart"resourceRoot, function()
    showGUI(true)
    fadeCamera(true)
    guiEditSetMasked(gui.passtrue)
    --setCameraMatrix2853.34911290.903811.39062846.64651290.672011.3906)
     smoothMoveCamera 2850.7278,1290.4128,11.39061468.388671875, -918.4247436523499.8818130493161500.8785400391, -919.25317382813100.153465271500.388671875, -918.4247436523499.8818130493161400014000 )
end)

addEvent("closePanel"true)
addEventHandler("closePanel"resourceRoot, function()
    showGUI(false)
end)



addEventHandler("onClientClick"root, function(btn,state)
    local login guiGetText(gui.login)
    local pass guiGetText(gui.pass)
    if guiGetVisible(gui.login) and guiGetVisible(gui.passthen
        if btn == "left" and state == "up" then
            if isMouseInPosition(475*w530*h415*w53*hthen
                triggerServerEvent("tryLogin"resourceRootloginpass)
            elseif isMouseInPosition(475*w583*h415*w53*hthen
                if #login >= 3 and #pass >= 3 then
                    triggerServerEvent("tryRegister"resourceRootloginpass)
                else
                    outputChatBox("* Login i/lub has?o musz? mie? minimalnie 3 znaki!")
                end
            end
        end
    end
end)

function showGUI(value)
    if value then
        showCursor(true)
        setPlayerHudComponentVisible("all"false)
        playSound("files/intro.mp3")
        addEventHandler("onClientRender"rootrenderDX)
        guiSetVisible(gui.logintrue)
        guiSetVisible(gui.passtrue)
    else
        showCursor(false)
        setPlayerHudComponentVisible("all"true)
        destroyElement(s)
        removeEventHandler("onClientRender"rootrenderDX)
        guiSetVisible(gui.loginfalse)
        guiSetVisible(gui.passfalse)
    end
end



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 >= and cx <= width) and (cy >= and cy <= heightthen
        return true
    else
        return false
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-21, 23:57


Barcioo

Kiedyś to było ST






Wiek: 26
Na forum: 4049 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1887

Respekt: 460
Respekt: 460

Vxen, kamera jest od startu skryptu a nie od kilku w zaloguj

Podpis
Kanał Youtube;
A tu zapraszam
, pomogłem Ci? Wynagrodź mnie :piwo: :)


SUPPORT TEAM- 2016-09-03 do 2018-05-25
Test Mod- 2018-05-25
1k dni na Forum - 2018-01-28


GG: 62111935
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-22, 00:06


Vxen







Wiek: 27
Na forum: 4086 dni
Posty: 293

Piwa: 1299

Respekt: 130,5
Respekt: 130,5

"Barcioo" napisał/a:

Vxen, kamera jest od startu skryptu a nie od kilku w zaloguj
No ok ale jak klikam zaloguj si? to nie spawnuje mi gracza

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-22, 00:10


Barcioo

Kiedyś to było ST






Wiek: 26
Na forum: 4049 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1887

Respekt: 460
Respekt: 460


Więcej informacji znajdziesz w Wikipedii MTA:

SpawnPlayer


[ Dodano: 2018-02-22, 00:13 ]
dodaj kod po stronie s

addEvent("spawnplayer",true)
addEventHandler("spawnplayer",getRootElement(),function(x,y,z)
spawnPlayer(client,x,y,z)
end)

ten kod po kilku w zaloguj

triggerServerEvent("spawnplayer"localPlayer,x,y,z)


Podpis
Kanał Youtube;
A tu zapraszam
, pomogłem Ci? Wynagrodź mnie :piwo: :)


SUPPORT TEAM- 2016-09-03 do 2018-05-25
Test Mod- 2018-05-25
1k dni na Forum - 2018-01-28


GG: 62111935
Postaw piwo autorowi tego posta
 

 
Tagi: smoothmovecamera
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