Essentialmode fehler

9 Beiträge · 12.259 Aufrufe
20.10.2019, 00:36 #1

wenn ich jemanden einen Job geben möchte oder Geld oder so kommt da Script error @essentialmode/server/Main.lua:264: attempt to Index a nil value (field '?'


Bitte um Hilfe mfG

20.10.2019, 21:12 #2

Bitte mehr Information, was genau steht in der Console sonst noch drin, da wir nur mit dem kleinen Auszug nicht viel machen können, danke.

LG LaprenoDE

21.10.2019, 07:43 #3

Ohne die Codeausgabe ist es ein wenig schwer dir zu helfen!

Zeile 264 besagt bei mir folgendes:

function addAdminCommand(command, perm, callback, callbackfailed, suggestion, arguments)
    commands[command] = {}
    commands[command].perm = perm
    commands[command].group = "superadmin"
    commands[command].cmd = callback
    commands[command].callbackfailed = callbackfailed
    commands[command].arguments = arguments or -1

Sprich also, wir benötigen mal den Code ab der Zeile 264 um dir zu sagen was bei dir da steht!

//////////////////////////////////////////////////////////////////////

header-logo.php

Dixieland-Gaming
Downloads: FiveM / RedM / ETS2 / uvm..
Blog / Projekte / Forum / Reallife
Über 100 Free Downloads für ESX & QBCore
//////////////////////////////////////////////////////////////////////

21.10.2019, 08:41 #4

das ist ab 264 bis ende



source ~= 0)then

if groups[Users[source].getGroup()]:canTarget(group) then

