beast99 Posted July 15, 2019 Share Posted July 15, 2019 Bom Dia, estou tentando fazer um script, que quando o jogador morre, le apareça um painel DX, para poder selecionar o local de spawn, contudo, não consigo que o painel apareça, alguem me consegue ajudar? Código abaixo: PS: sou noob, não levem a sério minha programação, estou nas primeiras semanas de programação. Client_Side: local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) function AbrirDied () dxDrawImage(x*0, y*0, x*1366, y*768, "files/img/fundo2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEvent ( "OpenPainel", true) addEventHandler ( "OpenPainel", root, AbrirDied ) Server_Side: addEventHandler( "onPlayerWasted", getRootElement() ), function spawnls() setTimer( spawnPlayer, 2000, 1, source, 2035.90332, -1413.13599, 16.99219, 0, 0, 90} ) triggerClientEvent ( source, "AirNew>AbrirAgencia", root) end Link to comment
beast99 Posted July 15, 2019 Author Share Posted July 15, 2019 Peço desculpa por não ter usado o [Lua] Agora vai corretamente: Client_Side: [Lua]local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) function AbrirDied () dxDrawImage(x*0, y*0, x*1366, y*768, "files/img/fundo2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEvent ( "OpenPainel", true) addEventHandler ( "OpenPainel", root, AbrirDied )[/Lua] Server_Side: [Lua]addEventHandler( "onPlayerWasted", getRootElement() ), function spawnls() setTimer( spawnPlayer, 2000, 1, source, 2035.90332, -1413.13599, 16.99219, 0, 0, 90} ) triggerClientEvent ( source, "AirNew>AbrirAgencia", root) end [/Lua] Link to comment
Other Languages Moderators Lord Henry Posted July 15, 2019 Other Languages Moderators Share Posted July 15, 2019 Sinceramente, não sei qual a dificuldade em apertar 1 botão antes de colar o código. 1 Link to comment
beast99 Posted July 15, 2019 Author Share Posted July 15, 2019 não tinha reparado, sou novo aqui no forum como pode ver. Client_Side: local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) function AbrirDied () dxDrawImage(x*0, y*0, x*1366, y*768, "files/img/fundo2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEvent ( "OpenPainel", true) addEventHandler ( "OpenPainel", root, AbrirDied ) Server_Side: addEventHandler( "onPlayerWasted", getRootElement() ), function spawnls() setTimer( spawnPlayer, 2000, 1, source, 2035.90332, -1413.13599, 16.99219, 0, 0, 90} ) triggerClientEvent ( source, "AirNew>AbrirAgencia", root) end agora está correto, desculpe pelo incomodo. Link to comment
Other Languages Moderators Lord Henry Posted July 15, 2019 Other Languages Moderators Share Posted July 15, 2019 (edited) Esse seu triggerClientEvent não faz sentido. Esse evento não existe em lugar nenhum. Edited July 15, 2019 by Lord Henry 1 Link to comment
beast99 Posted July 15, 2019 Author Share Posted July 15, 2019 Como poderia fazer isso? Tenho o gosto de aprender. Link to comment
Other Languages Moderators Lord Henry Posted July 15, 2019 Other Languages Moderators Share Posted July 15, 2019 Você poderia manter o render do painel e só mostrar ele quando o player estiver morto. local screenW, screenH = guiGetScreenSize () local x, y = (screenW/1366), (screenH/768) function AbrirDied () if isPedDead (localPlayer) then dxDrawImage (x*0, y*0, x*1366, y*768, "files/img/fundo2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end end addEventHandler ("onClientRender", root, AbrirDied) Link to comment
beast99 Posted July 15, 2019 Author Share Posted July 15, 2019 1 minute ago, Lord Henry said: Você poderia manter o render do painel e só mostrar ele quando o player estiver morto. local screenW, screenH = guiGetScreenSize () local x, y = (screenW/1366), (screenH/768) function AbrirDied () if isPedDead (localPlayer) then dxDrawImage (x*0, y*0, x*1366, y*768, "files/img/fundo2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end end addEventHandler ("onClientRender", root, AbrirDied) Sim sim. Está ai o link dela: https://imgur.com/a/0c5Bt71 No seu script, o painel apenas fica pouco tempo aberto, eu queria que ele ficasse infinitamente.. Link to comment
Other Languages Moderators Lord Henry Posted July 15, 2019 Other Languages Moderators Share Posted July 15, 2019 24 minutes ago, mesadown said: No seu script, o painel apenas fica pouco tempo aberto, eu queria que ele ficasse infinitamente.. local sX, sY = guiGetScreenSize () function renderPanel () dxDrawImage (0, 0, sX, sY, "files/img/fundo2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end function startRender () addEventHandler ("onClientRender", root, renderPanel) end addEventHandler ("onClientPlayerWasted", localPlayer, startRender) Ta ae. 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