ZaaKScripter Posted October 23, 2020 Share Posted October 23, 2020 Opa, rapaziada, estou tentando criar um painel de login animado em que a camera fica passando pelo mapa de LS enquanto o player esta na tela de login, a função da camera ja consegui desenvolver, porem não sei como fazer pra parar essa animação após o player fazer login, se alguem puder me ajudar agradeço muito. Função da animação abaixo: camera = { [1] = { 1240.27661, -936.21216, 150.21532, 1984.46826, -592.69513, 92.62204, 1465.44849, -807.80768, 87.80418}, [2] = { 2953.32007, -2079.47217, 80.95277, 2902.98071, -2083.04590, 2.02448, 2899.27417, -2082.65625, 2.50801} } local iCamera = 1 local dx = 0.0 function interpolateCam() if iCamera == 1 then dx = dx + 0.0001 local ix, iy, iz = interpolateBetween(camera[iCamera][1], camera[iCamera][2], camera[iCamera][3], camera[iCamera][4], camera[iCamera][5], camera[iCamera][6], dx, "Linear") setCameraMatrix(ix, iy, iz, camera[iCamera][7], camera[iCamera][8], camera[iCamera][9] ) elseif iCamera == 2 then dx = dx + 0.0080 local ix, iy, iz = interpolateBetween(camera[iCamera][1], camera[iCamera][2], camera[iCamera][3], camera[iCamera][4], camera[iCamera][5], camera[iCamera][6], dx, "Linear") setCameraMatrix(ix, iy, iz, camera[iCamera][7], camera[iCamera][8], camera[iCamera][9] ) end end addEventHandler("onClientRender", root, interpolateCam) Link to comment
Angelo Pereira Posted October 23, 2020 Share Posted October 23, 2020 Você vai precisar do lado server-side, utilizar o evento "onPlayerLogin", e enviar um trigger event para o client-side. Ex : -- server-side addEventHandler("onPlayerLogin", root, function ( ) triggerClientEvent ( source, "PainelLogin:RemoverAnimacao", resourceRoot ) end) -- client-side addEvent("PainelLogin:RemoverAnimacao", true) addEventHandler("PainelLogin:RemoverAnimacao", resourceRoot, function ( ) removeEventHandler ( ) end) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now