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

Wysłany: 2020-12-12, 00:51


Haverrak12







Wiek: 32
Na forum: 2161 dni
Posty: 8
Nick w MP: hahaha



Respekt: 50

Ostrzeżeń: 60%
Witam! pr?bowa?em ju? du?o razy na wiele razy XDDD wiem ?e to jest proste ale nigdy nie bawi?em ise takimi kamerami. Trzeba mi zamieni? SetMatrixCamera na smoothMoveCamera(2656.0268554688, -1755.9916992188, 37.880844116211, 2755.3369140625, -1758.2503662109, 26.374568939209, 2812.7878417969, -1764.4494628906, 50.781707763672, 2909.6337890625, -1770.3770751953, 26.579612731934, 8500) jak by to zrobi? jaka? podpowiedz?
(na dole jest zaznaczone takimi -------- gdzie jest ten matrix

Z g?ry dzi?ki jak kto? pomo?e
dam piwo da? bym jeszcze respekt ale mam za ma?o post?w

Og?lnie to chodzi mi o to ?eby w tle panelu logowania nie by?o obrazu w jednym miejscu tylko ?adne lataj?ce kamery





klient logowania

if getElementData(localPlayer"player:sid"then return end

local root getRootElement()
local resourceRoot getResourceRootElement(getThisResource())
local screenWidthscreenHeight guiGetScreenSize()


local blurStrength 20


local myScreenSource dxCreateScreenSource(screenWidthscreenHeight)
blurShaderblurTec dxCreateShader("shaders/BlurShader.fx")


function renderblur()
    if blur == true then
        dxUpdateScreenSource(myScreenSource)
        
        dxSetShaderValue(blurShader"ScreenSource"myScreenSource);
        dxSetShaderValue(blurShader"BlurStrength"blurStrength);
        dxSetShaderValue(blurShader"UVSize"screenWidthscreenHeight);

        dxDrawImage(00screenWidthscreenHeightblurShader)
    end
end
addEventHandler("onClientRender"rootrenderblur)

addEventHandler("onClientResourceStop"resourceRoot,
function()
    if (blurShaderthen
        destroyElement(blurShader)
        blurShader nil
    end
end)

x,y=2513.581282.80-- my width
intro_step=math.random(0,850)

local sx,sy=guiGetScreenSize()
local data={ showed=nilbutton={}, info=nilmisc=nil, }

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
local dist 100
local angler 0
function getPointFromDistanceRotation(xydistangler)
    local a math.rad(90 angler)
    local dx math.cos(a) * dist;
    local dy math.sin(a) * dist;
    return x+dxy+dy;
end




function renderLoginBox()
    dxDrawRectangle(sx*0/1025sy*0/769sx*320/1025sy*958/767tocolor(000185), false)
    if data.info then dxDrawText(data.infosx*-230/1024sy*272/768sx*565/1024sy*290/768tocolor(2552550255), 1.00"default""center""center"falseend
    dxDrawText("Nazwa u?ytkownika"sx*-240/1024sy*410/768sx*565/1024sy*325/768white1.30"default-bold""center""center"false)
    dxDrawText("Has?o"sx*-240/1024sy*590/768sx*565/1024sy*302/768white1.30"default-bold""center""center"false)
    if not isMouseIn(sx*60/1024sy*565/768sx*200/1024sy*35/768then dxDrawRectangle(sx*60/1024sy*565/768sx*200/1024sy*35/768tocolor(255,255,255170), false)
    else dxDrawRectangle(sx*56/1024sy*565/768sx*208/1024sy*35/768tocolor(255,255,255230), falseend
    if not isMouseIn(sx*60/1024sy*615/768sx*200/1024sy*35/768then dxDrawRectangle(sx*60/1024sy*615/768sx*200/1024sy*35/768tocolor(255,255,255170), false)
    else dxDrawRectangle(sx*56/1024sy*615/768sx*208/1024sy*35/768tocolor(255,255,255230), falseend
    dxDrawText("Z a l o g u j  s i ?"sx*-240/1024sy*1120/768sx*565/1024sy*45/768tocolor(0,0,0,255), 1.10"default-bold""center""center"false)
    dxDrawText("Z a r e j e s t r u j  s i ?"sx*-240/1024sy*1220/768sx*565/1024sy*45/768tocolor(0,0,0,255), 1.10"default-bold""center""center"false)
    

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        local x,y=getPointFromDistanceRotation(1413.581082.80distangler)
        setCameraMatrix(-2732.20, -7.3918.80)
    angler=(angler+0.1)
end

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------






addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(sx*60/1024sy*565/768sx*200/1024sy*35/768) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < or string.len(pass) < 2 then
                data.info="Nale?y wype?ni? wszystkie pola."
                return
            end
            triggerServerEvent("logging:checkAccount"resourceRootloginpass)
        end
        if isMouseIn(sx*60/1024sy*615/768sx*200/1024sy*35/768) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < or string.len(pass) < 3 then
                data.info="Login i has?o powinno zawiera? od 3 do 22 znak?w."
                return
            end
            triggerServerEvent("logging:newAccount"resourceRootloginpass)
        end
    end
end)

addEvent("logging:result"true)
addEventHandler("logging:result"resourceRoot, function(value,info)
    if not info then info="" end
    if value then
        data.showed=false
        showZones(data.misc)
        
        -- Usuwamy elementy
        destroyElement(data.button[1])
        destroyElement(data.button[2])
        removeEventHandler("onClientRender"rootrenderLoginBox)
    else
        data.info=tostring(info)
        setTimer(function() data.info=nil end30001)
    end
end)

addEventHandler("onClientResourceStart"resourceRoot, function()
    showChat(false)
    showCursor(true)
    fadeCamera(true)
    data.showed=true
    setElementAlpha(localPlayer,0)
    data.misc=playSound("misc/intro.mp3",true)
    showPlayerHudComponent("radar",false)
    setSoundVolume(data.misc1.0)
    showPlayerHudComponent("all",false)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje si?")
    --setElementData(localPlayer,"player:logged",false)
    addEventHandler("onClientRender"rootrenderLoginBox)
    local nick getPlayerNamelocalPlayer )
    data.button[1]=guiCreateEdit(0.0450.500.220.04""..nick..""true)
    data.button[2]=guiCreateEdit(0.0450.600.220.04""true)   
    guiEditSetMasked(data.button[2],true)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-12, 16:21


EnoNeK







Wiek: 21
Na forum: 3287 dni
Posty: 39
Nick w MP: EnoNeK

Piwa: 54

Respekt: 200
Respekt: 200Respekt: 200

Nie masz kodu z wiki mta od smoothMoveCamera wi?c
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)
    else
        removeEventHandler("onClientPreRender",root,camRender)
    end
end

 
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)
        setElementCollisionsEnabled (sm.object1,false) 
    setElementCollisionsEnabled (sm.object2,false) 
    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)
    addEventHandler("onClientPreRender",root,camRender)
    return true
end

-- i w funkcji
function smoothCamera()
smoothMoveCamera(2656.0268554688, -1755.991699218837.8808441162112755.3369140625, -1758.250366210926.3745689392092812.7878417969, -1764.449462890650.7817077636722909.6337890625, -1770.377075195326.5796127319348500)
end


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Haverrak12
Wysłany: 2020-12-12, 23:40


Haverrak12







Wiek: 32
Na forum: 2161 dni
Posty: 8
Nick w MP: hahaha



Respekt: 50

Ostrzeżeń: 60%
EnoXo132, jak by to wklei? do skeryptu w kt?rym miejscu? gdy to wklejam do skryptu to wcale nie dzia?a panel logowania wyskakuje czarny ekran i nic nie ma zeby sie zalogowac i nie ma t?a tego prosz? o przes?anie smoothMoveCamera ju? w panelu logowania zebym wiedzia? na przysz?o?? gdzie to si? wkleja i jak to sie robi. (EnXo132 dosta?e? piwo xd)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-13, 15:25


EnoNeK







Wiek: 21
Na forum: 3287 dni
Posty: 39
Nick w MP: EnoNeK

Piwa: 54

Respekt: 200
Respekt: 200Respekt: 200

W przypadku twojego kodu od logowania:
if getElementData(localPlayer"player:sid"then return end

local root getRootElement()
local resourceRoot getResourceRootElement(getThisResource())
local screenWidthscreenHeight guiGetScreenSize()


local blurStrength 20


local myScreenSource dxCreateScreenSource(screenWidthscreenHeight)
blurShaderblurTec dxCreateShader("shaders/BlurShader.fx")


function renderblur()
    if blur == true then
        dxUpdateScreenSource(myScreenSource)
        
        dxSetShaderValue(blurShader"ScreenSource"myScreenSource);
        dxSetShaderValue(blurShader"BlurStrength"blurStrength);
        dxSetShaderValue(blurShader"UVSize"screenWidthscreenHeight);

        dxDrawImage(00screenWidthscreenHeightblurShader)
    end
end
addEventHandler("onClientRender"rootrenderblur)

addEventHandler("onClientResourceStop"resourceRoot,
function()
    if (blurShaderthen
        destroyElement(blurShader)
        blurShader nil
    end
end)

x,y=2513.581282.80-- my width
intro_step=math.random(0,850)

local sx,sy=guiGetScreenSize()
local data={ showed=nilbutton={}, info=nilmisc=nil, }

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
local dist 100
local angler 0
function getPointFromDistanceRotation(xydistangler)
    local a math.rad(90 angler)
    local dx math.cos(a) * dist;
    local dy math.sin(a) * dist;
    return x+dxy+dy;
end




function renderLoginBox()
    dxDrawRectangle(sx*0/1025sy*0/769sx*320/1025sy*958/767tocolor(000185), false)
    if data.info then dxDrawText(data.infosx*-230/1024sy*272/768sx*565/1024sy*290/768tocolor(2552550255), 1.00"default""center""center"falseend
    dxDrawText("Nazwa u?ytkownika"sx*-240/1024sy*410/768sx*565/1024sy*325/768white1.30"default-bold""center""center"false)
    dxDrawText("Has?o"sx*-240/1024sy*590/768sx*565/1024sy*302/768white1.30"default-bold""center""center"false)
    if not isMouseIn(sx*60/1024sy*565/768sx*200/1024sy*35/768then dxDrawRectangle(sx*60/1024sy*565/768sx*200/1024sy*35/768tocolor(255,255,255170), false)
    else dxDrawRectangle(sx*56/1024sy*565/768sx*208/1024sy*35/768tocolor(255,255,255230), falseend
    if not isMouseIn(sx*60/1024sy*615/768sx*200/1024sy*35/768then dxDrawRectangle(sx*60/1024sy*615/768sx*200/1024sy*35/768tocolor(255,255,255170), false)
    else dxDrawRectangle(sx*56/1024sy*615/768sx*208/1024sy*35/768tocolor(255,255,255230), falseend
    dxDrawText("Z a l o g u j  s i ?"sx*-240/1024sy*1120/768sx*565/1024sy*45/768tocolor(0,0,0,255), 1.10"default-bold""center""center"false)
    dxDrawText("Z a r e j e s t r u j  s i ?"sx*-240/1024sy*1220/768sx*565/1024sy*45/768tocolor(0,0,0,255), 1.10"default-bold""center""center"false)
    

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        local x,y=getPointFromDistanceRotation(1413.581082.80distangler)
        setCameraMatrix(-2732.20, -7.3918.80)
    angler=(angler+0.1)
end

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------






addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(sx*60/1024sy*565/768sx*200/1024sy*35/768) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < or string.len(pass) < 2 then
                data.info="Nale?y wype?ni? wszystkie pola."
                return
            end
            triggerServerEvent("logging:checkAccount"resourceRootloginpass)
        end
        if isMouseIn(sx*60/1024sy*615/768sx*200/1024sy*35/768) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < or string.len(pass) < 3 then
                data.info="Login i has?o powinno zawiera? od 3 do 22 znak?w."
                return
            end
            triggerServerEvent("logging:newAccount"resourceRootloginpass)
        end
    end
end)

addEvent("logging:result"true)
addEventHandler("logging:result"resourceRoot, function(value,info)
    if not info then info="" end
    if value then
        data.showed=false
        showZones(data.misc)
        
        -- Usuwamy elementy
        destroyElement(data.button[1])
        destroyElement(data.button[2])
        removeEventHandler("onClientRender"rootrenderLoginBox)
    else
        data.info=tostring(info)
        setTimer(function() data.info=nil end30001)
    end
end)

addEventHandler("onClientResourceStart"resourceRoot, function()
    showChat(false)
    showCursor(true)
    fadeCamera(true)
    data.showed=true
    setElementAlpha(localPlayer,0)
    data.misc=playSound("misc/intro.mp3",true)
    showPlayerHudComponent("radar",false)
    setSoundVolume(data.misc1.0)
    showPlayerHudComponent("all",false)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje si?")
    --setElementData(localPlayer,"player:logged",false)
    addEventHandler("onClientRender"rootrenderLoginBox)
    local nick getPlayerNamelocalPlayer )
    data.button[1]=guiCreateEdit(0.0450.500.220.04""..nick..""true)
    data.button[2]=guiCreateEdit(0.0450.600.220.04""true)   
    guiEditSetMasked(data.button[2],true)
    smoothMoveCamera(2656.0268554688, -1755.991699218837.8808441162112755.3369140625, -1758.250366210926.3745689392092812.7878417969, -1764.449462890650.7817077636722909.6337890625, -1770.377075195326.5796127319348500)
end)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Haverrak12
Tagi: jak :: zamienić :: setmatrixcamera :: smoothmovecamera :: skrypt?
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » jak zamienić setmatrixcamera na smoothmovecamera w skrypt? Odpowiedz do tematu

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