Skip to content

Commit

Permalink
Merge branch 'master' into newmodels-editor-reborn
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-A-Rocha committed Sep 2, 2024
2 parents f97b481 + e558c84 commit c934400
Show file tree
Hide file tree
Showing 329 changed files with 170,198 additions and 116,479 deletions.
6 changes: 3 additions & 3 deletions [admin]/acpanel/meta.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<meta>
<info description="Anti-Cheat Control Panel" author="ccw" version="0.1.8" type="script" />
<min_mta_version server="1.3.1" client="1.3.1"></min_mta_version>
<info description="Anti-Cheat Control Panel" author="ccw" version="0.2.0" type="script" />
<min_mta_version server="1.6.0" client="1.6.0"></min_mta_version>

<script src="_common.lua"/>
<script src="s_joiner.lua"/>
Expand All @@ -20,7 +20,7 @@


<settings>
<setting name="*admingroup" value="Admin,AdminPlus"
<setting name="*admingroup" value="Admin"
friendlyname="Admin group list"
group="_Advanced"
accept="*"
Expand Down
8 changes: 4 additions & 4 deletions [admin]/acpanel/s_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function updatePlayer(player)

if newAllowed and not oldAllowed then
bindKey( player, "o", "down", "Show_AC_Panel" )
outputChatBox ( "Press 'o' to open your AC panel", player )
outputChatBox ( "Press 'o' to open AC panel", player )
if not bAllowGui then return end
sendAllSettingsToClient()
triggerClientEvent(player, 'onAcpClientInitialSettings', resourceRoot, getServerConfigSettingsToTransfer() )
Expand Down Expand Up @@ -113,10 +113,10 @@ function doesResourceHasPermissions()
end

if not bResourceHasPermissions then
outputChatBox( "AC Panel can not start until this command is run:" )
outputChatBox( "aclrequest allow acpanel all" )
outputServerLog( "AC Panel can not start until this command is run:" )
outputServerLog( "aclrequest allow acpanel all" )
else
outputChatBox( "Please restart AC Panel" )
outputServerLog( "Please restart AC Panel" )
end
return false
end
Expand Down
10 changes: 5 additions & 5 deletions [admin]/acpanel/s_settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,16 @@ end
-- Get version data from remote server
---------------------------------------------------------
function GetVersInfoFromRemoteServer()
fetchRemote( "http://nightly.mtasa.com/ver/", onGotVersInfo )
fetchRemote( "https://nightly.multitheftauto.com/ver/", onGotVersInfo )
end

function onGotVersInfo( responseData, errno )
if errno == 0 then

local ver = string.sub( getVersion().sortable, 0, 3 )
local ver = string.sub( getVersion().sortable, 1, 3 )

releaseMinVersion = string.match( responseData, "default: " ..ver .. ".(.-)[^0-9.-]" )
latestMinVersion = string.match( responseData, "minclientversion: " .. ver .. ".(.-)[^0-9.-]" )
releaseMinVersion = string.match( responseData, "Auto-update default:%s*" .. ver .. "%.([%d%-%.]+)" )
latestMinVersion = string.match( responseData, "Max recommended/minclientversion:%s*" .. ver .. "%.([%d%-%.]+)" )

if releaseMinVersion and latestMinVersion then
releaseMinVersion = ver .. "." .. releaseMinVersion
Expand Down Expand Up @@ -247,7 +247,7 @@ function onGotAcPanelVersInfo( responseData, errno )
setPanelSetting( "acpanelVersion", acpanelVersion )
setPanelSetting( "acpanelUrl", acpanelUrl )
if acpanelVersion > _version then
outputChatBox("New version of Anti-Cheat panel is available!")
outputServerLog("New version of Anti-Cheat panel is available!")
end
end
end
Expand Down
152 changes: 5 additions & 147 deletions [admin]/admin/admin_definitions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,156 +10,14 @@

_DEBUG = false

_version = '1.5.9'
_version = '1.6'

-- MISC DEFINITIONS
ADMIN_CHAT_MAXLENGTH = 225

