Neler yeni

Foruma hoş geldin, Ziyaretçi

Forum içeriğine ve tüm hizmetlerimize erişim sağlamak için foruma kayıt olmalı ya da giriş yapmalısınız. Foruma üye olmak tamamen ücretsizdir.

Türkiye'nin İlk ve tek FiveM forum adresi

Forum adresimize hoş geldin FiveMTürk olarak amacımız siz değerli kullanıcılarımıza en aktif fikir ve paylaşım platformu sunmak bir yana en güvenilir şekilde alışveriş yapabileceğiniz bir platform sunmaktır.
DF DF
DF DF
DF DF

Soru DiscordWhitelist herşey doğru olduğu halde giriş yapamıyoruz.

  • Konbuyu başlatan simolf
  • Başlangıç tarihi
  • Cevaplar 11
  • Görüntüleme 460

simolf

Üye
FT Kullanıcı
Katılım
1 yıl 6 ay 26 gün
Mesajlar
34
DiscordWhitelist herşey doğru olduğu halde giriş yapamıyoruz.
Whitelisted rolüne bağladım, ilk günler çalışıyordu fakat bi ara ensure'sini kaldırdım bakım için. geri eklediğimde rolü görmemeye başladı.
Rol olsa bile kullanıcılar giriş yapamıyor sebebi ne olabilr?
 
DF
kodlarını atman lazım discord permlerinin idleri de at
 
DF
Kod:
---------------------------------------------------------------------------
-------------ASQP DEVELOPMENNT TARAFINDAN GELİŞTİRİLDİ---------------------
---------------------------------------------------------------------------

-- Documentation: https://discord.gg/Tr8hVf5
--- Config ---
notWhitelistedMessage = "Lütfen discorda giriş yapınız. discord.gg/foxrp" -- Message displayed when they are not whitelist with the role

whitelistRoles = { -- Role nickname(s) needed to pass the whitelist
    "1085526883648667658"
}

--- Code ---

AddEventHandler("playerConnecting", function(name, setCallback, deferrals)
    local src = source
    local passAuth = false
    deferrals.defer()
    deferrals.update("Checking Permissions...")

    for k, v in ipairs(GetPlayerIdentifiers(src)) do
        if string.sub(v, 1, string.len("discord:")) == "discord:" then
            identifierDiscord = v
        end
    end

    if identifierDiscord then
        usersRoles = exports.discord_perms:GetRoles(src)
        local function has_value(table, val)
            if table then
                for index, value in ipairs(table) do
                    if value == val then
                        return true
                    end
                end
            end
            return false
        end
        for index, valueReq in ipairs(whitelistRoles) do
            if has_value(usersRoles, valueReq) then
                passAuth = true
            end
            if next(whitelistRoles,index) == nil then
                if passAuth == true then
                    deferrals.done()
                else
                    deferrals.done(notWhitelistedMessage)
                end
            end
        end
    else
        deferrals.done("Discord was not detected. Please make sure Discord is running and installed. See the below link for a debugging process - docs.faxes.zone/docs/debugging-discord")
    end
end)
 
DF
Kod:
---------------------------------------------------------------------------
-------------ASQP DEVELOPMENNT TARAFINDAN GELİŞTİRİLDİ---------------------
---------------------------------------------------------------------------

-- Documentation: https://discord.gg/Tr8hVf5
--- Config ---
notWhitelistedMessage = "Lütfen discorda giriş yapınız. discord.gg/foxrp" -- Message displayed when they are not whitelist with the role

whitelistRoles = { -- Role nickname(s) needed to pass the whitelist
    "1085526883648667658"
}

--- Code ---

AddEventHandler("playerConnecting", function(name, setCallback, deferrals)
    local src = source
    local passAuth = false
    deferrals.defer()
    deferrals.update("Checking Permissions...")

    for k, v in ipairs(GetPlayerIdentifiers(src)) do
        if string.sub(v, 1, string.len("discord:")) == "discord:" then
            identifierDiscord = v
        end
    end

    if identifierDiscord then
        usersRoles = exports.discord_perms:GetRoles(src)
        local function has_value(table, val)
            if table then
                for index, value in ipairs(table) do
                    if value == val then
                        return true
                    end
                end
            end
            return false
        end
        for index, valueReq in ipairs(whitelistRoles) do
            if has_value(usersRoles, valueReq) then
                passAuth = true
            end
            if next(whitelistRoles,index) == nil then
                if passAuth == true then
                    deferrals.done()
                else
                    deferrals.done(notWhitelistedMessage)
                end
            end
        end
    else
        deferrals.done("Discord was not detected. Please make sure Discord is running and installed. See the below link for a debugging process - docs.faxes.zone/docs/debugging-discord")
    end
end)
kodlarını atman lazım discord permlerinin idleri de at
perm'in id'i mevcut 1085526883648667658
 
DF
configi de at
discord idlerini ve guild idsini de
 
DF
Kod:
Config = {
    DiscordToken = "gizledim",
    GuildId = "1084410369885360149",

    -- Format: ["Role Nickname"] = "Role ID" You can get role id by doing \@RoleName
    Roles = {
        ["Whitelisted"] = "Some Role ID" -- This would be checked by doing exports.discord_perms:IsRolePresent(user, "Whitelisted")
    }
}
 
DF
some role id yazan yer boş
 
DF
iki script startliyorsun dimi
 
DF
Kod:
---------------------------------------------------------------------------
-------------ASQP DEVELOPMENNT TARAFINDAN GELİŞTİRİLDİ---------------------
---------------------------------------------------------------------------

-- Documentation: https://discord.gg/Tr8hVf5
--- Config ---
notWhitelistedMessage = "Lütfen discorda giriş yapınız. discord.gg/foxrp" -- Message displayed when they are not whitelist with the role

whitelistRoles = { -- Role nickname(s) needed to pass the whitelist
    "1085526883648667658"
}

--- Code ---

AddEventHandler("playerConnecting", function(name, setCallback, deferrals)
    local src = source
    local passAuth = false
    deferrals.defer()
    deferrals.update("Checking Permissions...")

    for k, v in ipairs(GetPlayerIdentifiers(src)) do
        if string.sub(v, 1, string.len("discord:")) == "discord:" then
            identifierDiscord = v
        end
    end

    if identifierDiscord then
        usersRoles = exports.discord_perms:GetRoles(src)
        local function has_value(table, val)
            if table then
                for index, value in ipairs(table) do
                    if value == val then
                        return true
                    end
                end
            end
            return false
        end
        for index, valueReq in ipairs(whitelistRoles) do
            if has_value(usersRoles, valueReq) then
                passAuth = true
            end
            if next(whitelistRoles,index) == nil then
                if passAuth == true then
                    deferrals.done()
                else
                    deferrals.done(notWhitelistedMessage)
                end
            end
        end
    else
        deferrals.done("Discord was not detected. Please make sure Discord is running and installed. See the below link for a debugging process - docs.faxes.zone/docs/debugging-discord")
    end
end)
1679067975868.png
oku bakim ne yazıyo
 
DF

Forumdan daha fazla yararlanmak için giriş yapın yada üye olun!

Forumdan daha fazla yararlanmak için giriş yapın veya kayıt olun!

Kayıt ol

Forumda bir hesap oluşturmak tamamen ücretsizdir.

Şimdi kayıt ol
Giriş yap

Eğer bir hesabınız var ise lütfen giriş yapın

Giriş yap

Bu konuyu görüntüleyen kullanıcılar

Tema düzenleyici

Tema özelletirmeleri

Granit arka planlar

Lütfen Javascript'i etkinleştirin!Javascript'i etkinleştirin!