Isigar Posted February 27, 2023 Posted February 27, 2023 Přikladám malou funkci, která je užitečná pro získání jména hráče plus mít tag na uživatele. function findDiscordIdentifier(source) local discordId for _, id in ipairs(GetPlayerIdentifiers(source)) do if string.match(id, "discord:") then discordId = string.gsub(id, "discord:", "") end end return discordId end function getNameWithDiscordTag(playerId) local discordLicense = findDiscordIdentifier(playerId) if discordLicense then return string.format('%s <@%s>', GetPlayerName(playerId), discordLicense) end return GetPlayerName(playerId) end Vrací textový řetězec ve formátu SteamJméno <@DISCORD_ID> čili například Isigar <@DISCORD_ID> pak to na discordu vypadá takto 2 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.