example
example

资源 自适应卡脚本

fivem叮当

用户
高级用户
认证用户
黄金
21.00G
Lua:
local card_welcome = [[
{
    "type": "AdaptiveCard",
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.3",
    "body": [
        {
            "type": "Container",
            "spacing": "Large",
            "items": [
                {
                    "type": "TextBlock",
                    "size": "ExtraLarge",
                    "weight": "Bolder",
                    "color": "Accent",
                    "horizontalAlignment": "Center",
                    "text": "内容自定义",
                    "spacing": "Large"
                },
                {
                    "type": "TextBlock",
                    "text": "内容自定义",
                    "wrap": true,
                    "size": "Large",
                    "weight": "Bolder",
                    "color": "Good",
                    "horizontalAlignment": "Center",
                    "spacing": "Medium"
                },
                {
                    "type": "TextBlock",
                    "text": "内容自定义",
                    "wrap": true,
                    "size": "Default",
                    "weight": "Default",
                    "color": "Attention",
                    "horizontalAlignment": "Center",
                    "spacing": "Medium"
                },
                {
                    "type": "Image",
                    "url": "图片链接",
                    "size": "Medium",
                    "horizontalAlignment": "Center",
                    "spacing": "Medium",
                    "style": "Person"
                }
            ]
        },
        {
            "type": "Container",
            "spacing": "Large",
            "horizontalAlignment": "Center",
            "items": [
                {
                    "type": "ActionSet",
                    "horizontalAlignment": "Center",
                    "actions": [
                        {
                            "type": "Action.Submit",
                            "title": "🎮 ✅ 加入游戏",
                            "style": "positive",
                            "data": {
                                "action": "join_current_server"
                            }
                        },
                        {
                            "type": "Action.OpenUrl",
                            "title": "📢 加入我们的 KOOK 频道",
                            "style": "positive",
                            "url": "Q群链接"
                        },
                        {
                            "type": "Action.OpenUrl",
                            "title": "📱 加入我们的QQ群",
                            "style": "positive",
                            "url": "kook链接"
                        }
                    ],
                    "spacing": "Medium"
                }
            ]
        }
    ]
}
]]


-- 监听玩家连接事件
AddEventHandler("playerConnecting", function(name, setKickReason, deferrals)
    deferrals.defer() -- 暂停玩家连接
    Wait(500) -- 等待时间,确保卡片正常显示

    -- 展示美化后的欢迎卡片
    deferrals.presentCard(card_welcome, function(data)
        if data.action == "join_current_server" then
            deferrals.done() -- 允许玩家加入服务器
        else
            deferrals.done("内容自定义")
        end
    end)
end)
我看很多人需要
 
后退
顶部