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
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
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
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!
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
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
Alles anzeigen
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?
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