Hey!
It’s me again!
So, I tried to figure out how aces works, and I looked to faxes tutorial:
but I want to use RegisterCommand and I don’t know if this is possible.
But the thing is, that I always get this ERROR:
InvokeNative: execution failed: Argument at index 0 was null. Error running call reference function for resource kick_restart: citizen:/scripting/lua/scheduler.lua:403: Execution of native 00000000dedae23d in script host failed. stack traceback: [C]: in upvalue '_in' citizen:/scripting/lua/natives_server.lua:264: in function 'IsPlayerAceAllowed' server.lua:17: in upvalue 'ref' citizen:/scripting/lua/scheduler.lua:389: in function citizen:/scripting/lua/scheduler.lua:388> [C]: in function 'xpcall' citizen:/scripting/lua/scheduler.lua:388: in function citizen:/scripting/lua/scheduler.lua:387> stack traceback: [C]: in function 'error' citizen:/scripting/lua/scheduler.lua:403: in function citizen:/scripting/lua/scheduler.lua:372>
here is what I got:
function PrintChatMessage(perms, prefix, color, message)
AddEventHandler("PrintChatMessage", perms, prefix, color, message)
end
RegisterCommand("beginrestart", function(src, args, raw)
if IsPlayerAceAllowed(perms, "kickall") then
PrintChatMessage("KickRestart", { 255, 0, 0}, "the server is restarting")
else
PrintChatMessage("KickRestart", { 255, 0, 0}, "You have NO permissions!")
end
end)
every time I type in chat /beginrestart it gives me the error above. I just want that he gives me the message that I have no permissions, don’t know why this is so difficult.
If you need more informations, or something else, reply on thos comment I will answer it
take a