Skip to content

Commit e0662af

Browse files
Merge branch 'master' into mapfixes-improve
2 parents 1dbbb97 + 0eebbf6 commit e0662af

File tree

15 files changed

+697
-430
lines changed

15 files changed

+697
-430
lines changed

[admin]/admin2/client/main/admin_server.lua

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,18 @@ aServerTab = {
3131
SniperMoon = 'Sniper Moon',
3232
ExtraAirResistance = 'Extra Air Resistance',
3333
UnderWorldWarp = 'Under World Warp',
34-
VehiclesSunGlare = "Vehicles Sun Glare",
34+
VehicleSunGlare = "Vehicles Sun Glare",
3535
CoronaZTest = "Corona Z Test",
3636
WaterCreatures = "Water Creatures",
3737
BurnFlippedCars = "Burn Flipped Cars",
38-
FireBallDestruct = "Fire Ball Destruct"
38+
FireBallDestruct = "Fire Ball Destruct",
39+
RoadSignsText = "Road Signs Text",
40+
ExtendedWaterCannons = "Extended Water Cannons",
41+
TunnelWeatherBlend = "Tunnel Weather Blend",
42+
IgnoreFireState = "Ignore Fire State",
43+
FlyingComponents = "Flying Components",
44+
VehicleBurnExplosions = "Vehicle Burn Explosions",
45+
Vehicle_Engine_AutoStart = "Vehicle Engine Auto Start"
3946
}
4047
}
4148

@@ -437,13 +444,13 @@ function aServerTab.onClientClick(button)
437444
"underworldwarp",
438445
iif(guiCheckBoxGetSelected(aServerTab.UnderWorldWarp), "on", "off")
439446
)
440-
elseif (source == aServerTab.VehiclesSunGlare) then
447+
elseif (source == aServerTab.VehicleSunGlare) then
441448
triggerServerEvent(
442449
"aServer",
443450
localPlayer,
444451
"setworldproperty",
445452
"vehiclesunglare",
446-
iif(guiCheckBoxGetSelected(aServerTab.VehiclesSunGlare), "on", "off")
453+
iif(guiCheckBoxGetSelected(aServerTab.VehicleSunGlare), "on", "off")
447454
)
448455
elseif (source == aServerTab.CoronaZTest) then
449456
triggerServerEvent(
@@ -461,6 +468,54 @@ function aServerTab.onClientClick(button)
461468
"watercreatures",
462469
iif(guiCheckBoxGetSelected(aServerTab.WaterCreatures), "on", "off")
463470
)
471+
elseif (source == aServerTab.RoadSignsText) then
472+
triggerServerEvent(
473+
"aServer",
474+
localPlayer,
475+
"setworldproperty",
476+
"roadsignstext",
477+
iif(guiCheckBoxGetSelected(aServerTab.RoadSignsText), "on", "off")
478+
)
479+
elseif (source == aServerTab.ExtendedWaterCannons) then
480+
triggerServerEvent(
481+
"aServer",
482+
localPlayer,
483+
"setworldproperty",
484+
"extendedwatercannons",
485+
iif(guiCheckBoxGetSelected(aServerTab.ExtendedWaterCannons), "on", "off")
486+
)
487+
elseif (source == aServerTab.TunnelWeatherBlend) then
488+
triggerServerEvent(
489+
"aServer",
490+
localPlayer,
491+
"setworldproperty",
492+
"tunnelweatherblend",
493+
iif(guiCheckBoxGetSelected(aServerTab.TunnelWeatherBlend), "on", "off")
494+
)
495+
elseif (source == aServerTab.FlyingComponents) then
496+
triggerServerEvent(
497+
"aServer",
498+
localPlayer,
499+
"setworldproperty",
500+
"flyingcomponents",
501+
iif(guiCheckBoxGetSelected(aServerTab.FlyingComponents), "on", "off")
502+
)
503+
elseif (source == aServerTab.VehicleBurnExplosions) then
504+
triggerServerEvent(
505+
"aServer",
506+
localPlayer,
507+
"setworldproperty",
508+
"vehicleburnexplosions",
509+
iif(guiCheckBoxGetSelected(aServerTab.VehicleBurnExplosions), "on", "off")
510+
)
511+
elseif (source == aServerTab.Vehicle_Engine_AutoStart) then
512+
triggerServerEvent(
513+
"aServer",
514+
localPlayer,
515+
"setworldproperty",
516+
"vehicle_engine_autostart",
517+
iif(guiCheckBoxGetSelected(aServerTab.Vehicle_Engine_AutoStart), "on", "off")
518+
)
464519
end
465520
end
466521
end
@@ -523,11 +578,18 @@ function aServerTab.onRefresh()
523578
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.SniperMoon, 2, isWorldSpecialPropertyEnabled("snipermoon") and "" or "", false, false)
524579
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.ExtraAirResistance, 2, isWorldSpecialPropertyEnabled("extraairresistance") and "" or "", false, false)
525580
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.UnderWorldWarp, 2, isWorldSpecialPropertyEnabled("underworldwarp") and "" or "", false, false)
526-
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.VehiclesSunGlare, 2, isWorldSpecialPropertyEnabled("vehiclesunglare") and "" or "", false, false)
581+
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.VehicleSunGlare, 2, isWorldSpecialPropertyEnabled("vehiclesunglare") and "" or "", false, false)
527582
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.CoronaZTest, 2, isWorldSpecialPropertyEnabled("coronaztest") and "" or "", false, false)
528583
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.WaterCreatures, 2, isWorldSpecialPropertyEnabled("watercreatures") and "" or "", false, false)
529584
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.BurnFlippedCars, 2, isWorldSpecialPropertyEnabled("burnflippedcars") and "" or "", false, false)
530585
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.FireBallDestruct, 2, isWorldSpecialPropertyEnabled("fireballdestruct") and "" or "", false, false)
586+
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.RoadSignsText, 2, isWorldSpecialPropertyEnabled("roadsignstext") and "" or "", false, false)
587+
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.ExtendedWaterCannons, 2, isWorldSpecialPropertyEnabled("extendedwatercannons") and "" or "", false, false)
588+
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.TunnelWeatherBlend, 2, isWorldSpecialPropertyEnabled("tunnelweatherblend") and "" or "", false, false)
589+
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.IgnoreFireState, 2, isWorldSpecialPropertyEnabled("ignorefirestate") and "" or "", false, false)
590+
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.FlyingComponents, 2, isWorldSpecialPropertyEnabled("flyingcomponents") and "" or "", false, false)
591+
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.VehicleBurnExplosions, 2, isWorldSpecialPropertyEnabled("vehicleburnexplosions") and "" or "", false, false)
592+
guiGridListSetItemText(aServerTab.Glitches_Properties, aServerTab.Vehicle_Engine_AutoStart, 2, isWorldSpecialPropertyEnabled("vehicle_engine_autostart") and "" or "", false, false)
531593