function enum ( args, prefix )
for i, v in ipairs ( args ) do
if ( prefix ) then _G[v] = prefix..i
else _G[v] = i end
end
end

-- MISC DEFINITIONS
ADMIN_CHAT_MAXLENGTH = 225

-- EVENT CALLS

enum
({
"EVENT_SYNC",
"EVENT_SYNC_PERMISSIONS",
"EVENT_TEAM",
"EVENT_ADMIN",
"EVENT_PLAYER",
"EVENT_VEHICLE",
"EVENT_RESOURCE",
"EVENT_SERVER",
"EVENT_MESSAGE",
"EVENT_BANS",
"EVENT_EXECUTE",
"EVENT_ADMIN_CHAT",
"EVENT_ADMIN_OPEN",

"EVENT_RESOURCE_START",
"EVENT_RESOURCE_STOP",
"EVENT_PLAYER_JOIN"
} )

-- SYNC DEFINITIONS

enum
({
"SYNC_PLAYER",
"SYNC_PLAYERS",
"SYNC_RESOURCES",
"SYNC_ADMINS",
"SYNC_SERVER",
"SYNC_RIGHTS",
"SYNC_BANS",
"SYNC_MESSAGES"
})

-- TEAM DEFINITIONS

enum
({
"TEAM_CREATE",
"TEAM_DESTROY"
})

-- ADMIN DEFINITIONS

enum
({
"ADMIN_PASSWORD",
"ADMIN_AUTOLOGIN",
"ADMIN_SYNC",
"ADMIN_ACL_CREATE",
"ADMIN_ACL_DESTROY",
"ADMIN_ACL_ADD",
"ADMIN_ACL_REMOVE"
})

-- PLAYER DEFINITIONS

enum
({
"PLAYER_KICK",
"PLAYER_BAN",
"PLAYER_MUTE",
"PLAYER_FREEZE",
"PLAYER_SHOUT",
"PLAYER_SET_HEALTH",
"PLAYER_SET_ARMOUR",
"PLAYER_SET_SKIN",
"PLAYER_SET_MONEY",
"PLAYER_SET_STAT",
"PLAYER_SET_TEAM",
"PLAYER_SET_INTERIOR",
"PLAYER_SET_DIMENSION",
"PLAYER_JETPACK",
"PLAYER_SET_GROUP",
"PLAYER_GIVE_VEHICLE",
"PLAYER_GIVE_WEAPON",
"PLAYER_SLAP",
"PLAYER_WARP",
"PLAYER_WARP_TO"
})

-- VEHICLE DEFINITIONS

enum
({
"VEHICLE_REPAIR",
"VEHICLE_CUSTOMIZE",
"VEHICLE_SET_PAINTJOB",
"VEHICLE_SET_COLOR",
"VEHICLE_BLOW",
"VEHICLE_DESTROY"
})

-- RESOURCE DEFINITIONS

enum
({
"RESOURCE_START",
"RESOURCE_RESTART",
"RESOURCE_STOP"
})

-- SERVER DEFINITIONS

enum
({
"SERVER_SET_GAME",
"SERVER_SET_MAP",
"SERVER_SET_WELCOME",
"SERVER_SET_TIME",
"SERVER_SET_PASSWORD",
"SERVER_SET_WEATHER",
"SERVER_BLEND_WEATHER",
"SERVER_SET_GAME_SPEED",
"SERVER_SET_GRAVITY",
"SERVER_SET_BLUR_LEVEL",
"SERVER_SET_WAVE_HEIGHT"
})

-- MESSAGE DEFINITIONS

enum
({
"MESSAGE_NEW",
"MESSAGE_GET",
"MESSAGE_READ",
"MESSAGE_DELETE"
})

-- BANS DEFINITIONS

enum
({
"BANS_BAN_IP",
"BANS_BAN_SERIAL",
"BANS_UNBAN_IP",
"BANS_UNBAN_SERIAL"
})
end
4 changes: 3 additions & 1 deletion [admin]/admin/client/admin_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

_DEBUG = false

