diff --git a/[admin]/admin/client/gui/admin_screenshot.lua b/[admin]/admin/client/gui/admin_screenshot.lua index bda809a1a..999c507fc 100644 --- a/[admin]/admin/client/gui/admin_screenshot.lua +++ b/[admin]/admin/client/gui/admin_screenshot.lua @@ -18,8 +18,9 @@ function aPlayerScreenShot (player) aScreenShotList = guiCreateGridList ( 0.03, 0.08, 0.70, 0.90, true, aScreenShotForm ) aScreenShotNew = guiCreateButton ( 0.75, 0.08, 0.42, 0.09, "Take New", true, aScreenShotForm, "takescreenshot" ) aScreenShotDelete = guiCreateButton ( 0.75, 0.18, 0.42, 0.09, "Delete", true, aScreenShotForm, "deletescreenshot" ) - aScreenShotView = guiCreateButton ( 0.75, 0.28, 0.42, 0.09, "View", true, aScreenShotForm, "viewscreenshot" ) - aScreenShotRefresh = guiCreateButton ( 0.75, 0.38, 0.42, 0.09, "Refresh", true, aScreenShotForm, "listscreenshots" ) + aScreenShotDeleteAll= guiCreateButton ( 0.75, 0.28, 0.42, 0.09, "Delete All", true, aScreenShotForm, "deleteallscreenshot" ) + aScreenShotView = guiCreateButton ( 0.75, 0.38, 0.42, 0.09, "View", true, aScreenShotForm, "viewscreenshot" ) + aScreenShotRefresh = guiCreateButton ( 0.75, 0.48, 0.42, 0.09, "Refresh", true, aScreenShotForm, "listscreenshots" ) aScreenShotClose = guiCreateButton ( 0.75, 0.88, 0.42, 0.09, "Close", true, aScreenShotForm ) guiGridListAddColumn(aScreenShotList,"Player",0.31 ) guiGridListAddColumn(aScreenShotList,"Admin",0.31 ) @@ -47,7 +48,7 @@ function aPlayerScreenShotClose () removeEventHandler ( "onClientGUIClick", aScreenShotForm, aScreenShotsClick ) removeEventHandler ( "onClientGUIDoubleClick", aScreenShotForm, aScreenShotsDoubleClick ) destroyElement ( aScreenShotForm ) - aScreenShotForm,aScreenShotList,aScreenShotNew,aScreenShotDelete,aScreenShotView,aScreenShotRefresh,aScreenShotClose,aScreenShotForm = nil,nil,nil,nil,nil,nil,nil,nil + aScreenShotForm,aScreenShotList,aScreenShotNew,aScreenShotDelete,aScreenShotDeleteAll,aScreenShotView,aScreenShotRefresh,aScreenShotClose,aScreenShotForm = nil,nil,nil,nil,nil,nil,nil,nil,nil end end @@ -79,6 +80,9 @@ function aScreenShotsClick (button) triggerServerEvent("aScreenShot",localPlayer,"delete",guiGridListGetItemData(aScreenShotList,row,1)) guiGridListRemoveRow(aScreenShotList,row) end + elseif source == aScreenShotDeleteAll then + triggerServerEvent("aScreenShot",localPlayer,"deleteall") + guiGridListClear(aScreenShotList) elseif source == aScreenShotRefresh then aScreenShotsRefresh() elseif source == aScreenShotView then diff --git a/[admin]/admin/conf/ACL.xml b/[admin]/admin/conf/ACL.xml index 92d923661..fb9901984 100644 --- a/[admin]/admin/conf/ACL.xml +++ b/[admin]/admin/conf/ACL.xml @@ -93,6 +93,7 @@ + @@ -183,6 +184,7 @@ + @@ -273,6 +275,7 @@ + @@ -364,6 +367,7 @@ + diff --git a/[admin]/admin/server/admin_screenshot.lua b/[admin]/admin/server/admin_screenshot.lua index 37c389ec2..1bbd2bb97 100644 --- a/[admin]/admin/server/admin_screenshot.lua +++ b/[admin]/admin/server/admin_screenshot.lua @@ -16,6 +16,7 @@ local currentid = 0 local rights = { ["new"] = "takescreenshot", ["delete"] = "deletescreenshot", + ["deleteall"] = "deleteallscreenshot", ["view"] = "viewscreenshot", ["list"] = "listscreenshots" } @@ -60,6 +61,14 @@ addEventHandler("aScreenShot",root, fileDelete("screenshots/"..player..".jpg") end dbExec(con, "DELETE FROM `admin_screenshots` WHERE `id`=?", player) + elseif action == "deleteall" then + for i=0, currentid do + if fileExists("screenshots/"..i..".jpg") then + fileDelete("screenshots/"..i..".jpg") + end + end + currentid = 0 + dbExec(con, "DELETE FROM `admin_screenshots`") elseif action == "view" then if fileExists("screenshots/"..player..".jpg") then local file = fileOpen("screenshots/"..player..".jpg")