532594
triggerServerEvent("aServerGlitchRefresh", localPlayer)
533595
end

[admin]/admin2/client/widgets/admin_ban.lua

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,28 @@ end
5656

5757
function aBan.Create()
5858
local sx, sy = guiGetScreenSize()
59-
aBan.Form = guiCreateWindow(sx / 2 - 175, sy / 2 - 170, 350, 340, "Add ban", false)
59+
aBan.Form = guiCreateWindow(sx / 2 - 175, sy / 2 - 185, 350, 370, "Add ban", false)
6060
aBan.ReasonLabel = guiCreateLabel(25, 40, 300, 20, "Ban reason (required):", false, aBan.Form)
61-
aBan.ReasonEditBox = guiCreateEdit(25, 70, 300, 30, "Enter ban reason...", false, aBan.Form)
61+
aBan.ReasonEditBox = guiCreateEdit(25, 65, 300, 30, "Enter ban reason...", false, aBan.Form)
6262
aBan.ReasonEditBoxRecievedInput = false
6363
aBan.DurationLabel = guiCreateLabel(25, 110, 300, 20, "Ban duration (required):", false, aBan.Form)
64-
aBan.DurationComboBox = guiCreateComboBox(25, 145, 150, 100, "Select ban duration...", false, aBan.Form)
64+
aBan.DurationComboBox = guiCreateComboBox(25, 140, 300, 100, "Select ban duration...", false, aBan.Form)
6565
for i=1, #aBan.defaultDurations do
6666
guiComboBoxAddItem(aBan.DurationComboBox, aBan.defaultDurations[i][1])
6767
end
68-
aBan.DurationEditBox = guiCreateEdit(175, 140, 150, 30, "Duration (seconds)...", false, aBan.Form)
68+
aBan.DurationEditBox = guiCreateEdit(25, 175, 300, 30, "Duration (seconds)...", false, aBan.Form)
6969
guiSetEnabled(aBan.DurationEditBox, false)
7070
aBan.DurationEditBoxRecievedInput = false
71-
aBan.IdentifiersLabel = guiCreateLabel(25, 180, 300, 20, "Select identifiers to use (select at least 1):", false, aBan.Form)
72-
aBan.IPCheckBox = guiCreateCheckBox(45, 210, 125, 30, "Use IP address", true, false, aBan.Form)
73-
aBan.IPEditBox = guiCreateEdit(175, 210, 150, 30, "Enter IP address...", false, aBan.Form)
71+
aBan.IdentifiersLabel = guiCreateLabel(25, 220, 300, 20, "Select identifiers to use (select at least 1):", false, aBan.Form)
72+
aBan.IPCheckBox = guiCreateCheckBox(25, 245, 125, 30, "", true, false, aBan.Form)
73+
aBan.IPEditBox = guiCreateEdit(50, 245, 275, 30, "Enter IP address...", false, aBan.Form)
7474
aBan.IPEditBoxRecievedInput = false
75-
aBan.SerialCheckBox = guiCreateCheckBox(45, 250, 125, 30, "Use MTA serial", true, false, aBan.Form)
76-
aBan.SerialEditBox = guiCreateEdit(175, 250, 150, 30, "Enter MTA serial...", false, aBan.Form)
75+
aBan.SerialCheckBox = guiCreateCheckBox(25, 280, 125, 30, "", true, false, aBan.Form)
76+
aBan.SerialEditBox = guiCreateEdit(50, 280, 275, 30, "Enter MTA serial...", false, aBan.Form)
7777
guiEditSetMaxLength(aBan.SerialEditBox, 32)
7878
aBan.SerialEditBoxRecievedInput = false
79-
aBan.SubmitButton = guiCreateButton(105, 290, 60, 40, "Submit", false, aBan.Form)
80-
aBan.CancelButton = guiCreateButton(185, 290, 60, 40, "Cancel", false, aBan.Form)
79+
aBan.SubmitButton = guiCreateButton(70, 324, 100, 30, "Submit", false, aBan.Form)
80+
aBan.CancelButton = guiCreateButton(180, 324, 100, 30, "Cancel", false, aBan.Form)
8181
aRegister("Ban", aBan.Form, aBan.Show, aBan.Close)
8282
guiSetVisible(aBan.Form, false)
8383
end

