example
example

已解决√ 求助 QB-SPAWN 在VMS多角色插件生成人物后不工作

状态
此线程已解决! 转到解决方案...

HaoEr2047

哀殿天下第一
论坛元老
高级用户
认证用户
报错如图所示
1721133553275.png
这个UI的情况我也没找到好办法
 

HaoEr2047

哀殿天下第一
论坛元老
高级用户
认证用户
1721134646710.png
目前发现的报错,即使换了最新的spawn也是这样
 

Yann

站长
管理成员
GTAOS管理组
认证卖家
认证用户
本 月 名 人 榜 最 佳
检查html文件是否有
<script src="vue.js"></script>

JavaScript:
const viewmodel = new Vue({
                el: "#app",
                vuetify: new Vuetify(),
                data: {
                    positions: {
                        normal: [],
                        appartment: [],
                        house: [],
                    },

                    selectedValue: {
                        type: "",
                        name: ""
                    },

                    newChar: false,
                    show: false,
                    translations: {}
                },
fxmanifest.lua是否有
'html/vue.js'

如果和我一样还有问题你就得联系你的插件出售者了,他们如果没有解决方案,那就没办法了,他们的脚本都是加密的。
 

HaoEr2047

哀殿天下第一
论坛元老
高级用户
认证用户
检查html文件是否有
<script src="vue.js"></script>

JavaScript:
const viewmodel = new Vue({
                el: "#app",
                vuetify: new Vuetify(),
                data: {
                    positions: {
                        normal: [],
                        appartment: [],
                        house: [],
                    },

                    selectedValue: {
                        type: "",
                        name: ""
                    },

                    newChar: false,
                    show: false,
                    translations: {}
                },
fxmanifest.lua是否有
'html/vue.js'

如果和我一样还有问题你就得联系你的插件出售者了,他们如果没有解决方案,那就没办法了,他们的脚本都是加密的。
第二个JavaScript文件我并没在这个插件的旧版和新版有发现
 

HaoEr2047

哀殿天下第一
论坛元老
高级用户
认证用户
检查html文件是否有
<script src="vue.js"></script>

JavaScript:
const viewmodel = new Vue({
                el: "#app",
                vuetify: new Vuetify(),
                data: {
                    positions: {
                        normal: [],
                        appartment: [],
                        house: [],
                    },

                    selectedValue: {
                        type: "",
                        name: ""
                    },

                    newChar: false,
                    show: false,
                    translations: {}
                },
fxmanifest.lua是否有
'html/vue.js'

如果和我一样还有问题你就得联系你的插件出售者了,他们如果没有解决方案,那就没办法了,他们的脚本都是加密的。
最致命的是,我无法联系作者,因为这是qb-core自带的插件,我尝试了好几个版本都是这样
 

Yann

站长
管理成员
GTAOS管理组
认证卖家
认证用户
本 月 名 人 榜 最 佳
用我发你的覆盖html试试
HTML:
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>QBCore - Spawnlocation</title>
    <link rel="stylesheet" type="text/css" href="reset.css"> <!-- RESET CSS -->
    <link rel="stylesheet" type="text/css" href="style.css"> <!-- STYLE CSS -->

    <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.1.3/axios.min.js"></script>

    <script src="vue.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css" rel="stylesheet"/>
</head>
    <body>
        <v-app data-app>
            <div id="app">
                <div class="container">           
                    <div class="noselect">
                        <div
                            class="spawn-locations"
                            :class="{'slide-top-fade-leave-active': show == false, 'slide-top-fade-leave-to': show == false}"
                        >
                            <div class="spawn_locations-header">
                                <p>
                                    <span id="null">{{translate('where_would_you_like_to_start')}}</span>
                                </p>
                            </div>

                            <!--                             
                            <v-btn
                                elevation="0" color="#00000000" v-if="newChar !== true" class="location" x-large v-ripple
                                :class="{'selected': 'current' == selectedValue.type && 'current' == selectedValue.name}"
                                @click="click_location('current', 'current')"
                            >
                                {{translate('last_location')}}
                            </v-btn> -->

                            <div v-for="(locations, locationGroupIdx) in positions">
                                <v-btn
                                    v-for="(location, locationIdx) in locations"
                                    :key="locationGroupIdx + '-' + locationIdx"
                                    elevation="0" color="#00000000"
                                    :class="{'selected': locationGroupIdx == selectedValue.type && ((locationGroupIdx !== 'house' && locationIdx == selectedValue.name) || (locationGroupIdx == 'house' && location.house == selectedValue.name))}"
                                    class="location" x-large v-ripple @click="click_location(locationGroupIdx, locationGroupIdx == 'house' ? location.house : locationIdx)"
                                >
                                    {{ location.label }}
                                </v-btn>
                            </div>

                            <v-btn
                                @click="submit_spawn"
                                v-ripple
                                x-large
                                class="submit-spawn"
                                v-if="selectedValue.type !== '' && selectedValue.name !== ''"
                            >
                                {{translate('confirm')}}
                            </v-btn>
                        </div>
                    </div>         
                </div>
            </div>   
        </v-app>

        <script>
            const viewmodel = new Vue({
                el: "#app",
                vuetify: new Vuetify(),
                data: {
                    positions: {
                        normal: [],
                        appartment: [],
                        house: [],
                    },

                    selectedValue: {
                        type: "",
                        name: ""
                    },

                    newChar: false,
                    show: false,
                    translations: {}
                },

                methods: {
                    click_location: function(type, name) {
                        if (type == "normal") {
                            axios.post('https://qb-spawn/setCam', {
                                posname: name,
                                type: type,
                            });
                        }
                        this.selectedValue = {type: type, name: name}
                    },

                    submit_spawn: function() {
                        this.show = false
                        const data = this.selectedValue
                        if (data.type !== "appartment") {
                            axios.post('https://qb-spawn/spawnplayer', {
                                spawnloc: data.name,
                                typeLoc: data.type
                            });
                        } else {
                            axios.post('https://qb-spawn/chooseAppa', {
                                appType: data.name,
                            });
                        }
                    },

                    translate(phrase) {
                        return this.translations[phrase] || `Could not find phrase: ${phrase}`;
                    }
                },

                mounted () {
                    window.addEventListener('message', function (event) {
                        let data = event.data;
                        switch(data.action) {
                            case "showUi":
                                viewmodel.show = data.status
                                viewmodel.translations = event.data.translations
                                break;

                            case "setupLocations":
                                viewmodel.positions = {normal: [], appartment: [], house: []}
                                viewmodel.selectedValue = {type: "", index: -1}

                                viewmodel.positions.normal = data.locations
                                viewmodel.positions.house = data.houses
                                viewmodel.newChar = data.isNew
                                break;

                            case "setupAppartements":
                                viewmodel.positions = {normal: [], appartment: [], house: []}
                                viewmodel.selectedValue = {type: "", index: -1}

                                viewmodel.positions.appartment = data.locations
                                viewmodel.newChar = data.isNew
                                break;
                        }
                    })
                }
            });
        </script>
    </body>
</html>
 

HaoEr2047

哀殿天下第一
论坛元老
高级用户
认证用户
检查html文件是否有
<script src="vue.js"></script>

JavaScript:
const viewmodel = new Vue({
                el: "#app",
                vuetify: new Vuetify(),
                data: {
                    positions: {
                        normal: [],
                        appartment: [],
                        house: [],
                    },

                    selectedValue: {
                        type: "",
                        name: ""
                    },

                    newChar: false,
                    show: false,
                    translations: {}
                },
fxmanifest.lua是否有
'html/vue.js'

如果和我一样还有问题你就得联系你的插件出售者了,他们如果没有解决方案,那就没办法了,他们的脚本都是加密的。
你是否能给我推荐其他插件,无论其是否付费。
 

HaoEr2047

哀殿天下第一
论坛元老
高级用户
认证用户
用我发你的覆盖html试试
HTML:
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>QBCore - Spawnlocation</title>
    <link rel="stylesheet" type="text/css" href="reset.css"> <!-- RESET CSS -->
    <link rel="stylesheet" type="text/css" href="style.css"> <!-- STYLE CSS -->

    <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.1.3/axios.min.js"></script>

    <script src="vue.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css" rel="stylesheet"/>
</head>
    <body>
        <v-app data-app>
            <div id="app">
                <div class="container">          
                    <div class="noselect">
                        <div
                            class="spawn-locations"
                            :class="{'slide-top-fade-leave-active': show == false, 'slide-top-fade-leave-to': show == false}"
                        >
                            <div class="spawn_locations-header">
                                <p>
                                    <span id="null">{{translate('where_would_you_like_to_start')}}</span>
                                </p>
                            </div>

                            <!--                            
                            <v-btn
                                elevation="0" color="#00000000" v-if="newChar !== true" class="location" x-large v-ripple
                                :class="{'selected': 'current' == selectedValue.type && 'current' == selectedValue.name}"
                                @click="click_location('current', 'current')"
                            >
                                {{translate('last_location')}}
                            </v-btn> -->

                            <div v-for="(locations, locationGroupIdx) in positions">
                                <v-btn
                                    v-for="(location, locationIdx) in locations"
                                    :key="locationGroupIdx + '-' + locationIdx"
                                    elevation="0" color="#00000000"
                                    :class="{'selected': locationGroupIdx == selectedValue.type && ((locationGroupIdx !== 'house' && locationIdx == selectedValue.name) || (locationGroupIdx == 'house' && location.house == selectedValue.name))}"
                                    class="location" x-large v-ripple @click="click_location(locationGroupIdx, locationGroupIdx == 'house' ? location.house : locationIdx)"
                                >
                                    {{ location.label }}
                                </v-btn>
                            </div>

                            <v-btn
                                @click="submit_spawn"
                                v-ripple
                                x-large
                                class="submit-spawn"
                                v-if="selectedValue.type !== '' && selectedValue.name !== ''"
                            >
                                {{translate('confirm')}}
                            </v-btn>
                        </div>
                    </div>        
                </div>
            </div>  
        </v-app>

        <script>
            const viewmodel = new Vue({
                el: "#app",
                vuetify: new Vuetify(),
                data: {
                    positions: {
                        normal: [],
                        appartment: [],
                        house: [],
                    },

                    selectedValue: {
                        type: "",
                        name: ""
                    },

                    newChar: false,
                    show: false,
                    translations: {}
                },

                methods: {
                    click_location: function(type, name) {
                        if (type == "normal") {
                            axios.post('https://qb-spawn/setCam', {
                                posname: name,
                                type: type,
                            });
                        }
                        this.selectedValue = {type: type, name: name}
                    },

                    submit_spawn: function() {
                        this.show = false
                        const data = this.selectedValue
                        if (data.type !== "appartment") {
                            axios.post('https://qb-spawn/spawnplayer', {
                                spawnloc: data.name,
                                typeLoc: data.type
                            });
                        } else {
                            axios.post('https://qb-spawn/chooseAppa', {
                                appType: data.name,
                            });
                        }
                    },

                    translate(phrase) {
                        return this.translations[phrase] || `Could not find phrase: ${phrase}`;
                    }
                },

                mounted () {
                    window.addEventListener('message', function (event) {
                        let data = event.data;
                        switch(data.action) {
                            case "showUi":
                                viewmodel.show = data.status
                                viewmodel.translations = event.data.translations
                                break;

                            case "setupLocations":
                                viewmodel.positions = {normal: [], appartment: [], house: []}
                                viewmodel.selectedValue = {type: "", index: -1}

                                viewmodel.positions.normal = data.locations
                                viewmodel.positions.house = data.houses
                                viewmodel.newChar = data.isNew
                                break;

                            case "setupAppartements":
                                viewmodel.positions = {normal: [], appartment: [], house: []}
                                viewmodel.selectedValue = {type: "", index: -1}

                                viewmodel.positions.appartment = data.locations
                                viewmodel.newChar = data.isNew
                                break;
                        }
                    })
                }
            });
        </script>
    </body>
</html>
现在没有UI报错了,但是选择角色后依然弹不出来选择框。
 

Yann

站长
管理成员
GTAOS管理组
认证卖家
认证用户
本 月 名 人 榜 最 佳
现在没有UI报错了,但是选择角色后依然弹不出来选择框。
这就要问你的脚本作者了,可以在脚本内的config.lua里看看有没有相关的配置
 
状态
此线程已解决! 转到解决方案...
顶部