if((#args <= commands[command].arguments and #args == commands[command].arguments) or commands[command].arguments == -1)then

callback(source, args, Users[source])

else

TriggerEvent("es:incorrectAmountOfArguments", source, commands[command].arguments, #args, Users[source])

end

else

callbackfailed(source, args, Users[source])

end

else

if((#args <= commands[command].arguments and #args == commands[command].arguments) or commands[command].arguments == -1)then

callback(source, args, Users[source])

else

TriggerEvent("es:incorrectAmountOfArguments", source, commands[command].arguments, #args, Users[source])

end

end

end)


debugMsg("Group command added: " .. command .. ", requires group: " .. group)

end


AddEventHandler('es:addGroupCommand', function(command, group, callback, callbackfailed, suggestion, arguments)

addGroupCommand(command, group, callback, callbackfailed, suggestion, arguments)

end)


AddEventHandler('es:addACECommand', function(command, group, callback)

addACECommand(command, group, callback)

end)


RegisterServerEvent('es:updatePositions')

AddEventHandler('es:updatePositions', function(x, y, z)

if(Users[source])then

Users[source].setCoords(x, y, z)

end

end)


-- Info command

commands['info'] = {}

commands['info'].perm = 2

commands['info'].cmd = function(source, args, user)

local Source = source

TriggerClientEvent('chatMessage', Source, 'SYSTEM', {255, 0, 0}, "^2[^3EssentialMode^2]^0 Version: ^2 " .. _VERSION)

TriggerClientEvent('chatMessage', Source, 'SYSTEM', {255, 0, 0}, "^2[^3EssentialMode^2]^0 Commands loaded: ^2 " .. (returnIndexesInTable(commands) - 1))

end


-- Dev command, no need to ever use this.

commands["devinfo"] = {}

commands["devinfo"].perm = math.maxinteger

commands["devinfo"].group = "dev"

commands["devinfo"].cmd = function(source, args, user)

local Source = source

local db = "CouchDB"

if GetConvar('es_enableCustomData', 'false') == "1" then db = "Custom" end

TriggerClientEvent('chatMessage', Source, 'SYSTEM', {25, 0, 0}, "^2[^3EssentialMode^2]^0 Version: ^2 " .. _VERSION)

TriggerClientEvent('chatMessage', Source, 'SYSTEM', {25, 0, 0}, "^2[^3EssentialMode^2]^0 Groups: 2 " .. (returnIndexesInTable(groups) - 1))

TriggerClientEvent('chatMessage', Source, 'SYSTEM', {25, 0, 0}, "^2[^3EssentialMode^2]^0 Commands loaded: ^2 " .. (returnIndexesInTable(commands) - 1))

TriggerClientEvent('chatMessage', Source, 'SYSTEM', {25, 0, 0}, "^2[^3EssentialMode^2]^0 Database: ^2 " .. db)

TriggerClientEvent('chatMessage', Source, 'SYSTEM', {25, 0, 0}, "^2[^3EssentialMode^2]^0 Logging enabled: ^2 " .. tostring(settings.defaultSettings.enableLogging))

end

commands["devinfo"].callbackfailed = function(source, args, user)end

21.10.2019, 08:57 #5

in der console steht @LaprenoDE


SCRIPT ERROR: @essentialmode/server/main.lua:265: attempt to index a nil value (field '?')

> ref (@essentialmode/server/main.lua:265)




mehr steht da nicht :(

21.10.2019, 09:15 #6

Teste mal diese Version ;) essentialmode6.2.2


function addAdminCommand(command, perm, callback, callbackfailed, suggestion, arguments)
    commands[command] = {}
    commands[command].perm = perm
    commands[command].group = "superadmin"
    commands[command].cmd = callback
    commands[command].callbackfailed = callbackfailed
    commands[command].arguments = arguments or -1

    if suggestion then
        if not suggestion.params or not type(suggestion.params) == "table" then suggestion.params = {} end
        if not suggestion.help or not type(suggestion.help) == "string" then suggestion.help = "" end

        commandSuggestions[command] = suggestion
    end

    ExecuteCommand('add_ace group.superadmin command.' .. command .. ' allow')

    if(settings.defaultSettings.disableCommandHandler ~= 'false')then
        RegisterCommand(command, function(source, args)
            local Source = source

            -- Console check
            if(source ~= 0)then
                if IsPlayerAceAllowed(Source, "command." .. command) or Users[source].getPermissions() >= perm then
                    if((#args <= commands[command].arguments and #args == commands[command].arguments) or commands[command].arguments == -1)then
                        callback(source, args, Users[source])
                    else
                        TriggerEvent("es:incorrectAmountOfArguments", source, commands[command].arguments, #args, Users[source])
                    end
                else
                    callbackfailed(source, args, Users[source])
                end
            else
                if((#args <= commands[command].arguments and #args == commands[command].arguments) or commands[command].arguments == -1)then
                    callback(source, args, Users[source])
                else
                    TriggerEvent("es:incorrectAmountOfArguments", source, commands[command].arguments, #args, Users[source])
                end
            end
        end, true)
    end

    debugMsg("Admin command added: " .. command .. ", requires permission level: " .. perm)
end

//////////////////////////////////////////////////////////////////////

header-logo.php

Dixieland-Gaming
Downloads: FiveM / RedM / ETS2 / uvm..
Blog / Projekte / Forum / Reallife
Über 100 Free Downloads für ESX & QBCore
//////////////////////////////////////////////////////////////////////

21.10.2019, 10:00 #7

Da stimmt was nicht. Warum brauchst du für einen Job ein Command? Was für ein Job ist das, startest du den per Command?

21.10.2019, 13:23 #8

@IslandV es scheint als ob er eine sehr alte Version besitz oder halt dass er alles mit Commands macht. Sprich also seine Jobs an die Spieler einzeln mit Command vergibt oder Spieler mit Command einen Job annehmen müssen!

//////////////////////////////////////////////////////////////////////

header-logo.php

Dixieland-Gaming
Downloads: FiveM / RedM / ETS2 / uvm..
Blog / Projekte / Forum / Reallife
Über 100 Free Downloads für ESX & QBCore
//////////////////////////////////////////////////////////////////////

22.10.2019, 13:50 #9

ne es war so das ich den Polizei Medic Mechaniker und Autohändler gewhitelisted hatte und den leuten den Job mit /setjob [is] [Job] [Job_grade] geben musste aber das ging nicht

Melde dich an, um zu antworten.
© 2026 GTA-FIVEM.ORGImpressumDatenschutzNutzungsbedingungenCookiesShimo Forum