addEvent ( "aResource", true )
addEventHandler ( "aResource", _root, function ( name, action )
if checkClient( "command."..action, source, 'aResource', action ) then return end
local pname = getPlayerName ( source )
if ( hasObjectPermissionTo ( source, "command."..action ) ) then
local text = ""
if ( action == "start" ) then if ( startResource ( getResourceFromName ( name ), true ) ) then outputChatBox( ""..name.." #DC143CStarted by #7CFC00"..getAdminNameForLog ( source ),255,10,10,true) text = "started" end
elseif ( action == "restart" ) then if ( restartResource ( getResourceFromName ( name ) ) ) then text = "restarted" end
elseif ( action == "stop" ) then if ( stopResource ( getResourceFromName ( name ) ) ) then text = "stopped" end
elseif ( action == "delete" ) then if ( deleteResource ( getResourceFromName ( name ) ) ) then text = "deleted" end
elseif ( action == "stopall" ) then if ( stopAllResources ( ) ) then text = "All Stopped" end
else action = nil
end
if ( text ~= "" ) then
outputServerLog ( "ADMIN: Resource \'" .. name .. "\' " .. text .. " by " .. getAdminNameForLog ( source ) )
for id, player in ipairs(getElementsByType("player")) do
triggerClientEvent ( player, "aClientLog", _root, text )
end
end
return true
end
outputChatBox ( "Access denied for '"..tostring ( action ).."'", source, 255, 168, 0 )
return false
end )
try it idk