Jump to content

text


Desaster

Recommended Posts

you can do this for serverside. Triggers the client event showChat, when a player logs in. Since you need showChat as a client side function, you have to use triggerClientEvent.

Server

function showChat() 
triggerClientEvent("showChat", getRootElement) 
end 
addEventHandler("onPlayerLogin",getRootElement(),showChat) 

Client

function showChat() 
showChat(true) 
end 
addEvent("showChat", true) 
addEventHandler("showChat",getRootElement(), showChat) 

Didnt test, should work fine though.

Edited by Guest
Link to comment
in this type of script, he needed it as a clientside. i said it kinda wrong, but true, ill edit the post in a sec.

It could be on the server-side by simply using the player the is logging in.

addEventHandler ( "onPlayerLogin", root, function ( ) 
   showChat ( source, true ) 
end ) 
  
addEventHandler ( "onPlayerJoin", root, function ( ) 
    showChat ( source, false ) 
end ) 

Link to comment
  • Moderators

As far I can see, the topbarchat doesn't let you show or hide it, maybe you will have to create a new exported function to the tobachat resource to let you get control on this (and probably a variable that you will use in an if statement you will have to add too in the render function).

If you don't see what I mean, xXMADEXx will probably add this feature four you.

Link to comment
  • Discord Moderators

The way I understand this - you want to disable the chatbox and use the topbarchat resource instead?

According to this page on community,

Serverside:

  
addEventHandler ('onPlayerLogin', root, 
    function () 
        showChat (source, false) 
        exports.topbarchat:sendClientMessage ('Thank you for logging in', source, 255, 255, 255) 
    end 
) 
  

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