Jump to content

Hide the chat


Recommended Posts

That's my 3° post here :oops:

My ask is:

How to hide the chat while the people is in login panel??

I've a login panel in my server, my username start with ''t'' and always i press it, i write my username in mainchat :?

I can hide the chat while the people is in login panel??

THANKS GUYS :mrgreen:

Link to comment

--[[----------------------------------------------------

-- server script main

-- @author Banex

-- @update 25/03/2016

----------------------------------------------------]]--

function PlayerLogin(username,password)

if username == "" then

return triggerClientEvent(source,"login_text",source,"error","Coloque seu nome de usuario!")

end

if password == "" then

return triggerClientEvent(source,"login_text",source,"error","Coloque sua senha!")

end

local account = getAccount ( username, password )

if account == false then

return triggerClientEvent(source,"login_text",source,"error","Nome de usuario ou senha incorretos!")

end

logIn(source, account, password)

triggerClientEvent(source,"onLogin",source)

triggerClientEvent(source,"saveLoginToXML",source,username)

triggerClientEvent(source,"login_text",source,"sucess","Logado com sucesso!")

end

addEvent("onRequestLogin",true)

addEventHandler("onRequestLogin",getRootElement(),PlayerLogin)

function registerPlayer(username,password)

if username == "" then

return triggerClientEvent(source,"login_text",source,"error","Coloque seu nome de usuario!")

end

if password == "" then

return triggerClientEvent(source,"login_text",source,"error","Coloque sua senha!")

end

local account = getAccount (username,password)

if account then

return triggerClientEvent(source,"login_text",source,"error","Este nome de usuario já esta sendo usado!")

end

local accountAdded = addAccount(tostring(username),tostring(password))

if not accountAdded then

return triggerClientEvent(source,"login_text",source,"error","Erro! Tente novamente com um novo nome de usuario ou senha!")

end

outputChatBox ("[usuario: #FFFFFF" .. username .. " #00FF00| Senha: #FFFFFF" .. password .. "#00FF00 ]",source,255,255,255,true)

triggerClientEvent(source,"onRegister",source)

triggerClientEvent(source,"login_text",source,"sucess","Conta criada com sucesso!")

end

addEvent("onRequestRegister",true)

addEventHandler("onRequestRegister",getRootElement(),registerPlayer)

Link to comment

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...