_version = '1.5.9'
_version = '1.6'
_flags = {}
_widgets = {}
_settings = nil
Expand All @@ -26,6 +26,7 @@ function aClientAdminMenu ()
aAdminMenuClose ( false )
else
aAdminMenu ()
guiFocus (aAdminForm)
end
end

Expand All @@ -39,6 +40,7 @@ addEvent ( "aClientAdminChat", true )
addEvent ( "aClientResourceStart", true )
addEvent ( "aClientResourceStop", true )
addEvent ( "aClientAdminMenu", true )
addEvent ( "aClientReports", true )
function aAdminResourceStart ()
addEventHandler ( "aClientAdminMenu", root, aClientAdminMenu )
local node = xmlLoadFile ( "conf\\weathers.xml" )
Expand Down
1 change: 0 additions & 1 deletion [admin]/admin/client/colorpicker/colorpicker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ function colorPicker.create(id, start, title)
end

function colorPicker:render()
-- if not self.gui.focus then return end
local x,y = guiGetPosition(self.gui.window, false)
dxDrawRectangle(x+16, y+32, 256, 256, self.color.huecurrent, self.gui.focus)
dxDrawImage(x+16, y+32, 256, 256, "client/colorpicker/sv.png", 0, 0, 0, self.color.white, self.gui.focus)
Expand Down
12 changes: 6 additions & 6 deletions [admin]/admin/client/gui/admin_acl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ function aManageACL ()
guiGridListSetSortingEnabled ( aACLList, false )
guiGridListAddColumn( aACLList, "", 0.10 )
guiGridListAddColumn( aACLList, "", 0.85 )
aACLCreateGroup = guiCreateButton ( 0.55, 0.05, 0.40, 0.04, "Create group", true, aAclForm )
aACLCreateACL = guiCreateButton ( 0.55, 0.10, 0.40, 0.04, "Create ACL", true, aAclForm )
aACLCreateGroup = guiCreateButton ( 0.55, 0.05, 0.40, 0.04, "Create group", true, aAclForm, "aclcreate" )
aACLCreateACL = guiCreateButton ( 0.55, 0.10, 0.40, 0.04, "Create ACL", true, aAclForm, "aclcreate" )
aACLLabel = guiCreateLabel ( 0.55, 0.19, 0.40, 0.04, "", true, aAclForm )
aACLSeparator = guiCreateStaticImage ( 0.55, 0.235, 0.40, 0.0025, "client\\images\\dot.png", true, aAclForm )
aACLDestroyGroup = guiCreateButton ( 0.55, 0.25, 0.40, 0.04, "Destroy group", true, aAclForm )
aACLDestroyACL = guiCreateButton ( 0.55, 0.25, 0.40, 0.04, "Destroy ACL", true, aAclForm )
aACLAddObject = guiCreateButton ( 0.55, 0.30, 0.40, 0.04, "Add Object", true, aAclForm )
aACLRemoveObject = guiCreateButton ( 0.55, 0.35, 0.40, 0.04, "Remove Object", true, aAclForm )
aACLDestroyGroup = guiCreateButton ( 0.55, 0.25, 0.40, 0.04, "Destroy group", true, aAclForm, "acldestroy" )
aACLDestroyACL = guiCreateButton ( 0.55, 0.25, 0.40, 0.04, "Destroy ACL", true, aAclForm, "acldestroy" )
aACLAddObject = guiCreateButton ( 0.55, 0.30, 0.40, 0.04, "Add Object", true, aAclForm, "acladd" )
aACLRemoveObject = guiCreateButton ( 0.55, 0.35, 0.40, 0.04, "Remove Object", true, aAclForm, "aclremove" )
aACLAddACL = guiCreateButton ( 0.55, 0.40, 0.40, 0.04, "Add ACL", true, aAclForm )
aACLRemoveACL = guiCreateButton ( 0.55, 0.45, 0.40, 0.04, "Remove ACL", true, aAclForm )

Expand Down
23 changes: 21 additions & 2 deletions [admin]/admin/client/gui/admin_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ aLastSync = 0
aResources = {}

local serverPassword = 'None'
local hasResourceSetting

