Skip to content

Commit 6a81adf

Browse files
Merge branch 'master' into newmodels-freeroam
2 parents ee549aa + 4e83755 commit 6a81adf

File tree

357 files changed

+172493
-116783
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

+172493
-116783
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
Resources are a key part of [Multi Theft Auto](https://github.com/multitheftauto). A resource is essentially a folder or zip file that contains a collection of files - including essential script and content files, plus a meta file that describes how the resource should be loaded - and runs on a Multi Theft Auto dedicated server.
44

5-
A resource can be seen as being partly equivalent to a program running in an operating system - it can be started and stopped, and multiple resources can run at once. Its worth remember though, that unlike programs on an operating system, there is no multi-tasking between resources. Resources generally contain content and Lua scripts for game modes, user interfaces and other tasks affecting the players that are connected to the dedicated server on which the resources are running.
5+
A resource can be seen as being partly equivalent to a program running in an operating system - it can be started and stopped, and multiple resources can run at once. It's worth remembering, though, that unlike programs on an operating system, there is no multi-tasking between resources. Resources generally contain content and Lua scripts for game modes, user interfaces, and other tasks affecting the players that are connected to the dedicated server on which the resources are running.
66

7-
This project maintains a list of up-to-date resources that come with Multi Theft Auto. These can be checked out by anyone that wishes to run a dedicated server with the latest resources.
7+
This project maintains a list of up-to-date resources that come with Multi Theft Auto. These can be checked out by anyone who wishes to run a dedicated server with the latest resources. To learn about every resource in this repository, visit the [Default resources Wiki Page](https://wiki.multitheftauto.com/wiki/Default_resources).
88

9-
For a collection of user created resources, head over to our [Community](https://community.mtasa.com) web page which serves as a place for hosting our community's resources.
9+
For a collection of user-created resources, head over to our [Community](https://community.mtasa.com) web page which serves as a place for hosting our community's resources.
1010

11-
To report a bug or suggest an idea, [please submit a GitHub issue](https://github.com/multitheftauto/mtasa-resources/issues/new/choose).
11+
To report a bug or suggest an idea, [please submit a GitHub issue](https://github.com/multitheftauto/mtasa-resources/issues/new/choose). To understand the entire development cycle and process of this project, read the [Contributing Guide](https://github.com/multitheftauto/mtasa-docs/blob/main/mtasa-resources/CONTRIBUTING.md).
1212

1313
## License
1414

15-
Unless otherwise specified, all source code hosted on this repository is licensed under the MIT license. See the LICENSE file for more details.
15+
Unless otherwise specified, all source code hosted in this repository is licensed under the MIT license. See the LICENSE file for more details.

[admin]/acpanel/meta.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<meta>
2-
<info description="Anti-Cheat Control Panel" author="ccw" version="0.1.8" type="script" />
3-
<min_mta_version server="1.3.1" client="1.3.1"></min_mta_version>
2+
<info description="Anti-Cheat Control Panel" author="ccw" version="0.2.0" type="script" />
3+
<min_mta_version server="1.6.0" client="1.6.0"></min_mta_version>
44

55
<script src="_common.lua"/>
66
<script src="s_joiner.lua"/>
@@ -20,7 +20,7 @@
2020

2121

2222
<settings>
23-
<setting name="*admingroup" value="Admin,AdminPlus"
23+
<setting name="*admingroup" value="Admin"
2424
friendlyname="Admin group list"
2525
group="_Advanced"
2626
accept="*"

[admin]/acpanel/s_main.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function updatePlayer(player)
4747

4848
if newAllowed and not oldAllowed then
4949
bindKey( player, "o", "down", "Show_AC_Panel" )
50-
outputChatBox ( "Press 'o' to open your AC panel", player )
50+
outputChatBox ( "Press 'o' to open AC panel", player )
5151
if not bAllowGui then return end
5252
sendAllSettingsToClient()
5353
triggerClientEvent(player, 'onAcpClientInitialSettings', resourceRoot, getServerConfigSettingsToTransfer() )
@@ -113,10 +113,10 @@ function doesResourceHasPermissions()
113113
end
114114

115115
if not bResourceHasPermissions then
116-
outputChatBox( "AC Panel can not start until this command is run:" )
117-
outputChatBox( "aclrequest allow acpanel all" )
116+
outputServerLog( "AC Panel can not start until this command is run:" )
117+
outputServerLog( "aclrequest allow acpanel all" )
118118
else
119-
outputChatBox( "Please restart AC Panel" )
119+
outputServerLog( "Please restart AC Panel" )
120120
end
121121
return false
122122
end

[admin]/acpanel/s_settings.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,16 @@ end
198198
-- Get version data from remote server
199199
---------------------------------------------------------
200200
function GetVersInfoFromRemoteServer()
201-
fetchRemote( "http://nightly.mtasa.com/ver/", onGotVersInfo )
201+
fetchRemote( "https://nightly.multitheftauto.com/ver/", onGotVersInfo )
202202
end
203203

204204
function onGotVersInfo( responseData, errno )
205205
if errno == 0 then
206206

207-
local ver = string.sub( getVersion().sortable, 0, 3 )
207+
local ver = string.sub( getVersion().sortable, 1, 3 )
208208

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

212212
if releaseMinVersion and latestMinVersion then
213213
releaseMinVersion = ver .. "." .. releaseMinVersion
@@ -247,7 +247,7 @@ function onGotAcPanelVersInfo( responseData, errno )
247247
setPanelSetting( "acpanelVersion", acpanelVersion )
248248
setPanelSetting( "acpanelUrl", acpanelUrl )
249249
if acpanelVersion > _version then
250-
outputChatBox("New version of Anti-Cheat panel is available!")
250+
outputServerLog("New version of Anti-Cheat panel is available!")
251251
end
252252
end
253253
end

[admin]/admin/admin_definitions.lua

Lines changed: 5 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -10,156 +10,14 @@
1010

1111
_DEBUG = false
1212

13-
_version = '1.5.9'
13+
_version = '1.6'
14+
15+
-- MISC DEFINITIONS
16+
ADMIN_CHAT_MAXLENGTH = 225
1417

1518
function enum ( args, prefix )
1619
for i, v in ipairs ( args ) do
1720
if ( prefix ) then _G[v] = prefix..i
1821
else _G[v] = i end
1922
end
20-
end
21-
22-
-- MISC DEFINITIONS
23-
ADMIN_CHAT_MAXLENGTH = 225
24-
25-
-- EVENT CALLS
26-
27-
enum
28-
({
29-
"EVENT_SYNC",
30-
"EVENT_SYNC_PERMISSIONS",
31-
"EVENT_TEAM",
32-
"EVENT_ADMIN",
33-
"EVENT_PLAYER",
34-
"EVENT_VEHICLE",
35-
"EVENT_RESOURCE",
36-
"EVENT_SERVER",
37-
"EVENT_MESSAGE",
38-
"EVENT_BANS",
39-
"EVENT_EXECUTE",
40-
"EVENT_ADMIN_CHAT",
41-
"EVENT_ADMIN_OPEN",
42-
43-
"EVENT_RESOURCE_START",
44-
"EVENT_RESOURCE_STOP",
45-
"EVENT_PLAYER_JOIN"
46-
} )
47-
48-
-- SYNC DEFINITIONS
49-
50-
enum
51-
({
52-
"SYNC_PLAYER",
53-
"SYNC_PLAYERS",
54-
"SYNC_RESOURCES",
55-
"SYNC_ADMINS",
56-
"SYNC_SERVER",
57-
"SYNC_RIGHTS",
58-
"SYNC_BANS",
59-
"SYNC_MESSAGES"
60-
})
61-
62-
-- TEAM DEFINITIONS
63-
64-
enum
65-
({
66-
"TEAM_CREATE",
67-
"TEAM_DESTROY"
68-
})
69-
70-
-- ADMIN DEFINITIONS
71-
72-
enum
73-
({
74-
"ADMIN_PASSWORD",
75-
"ADMIN_AUTOLOGIN",
76-
"ADMIN_SYNC",
77-
"ADMIN_ACL_CREATE",
78-
"ADMIN_ACL_DESTROY",
79-
"ADMIN_ACL_ADD",
80-
"ADMIN_ACL_REMOVE"
81-
})
82-
83-
-- PLAYER DEFINITIONS
84-
85-
enum
86-
({
87-
"PLAYER_KICK",
88-
"PLAYER_BAN",
89-
"PLAYER_MUTE",
90-
"PLAYER_FREEZE",
91-
"PLAYER_SHOUT",
92-
"PLAYER_SET_HEALTH",
93-
"PLAYER_SET_ARMOUR",
94-
"PLAYER_SET_SKIN",
95-
"PLAYER_SET_MONEY",
96-
"PLAYER_SET_STAT",
97-
"PLAYER_SET_TEAM",
98-
"PLAYER_SET_INTERIOR",
99-
"PLAYER_SET_DIMENSION",
100-
"PLAYER_JETPACK",
101-
"PLAYER_SET_GROUP",
102-
"PLAYER_GIVE_VEHICLE",
103-
"PLAYER_GIVE_WEAPON",
104-
"PLAYER_SLAP",
105-
"PLAYER_WARP",
106-
"PLAYER_WARP_TO"
107-
})
108-
109-
-- VEHICLE DEFINITIONS
110-
111-
enum
112-
({
113-
"VEHICLE_REPAIR",
114-
"VEHICLE_CUSTOMIZE",
115-
"VEHICLE_SET_PAINTJOB",
116-
"VEHICLE_SET_COLOR",
117-
"VEHICLE_BLOW",
118-
"VEHICLE_DESTROY"
119-
})
120-
121-
-- RESOURCE DEFINITIONS
122-
123-
enum
124-
({
125-
"RESOURCE_START",
126-
"RESOURCE_RESTART",
127-
"RESOURCE_STOP"
128-
})
129-
130-
-- SERVER DEFINITIONS
131-
132-
enum
133-
({
134-
"SERVER_SET_GAME",
135-
"SERVER_SET_MAP",
136-
"SERVER_SET_WELCOME",
137-
"SERVER_SET_TIME",
138-
"SERVER_SET_PASSWORD",
139-
"SERVER_SET_WEATHER",
140-
"SERVER_BLEND_WEATHER",
141-
"SERVER_SET_GAME_SPEED",
142-
"SERVER_SET_GRAVITY",
143-
"SERVER_SET_BLUR_LEVEL",
144-
"SERVER_SET_WAVE_HEIGHT"
145-
})
146-
147-
-- MESSAGE DEFINITIONS
148-
149-
enum
150-
({
151-
"MESSAGE_NEW",
152-
"MESSAGE_GET",
153-
"MESSAGE_READ",
154-
"MESSAGE_DELETE"
155-
})
156-
157-
-- BANS DEFINITIONS
158-
159-
enum
160-
({
161-
"BANS_BAN_IP",
162-
"BANS_BAN_SERIAL",
163-
"BANS_UNBAN_IP",
164-
"BANS_UNBAN_SERIAL"
165-
})
23+
end

[admin]/admin/client/admin_client.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
_DEBUG = false
1212

13-
_version = '1.5.9'
13+
_version = '1.6'
1414
_flags = {}
1515
_widgets = {}
1616
_settings = nil
@@ -26,6 +26,7 @@ function aClientAdminMenu ()
2626
aAdminMenuClose ( false )
2727
else
2828
aAdminMenu ()
29+
guiFocus (aAdminForm)
2930
end
3031
end
3132

@@ -39,6 +40,7 @@ addEvent ( "aClientAdminChat", true )
3940
addEvent ( "aClientResourceStart", true )
4041
addEvent ( "aClientResourceStop", true )
4142
addEvent ( "aClientAdminMenu", true )
43+
addEvent ( "aClientReports", true )
4244
function aAdminResourceStart ()
4345
addEventHandler ( "aClientAdminMenu", root, aClientAdminMenu )
4446
local node = xmlLoadFile ( "conf\\weathers.xml" )

[admin]/admin/client/colorpicker/colorpicker.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ function colorPicker.create(id, start, title)
8282
end
8383

8484
function colorPicker:render()
85-
-- if not self.gui.focus then return end
8685
local x,y = guiGetPosition(self.gui.window, false)
8786
dxDrawRectangle(x+16, y+32, 256, 256, self.color.huecurrent, self.gui.focus)
8887
dxDrawImage(x+16, y+32, 256, 256, "client/colorpicker/sv.png", 0, 0, 0, self.color.white, self.gui.focus)

[admin]/admin/client/gui/admin_acl.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ function aManageACL ()
2424
guiGridListSetSortingEnabled ( aACLList, false )
2525
guiGridListAddColumn( aACLList, "", 0.10 )
2626
guiGridListAddColumn( aACLList, "", 0.85 )
27-
aACLCreateGroup = guiCreateButton ( 0.55, 0.05, 0.40, 0.04, "Create group", true, aAclForm )
28-
aACLCreateACL = guiCreateButton ( 0.55, 0.10, 0.40, 0.04, "Create ACL", true, aAclForm )
27+
aACLCreateGroup = guiCreateButton ( 0.55, 0.05, 0.40, 0.04, "Create group", true, aAclForm, "aclcreate" )
28+
aACLCreateACL = guiCreateButton ( 0.55, 0.10, 0.40, 0.04, "Create ACL", true, aAclForm, "aclcreate" )
2929
aACLLabel = guiCreateLabel ( 0.55, 0.19, 0.40, 0.04, "", true, aAclForm )
3030
aACLSeparator = guiCreateStaticImage ( 0.55, 0.235, 0.40, 0.0025, "client\\images\\dot.png", true, aAclForm )
31-
aACLDestroyGroup = guiCreateButton ( 0.55, 0.25, 0.40, 0.04, "Destroy group", true, aAclForm )
32-
aACLDestroyACL = guiCreateButton ( 0.55, 0.25, 0.40, 0.04, "Destroy ACL", true, aAclForm )
33-
aACLAddObject = guiCreateButton ( 0.55, 0.30, 0.40, 0.04, "Add Object", true, aAclForm )
34-
aACLRemoveObject = guiCreateButton ( 0.55, 0.35, 0.40, 0.04, "Remove Object", true, aAclForm )
31+
aACLDestroyGroup = guiCreateButton ( 0.55, 0.25, 0.40, 0.04, "Destroy group", true, aAclForm, "acldestroy" )
32+
aACLDestroyACL = guiCreateButton ( 0.55, 0.25, 0.40, 0.04, "Destroy ACL", true, aAclForm, "acldestroy" )
33+
aACLAddObject = guiCreateButton ( 0.55, 0.30, 0.40, 0.04, "Add Object", true, aAclForm, "acladd" )
34+
aACLRemoveObject = guiCreateButton ( 0.55, 0.35, 0.40, 0.04, "Remove Object", true, aAclForm, "aclremove" )
3535
aACLAddACL = guiCreateButton ( 0.55, 0.40, 0.40, 0.04, "Add ACL", true, aAclForm )
3636
aACLRemoveACL = guiCreateButton ( 0.55, 0.45, 0.40, 0.04, "Remove ACL", true, aAclForm )
3737

[admin]/admin/client/gui/admin_main.lua

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ aLastSync = 0
2020
aResources = {}
2121

2222
local serverPassword = 'None'
23+
local hasResourceSetting
2324

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

182183
aTab2 = {}
183184
aTab2.Tab = guiCreateTab ( "Resources", aTabPanel, "resources" )
184-
aTab2.ManageACL = guiCreateButton ( 0.75, 0.02, 0.23, 0.04, "Manage ACL", true, aTab2.Tab )
185+
aTab2.ManageACL = guiCreateButton ( 0.75, 0.02, 0.23, 0.04, "Manage ACL", true, aTab2.Tab, "aclmanager" )
185186
aTab2.ResourceListSearch = guiCreateEdit ( 0.03, 0.05, 0.31, 0.04, "", true, aTab2.Tab )
186187
guiCreateStaticImage ( 0.34, 0.05, 0.035, 0.04, "client\\images\\search.png", true, aTab2.Tab )
187188
aTab2.ResourceList = guiCreateGridList ( 0.03, 0.10, 0.35, 0.80, true, aTab2.Tab )
@@ -194,6 +195,7 @@ y=y+B aTab1.VehicleHealth = guiCreateLabel ( 0.26, y, 0.25, 0.04, "Vehicle Heal
194195
aTab2.ResourceInclMaps = guiCreateCheckBox ( 0.03, 0.91, 0.15, 0.04, "Include Maps", false, true, aTab2.Tab )
195196
aTab2.ResourceRefresh = guiCreateButton ( 0.20, 0.915, 0.18, 0.04, "Refresh list", true, aTab2.Tab, "listresources" )
196197
aTab2.ResourceSettings = guiCreateButton ( 0.40, 0.05, 0.20, 0.04, "Settings", true, aTab2.Tab )
198+
guiSetVisible ( aTab2.ResourceSettings, false)
197199
aTab2.ResourceStart = guiCreateButton ( 0.40, 0.10, 0.20, 0.04, "Start", true, aTab2.Tab, "start" )
198200
aTab2.ResourceRestart = guiCreateButton ( 0.40, 0.15, 0.20, 0.04, "Restart", true, aTab2.Tab, "restart" )
199201
aTab2.ResourceStop = guiCreateButton ( 0.40, 0.20, 0.20, 0.04, "Stop", true, aTab2.Tab, "stop" )
@@ -969,7 +971,9 @@ end
969971
function aClientDoubleClick ( button )
970972
if ( source == aTab2.ResourceList ) then
971973
if ( guiGridListGetSelectedItem ( aTab2.ResourceList ) ~= -1 ) then
972-
aManageSettings ( guiGridListGetItemText ( aTab2.ResourceList, guiGridListGetSelectedItem( aTab2.ResourceList ), 1 ) )
974+
if hasResourceSetting then
975+
aManageSettings ( guiGridListGetItemText ( aTab2.ResourceList, guiGridListGetSelectedItem( aTab2.ResourceList ), 1 ) )
976+
end
973977
end
974978
elseif ( source == aTab4.BansList ) then
975979
if ( guiGridListGetSelectedItem ( aTab4.BansList ) == -1 ) then
@@ -1059,6 +1063,10 @@ function aClientClick ( button )
10591063
elseif ( source == aTab2.ResourceList ) then
10601064
guiSetVisible ( aTab2.ResourceFailture, false )
10611065
if ( guiGridListGetSelectedItem ( aTab2.ResourceList ) ~= -1 ) then
1066+
local resName = guiGridListGetItemText(aTab2.ResourceList, guiGridListGetSelectedItem( aTab2.ResourceList ), 1)
1067+
if resName then
1068+
triggerServerEvent("aAdmin", localPlayer, "resourcelist", resName)
1069+
end
10621070
guiSetText(aTab2.ResourceName, "Full Name: " .. guiGridListGetItemText(aTab2.ResourceList, guiGridListGetSelectedItem ( aTab2.ResourceList ), 4))
10631071
guiSetText(aTab2.ResourceAuthor, "Author: " .. guiGridListGetItemText(aTab2.ResourceList, guiGridListGetSelectedItem ( aTab2.ResourceList ), 5))
10641072
guiSetText(aTab2.ResourceVersion, "Version: " .. guiGridListGetItemText(aTab2.ResourceList, guiGridListGetSelectedItem ( aTab2.ResourceList ), 6))
@@ -1192,6 +1200,17 @@ function aClientClick ( button )
11921200
end
11931201
end
11941202

1203+
addEvent ("setVisibilityOfSettingsButton", true)
1204+
function setVisibilityOfSettingsButton (showResourceSetting)
1205+
hasResourceSetting = showResourceSetting
1206+
if hasResourceSetting then
1207+
guiSetVisible(aTab2.ResourceSettings, true)
1208+
else
1209+
guiSetVisible(aTab2.ResourceSettings, false)
1210+
end
1211+
end
1212+
addEventHandler ( "setVisibilityOfSettingsButton", resourceRoot, setVisibilityOfSettingsButton)
1213+
11951214
function aClientRender ()
11961215
if ( guiGetVisible ( aAdminForm ) ) then
11971216
if ( getTickCount() >= aLastCheck ) then

[admin]/admin/client/gui/admin_maps.lua

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,6 @@ function guiClick(button)
7878
else
7979
guiSetEnabled(aTabMap.NextMap, false)
8080
end
81-
-- if gamemode == "deleted maps" then
82-
-- guiSetEnabled(aTabMap.Start, false)
83-
-- guiSetEnabled(aTabMap.Delete, false)
84-
-- guiSetEnabled(aTabMap.Revert, true)
85-
-- else
86-
-- guiSetEnabled(aTabMap.Start, true)
87-
-- guiSetEnabled(aTabMap.Delete, true)
88-
-- guiSetEnabled(aTabMap.Revert, false)
89-
-- end
9081
elseif source == aTabMap.Start then
9182
triggerServerEvent("startGamemodeMap_s", localPlayer, gamemode, mapResName)
9283
elseif source == aTabMap.NextMap then

0 commit comments

Comments
 (0)