Functions

Callback

tNet.Callback.Register


Registre um manipulador de eventos para responder às requisições do cliente.

tNet.Callback.Register(eventName, function(...)
    print(...)
end)
  • eventName: string

  • callback: function

tNet.Callback.Call


A corrotina atual fica pausada até chegar uma resposta.

local payload = tNet.Callback.Call(eventName, ...)
print(payload)
  • eventName: string


Character

tNet.FetchCharacterById


Requisita informações do jogador offline.

tNet.FetchCharacterById(characterId)
  • characterId: number

tNet.FetchCharacterMoney


Retorna uma tabela com inforamções financeiras do jogador.

local payload = tNet.FetchCharacterMoney(characterId)
print(payload.bank, payload.money, payload.coins)
  • characterId: number

tNet.FetchCharacterPhone


Retorna o telefone atual do jogador.

tNet.FetchCharacterPhone(characterId)
  • characterId: number

tNet.FetchCharacterLastLogin


Retorna o ultimo login do jogador.

tNet.FetchCharacterLastLogin(characterId)
  • characterId: number

tNet.FetchCharacterGroups


Retorna os grupos ativos do jogador.

tNet.FetchCharacterGroups(characterId)
  • characterId: number

tNet.FetchCharacterInventory


Retorna os items do inventário do jogador.

tNet.FetchCharacterInventory(characterId)
  • characterId: number

tNet.GetCharacterById


Retorna o objeto do jogador quando ativo.

tNet.GetCharacterById(characterId)
  • characterId: number

tNet.GetCharacterByPlayerSrc


Retorna o objeto do jogador quando ativo.

tNet.GetCharacterByPlayerSrc(playerSrc)
  • playerSrc: number

tNet.GetCharacterIdByPlayerSrc


Retorna o identificador do jogador quando ativo.

tNet.GetCharacterIdByPlayerSrc(playerSrc)
  • playerSrc: number

tNet.GetPlayerSrcByCharacterId


Retorna o source do jogador quando ativo.

tNet.GetPlayerSrcByCharacterId(characterId)
  • characterId: number

tNet.IsCharacterActive


Valida se o jogador está ativo no servidor.

tNet.IsCharacterActive(characterId)
  • characterId: number

tNet.GetCharacterNameById


Retorna o nome do jogador.

tNet.GetCharacterNameById(characterId)
  • characterId: number

tNet.ChangeCharacterNameById


Altera o nome do jogador.

tNet.ChangeCharacterNameById(characterId, firstName, lastName)
  • characterId: number

  • firstName?: string

  • lastName?: string

tNet.ChangeCharacterAgeById


Altera a idade do jogador.

tNet.ChangeCharacterAgeById(characterId, value)
  • characterId: number

  • value: number

tNet.DoesCharacterExist


Valida se o jogador existe no servidor.

tNet.DoesCharacterExist(characterId)
  • characterId: number

tNet.SaveCharacter


Salva as informações atuais do jogador no banco de dados.

tNet.SaveCharacter(characterId)
  • characterId: number

tNet.SaveCharacters


Salva as informações atuais de todos jogadores no banco de dados.

tNet.SaveCharacter()

tNet.SetCharacterBanned


Altera o estado de banido do jogador.

tNet.SetCharacterBanned(characterId, status)
  • characterId: number

  • status: boolean

tNet.SetCharacterData


Salva informação sobre o jogador em tnet_character_data.

tNet.SetCharacterData(characterId, index, data)
  • characterId: number

  • index: string

  • data: any

tNet.GetCharacterData


Retorna informação sobre o jogador que foram salvas em tnet_character_data.

tNet.GetCharacterData(characterId, index)
  • characterId: number

  • index: string

tNet.RemoveCharacterData


Remove informação sobre o jogador que foram salvas em tnet_character_data.

tNet.RemoveCharacterData(characterId, index)
  • characterId: number

  • index: string

tNet.ChangeCharacterId


Altera o identificador do jogador atual para o selecionado.

local status, message = tNet.ChangeCharacterId(characterId, newCharacterId)
print(status, message)
  • characterId: number

  • newCharacterId: number

Credentials

tNet.FetchCredentialsIdByIdentifiers


Retorna o id da credencial do jogador pelos identificadores.

tNet.FetchCredentialsIdByIdentifiers(playerIdentifiers)
  • playerIdentifiers: { license: string, discord: string, steam: string }