function guiComboBoxAdjustHeight ( combobox, itemcount )
if getElementType ( combobox ) ~= "gui-combobox" or type ( itemcount ) ~= "number" then error ( "Invalid arguments @ 'guiComboBoxAdjustHeight'", 2 ) end
Expand Down Expand Up @@ -181,7 +182,7 @@ y=y+B aTab1.VehicleHealth = guiCreateLabel ( 0.26, y, 0.25, 0.04, "Vehicle Heal

aTab2 = {}
aTab2.Tab = guiCreateTab ( "Resources", aTabPanel, "resources" )
aTab2.ManageACL = guiCreateButton ( 0.75, 0.02, 0.23, 0.04, "Manage ACL", true, aTab2.Tab )
aTab2.ManageACL = guiCreateButton ( 0.75, 0.02, 0.23, 0.04, "Manage ACL", true, aTab2.Tab, "aclmanager" )
aTab2.ResourceListSearch = guiCreateEdit ( 0.03, 0.05, 0.31, 0.04, "", true, aTab2.Tab )
guiCreateStaticImage ( 0.34, 0.05, 0.035, 0.04, "client\\images\\search.png", true, aTab2.Tab )
aTab2.ResourceList = guiCreateGridList ( 0.03, 0.10, 0.35, 0.80, true, aTab2.Tab )
Expand All @@ -194,6 +195,7 @@ y=y+B aTab1.VehicleHealth = guiCreateLabel ( 0.26, y, 0.25, 0.04, "Vehicle Heal
aTab2.ResourceInclMaps = guiCreateCheckBox ( 0.03, 0.91, 0.15, 0.04, "Include Maps", false, true, aTab2.Tab )
aTab2.ResourceRefresh = guiCreateButton ( 0.20, 0.915, 0.18, 0.04, "Refresh list", true, aTab2.Tab, "listresources" )
aTab2.ResourceSettings = guiCreateButton ( 0.40, 0.05, 0.20, 0.04, "Settings", true, aTab2.Tab )
guiSetVisible ( aTab2.ResourceSettings, false)
aTab2.ResourceStart = guiCreateButton ( 0.40, 0.10, 0.20, 0.04, "Start", true, aTab2.Tab, "start" )
aTab2.ResourceRestart = guiCreateButton ( 0.40, 0.15, 0.20, 0.04, "Restart", true, aTab2.Tab, "restart" )
aTab2.ResourceStop = guiCreateButton ( 0.40, 0.20, 0.20, 0.04, "Stop", true, aTab2.Tab, "stop" )
Expand Down Expand Up @@ -969,7 +971,9 @@ end
function aClientDoubleClick ( button )
if ( source == aTab2.ResourceList ) then
if ( guiGridListGetSelectedItem ( aTab2.ResourceList ) ~= -1 ) then
aManageSettings ( guiGridListGetItemText ( aTab2.ResourceList, guiGridListGetSelectedItem( aTab2.ResourceList ), 1 ) )
if hasResourceSetting then
aManageSettings ( guiGridListGetItemText ( aTab2.ResourceList, guiGridListGetSelectedItem( aTab2.ResourceList ), 1 ) )
end
end
elseif ( source == aTab4.BansList ) then
if ( guiGridListGetSelectedItem ( aTab4.BansList ) == -1 ) then
Expand Down Expand Up @@ -1059,6 +1063,10 @@ function aClientClick ( button )
elseif ( source == aTab2.ResourceList ) then
guiSetVisible ( aTab2.ResourceFailture, false )
if ( guiGridListGetSelectedItem ( aTab2.ResourceList ) ~= -1 ) then
local resName = guiGridListGetItemText(aTab2.ResourceList, guiGridListGetSelectedItem( aTab2.ResourceList ), 1)
if resName then
triggerServerEvent("aAdmin", localPlayer, "resourcelist", resName)
end
guiSetText(aTab2.ResourceName, "Full Name: " .. guiGridListGetItemText(aTab2.ResourceList, guiGridListGetSelectedItem ( aTab2.ResourceList ), 4))
guiSetText(aTab2.ResourceAuthor, "Author: " .. guiGridListGetItemText(aTab2.ResourceList, guiGridListGetSelectedItem ( aTab2.ResourceList ), 5))
guiSetText(aTab2.ResourceVersion, "Version: " .. guiGridListGetItemText(aTab2.ResourceList, guiGridListGetSelectedItem ( aTab2.ResourceList ), 6))
Expand Down Expand Up @@ -1192,6 +1200,17 @@ function aClientClick ( button )
end
end

addEvent ("setVisibilityOfSettingsButton", true)
function setVisibilityOfSettingsButton (showResourceSetting)
hasResourceSetting = showResourceSetting
if hasResourceSetting then
guiSetVisible(aTab2.ResourceSettings, true)
else
guiSetVisible(aTab2.ResourceSettings, false)
end
end
addEventHandler ( "setVisibilityOfSettingsButton", resourceRoot, setVisibilityOfSettingsButton)

function aClientRender ()
if ( guiGetVisible ( aAdminForm ) ) then
if ( getTickCount() >= aLastCheck ) then
Expand Down
9 changes: 0 additions & 9 deletions [admin]/admin/client/gui/admin_maps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ function guiClick(button)
else
guiSetEnabled(aTabMap.NextMap, false)
end
-- if gamemode == "deleted maps" then
-- guiSetEnabled(aTabMap.Start, false)
-- guiSetEnabled(aTabMap.Delete, false)
-- guiSetEnabled(aTabMap.Revert, true)
-- else
-- guiSetEnabled(aTabMap.Start, true)
-- guiSetEnabled(aTabMap.Delete, true)
-- guiSetEnabled(aTabMap.Revert, false)
-- end
elseif source == aTabMap.Start then
triggerServerEvent("startGamemodeMap_s", localPlayer, gamemode, mapResName)
elseif source == aTabMap.NextMap then
Expand Down
4 changes: 3 additions & 1 deletion [admin]/admin/client/gui/admin_messages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ function aViewMessagesClose ( destroy )
end
end

function aMessagesSync ( action, data )
function aMessagesSync ( action, data, isReportDisabled )
if ( action == "get" ) then
_messages = data
guiGridListClear ( aMessagesList )

for id=#data,1,-1 do
local message = data[id]
local row = guiGridListAddRow ( aMessagesList )
Expand All @@ -68,6 +69,7 @@ function aMessagesSync ( action, data )
guiGridListSetItemText ( aMessagesList, row, 3, message.time, false, false )
guiGridListSetItemText ( aMessagesList, row, 4, removeColorCoding(message.author), false, false )
end
guiSetText(aMessagesForm, (isReportDisabled ~= "true" and "View Messages (reports are disabled)" or "View Messages"))
end
end

Expand Down
2 changes: 1 addition & 1 deletion [admin]/admin/client/gui/admin_performance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function aPerformance ()
aPerformanceVehicle = guiCreateCheckBox ( 0.05, 0.50, 0.90, 0.08, "Unload Vehicle Form when not used", false, true, aPerformanceForm )
aPerformanceBan = guiCreateCheckBox ( 0.05, 0.58, 0.90, 0.08, "Unload Ban Form when not used", false, true, aPerformanceForm )
guiCreateStaticImage ( 0.05, 0.68, 0.60, 0.003, "client\\images\\dot.png", true, aPerformanceForm )
aPerformanceInput = guiCreateCheckBox ( 0.05, 0.70, 0.90, 0.08, "Unload Input Box when not used", false, true, aPerformanceForm )
aPerformanceInput = guiCreateCheckBox ( 0.05, 0.70, 0.90, 0.08, "Unload Input Box when not used", false, true, aPerformanceForm )
aPerformanceMessage = guiCreateCheckBox ( 0.05, 0.78, 0.90, 0.08, "Unload Message Box when not used", false, true, aPerformanceForm )

aPerformanceOk = guiCreateButton ( 0.79, 0.90, 0.18, 0.08, "Ok", true, aPerformanceForm )
Expand Down
Loading

0 comments on commit c934400

Please sign in to comment.