Jump to content

DASHBOARD (SCRIPT)


Recommended Posts

Posted

Estou a tentar fazer um script de dashboard , alguem me ajuda??

Queria que ele tivesse as seguintes indicaçoes:

-Quando o player entra no server ou morre ele volta sempre para o dashboard;

-O dashboard tem que dar para o player escolher skin e armamento; 

-E que tenha tambem o "botao" de spawn no ceu de paraquedas.

 

Imagem de exemplo: http://prntscr.com/huimp0

  • Moderators
Posted

O que vc já tentou fazer?

Vc vai precisar das funções de onPlayerLogin, onPlayerWasted, setElementPosition, setElementModel, giveWeapon, setPedArmour. Além de guiCreateButton, onClientGUIClick, triggerServerEvent.

  • Thanks 1

Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanksspacer.png

Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile
Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment
Discord Oficial do MTA: https://mtasa.com/discord
Blacklist e Whitelist de Scripters: Planilha

Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.

  • 2 weeks later...
Posted

Mudei de ideias queria fazer um painel de entrada com:

-Quando o player entra no server ou morre ele volta sempre para o painel;

-O dashboard tem que dar para o player escolher skin; 

-Que o player consiga ter todas as armas consigo ao spawnar;

-E que tenha tambem o "botao" de spawn no ceu de paraquedas.

 

Imagem de exemplo: http://prntscr.com/hzziv1

  • Moderators
Posted

Server-side:

function playerLogou (previousAcc, currentAcc)
    triggerClientEvent (source, "showPanel", getRootElement())
end
addEventHandler ("onPlayerLogin", getRootElement(), playerLogou)

function playerMorreu (ammo, attacker, weapon, bodypart)
    triggerClientEvent (source, "showPanel", getRootElement())
end
addEventHandler ("onPlayerWasted", getRootElement(), playerMorreu)

function setStuff ()
	giveWeapon (client, 46, 1, true)
	setElementPosition (client, 0, 0, 300, true)
end
addEvent ("spawnMe", true)
addEventHandler ("spawnMe", getRootElement(), setStuff)

Client-side:

mainWindow = guiCreateWindow (0.1, 0.4, 0.2, 0.3, "Seleção de Skin", true)
spawnButton = guiCreateButton (0.25, 0.8, 0.5, 0.2, "spawn", true, mainWindow)
guiSetVisible (mainWindow, false)
guiWindowSetSizable (mainWindow, false)

function mostraOcultaPainel ()
    if guiGetVisible (mainWindow) then
        guiSetVisible (mainWindow, false)
    else
        guiSetVisible (mainWindow, true)
    end
end
addEvent ("showPanel", true)
addEventHandler ("showPanel", getRootElement(), mostraOcultaPainel)

function clickEvents (button)
    if button ~= 'left' then
        return false
    end
    if source == spawnButton then
        mostraOcultaPainel()
		triggerServerEvent("spawnMe", localPlayer)
    end
end
addEventHandler ("onClientGUIClick", root, clickEvents)

O resto é com vc. Aprenda a construir o painel e a inserir funções nos botões.

Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanksspacer.png

Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile
Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment
Discord Oficial do MTA: https://mtasa.com/discord
Blacklist e Whitelist de Scripters: Planilha

Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...