[admin]/admin2/meta.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<script src="server/admin_network.lua" type="server"/>
3030
<script src="server/admin_messagebox.lua" type="server"/>
3131
<script src="server/admin_screenshot.lua" type="server"/>
32+
<script src="server/admin_whowas.lua" />
3233

3334
<script src="client/admin_wrapper.lua" type="client" cache="false"/>
3435
<script src="client/admin_gui.lua" type="client" cache="false"/>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
local info = getElementData(root, "WhoWas", info) or {}
2+
removeElementData(root, "WhoWas")
3+
4+
addEventHandler("onPlayerJoin", root, function()
5+
local name = getPlayerName(source)
6+
local serial = getPlayerSerial(source)
7+
for i, data in pairs(info) do
8+
if (data[1] == name and data[2] == serial) then
9+
return true
10+
end
11+
end
12+
info[#info + 1] = {name, serial, accName, getPlayerIP(source)}
13+
end)
14+
15+
addEventHandler("onPlayerLogin", root, function(old, new)
16+
local name = getPlayerName(source)
17+
local serial = getPlayerSerial(source)
18+
local accName = getAccountName(new)
19+
for i, data in pairs(info) do
20+
if (data[1] == name and data[2] == serial and data[3] == accName) then
21+
return true
22+
end
23+
end
24+
info[#info + 1] = {name, serial, accName, getPlayerIP(source)}
25+
end)
26+
27+
addEventHandler("onPlayerChangeNick", root, function(old, name)
28+
local serial = getPlayerSerial(source)
29+
for i, data in pairs(info) do
30+
if data[1] == name and data[2] == serial then
31+
return true
32+
end
33+
end
34+
local acc = getPlayerAccount(source)
35+
if isGuestAccount(acc) then
36+
acc = nil
37+
else
38+
acc = getAccountName(acc)
39+
end
40+
info[#info + 1] = {name, serial, acc, getPlayerIP(source)}
41+
end)
42+
43+
function cmdWhoWas(plr, cmd, name)
44+
if not hasObjectPermissionTo(plr, "command.whowas", false) and not hasObjectPermissionTo(plr, "command.listbans", false) then
45+
outputChatBox("You don't have access to 'command.whowas' or 'command.listbans'", plr, 255, 0, 0)
46+
return false
47+
end
48+
local found = 0
49+
outputChatBox("Players who had "..name.." in their name/serial/account/IP:", plr, 0, 255, 0)
50+
for i, data in pairs(info) do
51+
if string.find(data[1], name, 1, true) or string.find(data[2], name, 1, true) or string.find(data[3], name, 1, true) or string.find(data[4], name, 1, true) then
52+
outputChatBox(data[1].." #F7FF00"..data[2].." #FDC11C"..(data[3] or "guest").." #FD581C"..data[4], plr, 0, 255, 0, true)
53+
found = found + 1
54+
if (found > 100) then
55+
outputChatBox("Reached limit of 100 returns, refine your search.", plr, 0, 255, 0, true)
56+
return true
57+
end
58+
end
59+
end
60+
end
61+
addCommandHandler("whowas", cmdWhoWas)
62+
63+
-- Add players when script starts
64+
for i, plr in pairs(getElementsByType("player")) do
65+
local alreadyIn = false
66+
for i2, data in pairs(info) do
67+
if data[1] == getPlayerName(plr) and data[2] == getPlayerSerial(plr) then
68+
alreadyIn = true
69+
break
70+
end
71+
end
72+
if not alreadyIn then
73+
local acc = getPlayerAccount(plr)
74+
if isGuestAccount(acc) then
75+
acc = nil
76+
else
77+
acc = getAccountName(acc)
78+
end
79+
info[#info + 1] = {getPlayerName(plr), getPlayerSerial(plr), acc, getPlayerIP(plr)}
80+
end
81+
end
82+
83+
addEventHandler("onResourceStop", resourceRoot, function()
84+
setElementData(root, "WhoWas", info, false) -- This preserves whowas data from resource restarts.
85+
end)

[editor]/editor_gui/client/load.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ function openSearch()
7575
guiGridListSetItemText ( loadDialog.mapsList, row, 3, res["version"], false, false )
7676
end
7777
else
78-
local escapedText = string.gsub(string.lower(text), "([%-%.%+%*%?%[%]%^%$%(%)%%])", "%%%1")
7978
for i,res in ipairs(openResources) do
80-
if string.find(res["friendlyName"], escapedText) then
79+
if utf8.find(utf8.lower(res["friendlyName"]), utf8.lower(text), 1, true) then
8180
local row = guiGridListAddRow ( loadDialog.mapsList )
8281
guiGridListSetItemText ( loadDialog.mapsList, row, 1, res["friendlyName"], false, false )
8382
guiGridListSetItemText ( loadDialog.mapsList, row, 2, res["gamemodes"], false, false )

[editor]/editor_gui/client/mapsettings_gui.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ function createMapSettings()
3939
mapsettings.cancel = guiCreateButton ( 0.780357142, 0.919444, 0.22857142, 0.05555555, "Cancel", true, mapsettings.window )
4040

4141
--create environment settings
42-
mapsettings.locked_time = editingControl.boolean:create{["x"]=0.26,["y"]=0.04,["width"]=1,["height"]=0.1,["relative"]=true,["parent"]=mapsettings.environmentTab,["label"]="Locked time"}
43-
mapsettings.useLODs = editingControl.boolean:create{["x"]=0.46,["y"]=0.04,["width"]=1,["height"]=0.1,["relative"]=true,["parent"]=mapsettings.environmentTab,["label"]="Use LODs"}
42+
mapsettings.locked_time = editingControl.boolean:create{["x"]=0.26,["y"]=0.04,["width"]=0.2,["height"]=0.1,["relative"]=true,["parent"]=mapsettings.environmentTab,["label"]="Locked time"}
43+
mapsettings.useLODs = editingControl.boolean:create{["x"]=0.46,["y"]=0.04,["width"]=0.2,["height"]=0.1,["relative"]=true,["parent"]=mapsettings.environmentTab,["label"]="Use LODs"}
4444
guiCreateMinimalLabel ( 0.02, 0.06, "Time:", true, mapsettings.environmentTab )
4545
mapsettings.timeHour = editingControl.natural:create{["x"]=0.08,["y"]=0.04,["width"]=0.07,["height"]=0.11,["relative"]=true,["parent"]=mapsettings.environmentTab,["maxLength"]=2,["max"]=23}
4646
mapsettings.timeMinute = editingControl.natural:create{["x"]=0.16,["y"]=0.04,["width"]=0.07,["height"]=0.11,["relative"]=true,["parent"]=mapsettings.environmentTab,["maxLength"]=2,["max"]=59}

0 commit comments

Comments
 (0)