tNet.FetchCredentialsIdByCharacterId


Retorna o id da credencial do jogador pelo seu identificador.

tNet.FetchCredentialsIdByCharacterId(characterId)
  • characterId: number

tNet.FetchIdentifiersByCredentialsId


Retorna os identificadores de uma credencial.

tNet.FetchIdentifiersByCredentialsId(credentialId)
  • credentialId: number

tNet.IsCredentialIdBanned


Valida se a credencial está banida do servidor.

tNet.IsCredentialIdBanned(credentialId)
  • credentialId: number

tNet.SetCredentialIdBanned


Altera o estado de banimento da credencial.

tNet.SetCredentialIdBanned(credentialId)
  • credentialId: number

Discord

tNet.Discord.AddRole


Adiciona um cargo no discord para o jogador.

tNet.Discord.AddRole(characterId, roleId)
  • characterId: number

  • roleId: string

tNet.Discord.RemoveRole


Remove o cargo no discord para o jogador.

tNet.Discord.RemoveRole(characterId, roleId)
  • characterId: number

  • roleId: string

tNet.Discord.GetMember


Retorna as informações do discord do jogador.

tNet.Discord.GetMember(characterId)
  • characterId: number

tNet.Discord.UpdateName


Atualiza o nome do jogador no discord.

tNet.Discord.UpdateName(characterId)
  • characterId: number

Groups

tNet.GetGroups


Retorna todos os grupos registrados.

tNet.GetGroups()

tNet.GetGroupTypes


Retorna todos os tipos de grupos registrados.

tNet.GetGroupTypes()

tNet.GetGroupTypesByName


Retorna o tipo de grupo baseado no nome.

tNet.GetGroupTypesByName(name)
  • name: string

tNet.GetGroupById


Retorna o grupo baseado no identificador.

tNet.GetGroupById(id)
  • id: number

tNet.GetGroupNameById


Retorna o nome do grupo baseado no identificador.

tNet.GetGroupNameById(id)
  • id: number

tNet.GetGroupRoles


Retorna os cargos do grupo baseado no identificador.

tNet.GetGroupRoles(id)
  • id: number

tNet.GetGroupByName


Retorna o grupo baseado no nome.

tNet.GetGroupByName(name)
  • name: string

tNet.GetGroupIdByName


Retorna o identificador do grupo baseado no nome.

tNet.GetGroupIdByName(name)
  • name: string

tNet.GetGroupsByType


Retorna grupos baseado no tipo ou nome do grupo.

tNet.GetGroupsByType(id)
  • id: string | number

tNet.CreateGroup


Registra um novo grupo no sistema.

---@param ownerId? number
---@param name string
---@param type number
---@param label string
---@param image string
---@param max? number
---@param discordRole? number
---@param roles? array | { name: string, label: string, rank: number, salary: number, permissions?: object }
local groupId, errors = tNet.CreateGroup(data)
  • data: object

tNet.DeleteGroupById


Deleta o grupo pelo identificador.

tNet.DeleteGroupById(id)
  • id: number

tNet.GetGroupMembersByGroupType


Retorna todos o membros baseado no tipo do grupo.

tNet.GetGroupMembersByGroupType(groupType)
  • groupType: string

tNet.GetMembersByGroupName


Retorna todos o membros baseado no nome do grupo.

tNet.GetMembersByGroupName(groupName)
  • groupName: string

  • onlyActive: boolean

  • requiredRank?: number

tNet.IsCharacterGroupOwner


Retorna se o jogador é dono do grupo.

tNet.IsCharacterGroupOwner(groupId, characterId)
  • groupId: number | string

  • characterId: number

tNet.ChangeGroupImage


Altera a imagem do grupo.

tNet.ChangeGroupImage(groupId, image)
  • groupId: number | string

  • image: string

tNet.ChangeGroupName


Altera o nome do grupo.

tNet.ChangeGroupName(groupId, name)
  • groupId: number | string

  • name: string

tNet.AddGroupMoney


Adiciona dinheiro a conta do grupo.

tNet.AddGroupMoney(groupId, amount)
  • groupId: number

  • amount: number

tNet.RemoveGroupMoney


Remove dinheiro da conta do grupo.

tNet.RemoveGroupMoney(groupId, amount)
  • groupId: number

  • amount: number

Last updated