Exports

txLogin offers exports for both server and client side, with the possibility to use these in your own scripts, some examples will be given down below. First, just in short, the exports.

exports['txLogin']:isLoggedIn() -- CLIENT
exports['txLogin']:isLoggedIn(source) -- SERVER

By using these exports we can create a block in events, commands, functions or whatever needs to be stopped when a staff member is not logged in.

For example:

if not exports['txLogin']:isLoggedIn() then return end

This simply blocks anything happening after this if the player is not logged into the txLogin, the same goes for the server side, with just the little change. Let's also add a simple notification into it. In case you want to display a message when the request gets denied.

if not exports['txLogin']:isLoggedIn() then
    Notify('inform', 3000, 'txLogin', 'You must be logged in to do this!')
    return
end

Also, if any help is needed I'm always glad to help in a ticket in the discord linked in the Links section!

Last updated