Remélem tudtam segíteni:
(nem saját munka, Basic RP-bõl szedtem ki)
-- ~ [RESTARTALL, RESTARTALLRESOURCES, RESTARTRESOURCES] ~ --
addCommandHandler({\"restartall\", \"restartallresources\", \"restartresources\"},
function(player, cmd)
if exports.brpExports:isPlayerHeadAdmin(player) then
local resources = getResources()
outputChatBox(\"Restarting all resources...\", player, 220, 220, 0, false)
outputServerLog(\"[ADMIN] [CMD/RESTARTALL]: \" .. getPlayerName(player) .. \" restarted all resources.\")
for i,v in ipairs(resources) do
if getResourceState(v) == \"running\" then
restartResource(getResourceFromName(getResourceName(v)))
end
end
elseif getElementType(player) == \"console\" then
local resources = getResources()
outputChatBox(\"Restarting all resources...\", player, 220, 220, 0, false)
for i,v in ipairs(resources) do
if getResourceState(v) == \"running\" then
restartResource(getResourceFromName(getResourceName(v)))
end
end
end
end
)