Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions [admin]/acpanel/c_gui_ac.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ function aAntiCheatTab.Create ( tab )
ypos = ypos + 5

local msg = "To turn OFF an AC#, add number to <disableac> setting in mtaserver.conf and restart server"
local label1 = guiCreateLabel ( xpos, ypos, 700, 16, msg, false, tab )
guiLabelSetColor(label1, unpack(colorYellow) )
guiSetFont(label1, "default-bold-small" )
local label2 = guiCreateLabel ( xpos, ypos, 700, 16, msg, false, tab )
guiLabelSetColor(label2, unpack(colorYellow) )
guiSetFont(label2, "default-bold-small" )

ypos = ypos + 25

Expand Down Expand Up @@ -123,9 +123,9 @@ function aAntiCheatTab.Create ( tab )
ypos = ypos + 5

local msg = "To turn ON a SD#, add number to <enablesd> setting in mtaserver.conf and restart server"
local label1 = guiCreateLabel ( xpos, ypos, 700, 16, msg, false, tab )
guiSetFont(label1, "default-bold-small" )
guiLabelSetColor(label1, unpack(colorYellow) )
local label3 = guiCreateLabel ( xpos, ypos, 700, 16, msg, false, tab )
guiSetFont(label3, "default-bold-small" )
guiLabelSetColor(label3, unpack(colorYellow) )

ypos = ypos + 25

Expand Down
2 changes: 1 addition & 1 deletion [admin]/acpanel/c_gui_block_mods.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function aBlockModsTab.Create ( tab )
---------------------------------------------------------
-- Definition list
---------------------------------------------------------
local label1 = guiCreateLabel ( xpos, ypos, 200, 16, "File name matches (one per line)", false, tab )
local label2 = guiCreateLabel ( xpos, ypos, 200, 16, "File name matches (one per line)", false, tab )
ypos = ypos + 20
aBlockModsTab.memoDefinition = guiCreateMemo ( xpos, ypos, 250, 300, "", false, tab )
ypos = ypos + 300
Expand Down
14 changes: 7 additions & 7 deletions [admin]/acpanel/c_gui_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function aServerConfigTab.Create ( tab )
---------------------------------------------------------
-- Definition list
---------------------------------------------------------
local label1 = guiCreateLabel ( xpos, ypos, 200, 16, "Min client version:", false, tab )
local label2 = guiCreateLabel ( xpos, ypos, 200, 16, "Min client version:", false, tab )
ypos = ypos + 20
--aServerConfigTab.memoDefinition = guiCreateMemo ( xpos, ypos, 250, 40, "", false, tab )
aServerConfigTab.memoDefinition = guiCreateEdit ( xpos, ypos, 250, 30, "", false, tab )
Expand Down Expand Up @@ -102,20 +102,20 @@ function aServerConfigTab.Refresh()

local info = aServerConfigTab.getInfoForType("release")
info.text = getPanelSetting( "lastFetchedReleaseVersion" )
local info = aServerConfigTab.getInfoForType("latest")
info.text = getPanelSetting( "lastFetchedLatestVersion" )
local info2 = aServerConfigTab.getInfoForType("latest")
info2.text = getPanelSetting( "lastFetchedLatestVersion" )

local info = aServerConfigTab.getInfoForType(type)
guiRadioButtonSetSelected( info.button, true )
if info.custom then
local info3 = aServerConfigTab.getInfoForType(type)
guiRadioButtonSetSelected( info3.button, true )
if info3.custom then
local customText = getPanelSetting( "minclientconfig.customText" )
guiSetText( aServerConfigTab.memoDefinition, customText )
guiEditSetReadOnly( aServerConfigTab.memoDefinition, false )
guiSetAlpha ( aServerConfigTab.memoDefinition, 1 )
bSaveMemoEdits = true
else
bSaveMemoEdits = false
guiSetText( aServerConfigTab.memoDefinition, info.text )
guiSetText( aServerConfigTab.memoDefinition, info3.text )
guiEditSetReadOnly( aServerConfigTab.memoDefinition, true )
guiSetAlpha ( aServerConfigTab.memoDefinition, 0.75 )
end
Expand Down
4 changes: 2 additions & 2 deletions [admin]/acpanel/s_img_mod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ function isImgModBlocked( name )
--outputDebug( tostring(defText) )

local lineList = split(defText,"\n")
for _,line in ipairs(lineList) do
local line = string.gsub(line, "\r", "")
for _, line1 in ipairs(lineList) do
local line = string.gsub(line1, "\r", "")
--outputDebug( "Checking " .. name .. " against line " .. tostring(line) )
if line == "*" or string.find(name,line) then
return true
Expand Down
4 changes: 2 additions & 2 deletions [admin]/admin/client/gui/admin_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ end

function aAdminMenu ()
if ( aAdminForm == nil ) then
local x, y = guiGetScreenSize()
aAdminForm = guiCreateWindow ( x / 2 - 310, y / 2 - 260, 620, 520, "", false )
local sx, sy = guiGetScreenSize()
aAdminForm = guiCreateWindow ( sx / 2 - 310, sy / 2 - 260, 620, 520, "", false )
guiWindowSetSizable ( aAdminForm, false )
guiSetText ( aAdminForm, "Admin Panel - v".._version )
guiCreateLabel ( 0.75, 0.05, 0.45, 0.04, "Admin Panel by lil_Toady", true, aAdminForm )
Expand Down
2 changes: 1 addition & 1 deletion [admin]/admin/client/gui/admin_skin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function aListSkins ( mode )
local skins = {}
for name, group in pairs ( aSkins ) do
if (name ~= "Special" or name == "Special" and getVersion().number >= 272) then
for id, skin in pairs ( group ) do
for i, skin in pairs ( group ) do
local id = tonumber ( skin["model"] )
skins[id] = skin["name"]
end
Expand Down
1 change: 0 additions & 1 deletion [admin]/admin/client/gui/admin_spectator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ function aSpectator.Render ()
oz = z + math.tan ( math.rad ( aSpectator.AngleZ ) ) * offset
setCameraMatrix ( ox, oy, oz, x, y, z )

local sx, sy = guiGetScreenSize ()
dxDrawText ( "Spectating: "..getPlayerName ( aSpectator.Spectating ), sx - 170, 200, sx - 170, 200, tocolor ( 255, 255, 255, 255 ), 1 )
if ( _DEBUG ) then
dxDrawText ( "DEBUG:\nAngleX: "..aSpectator.AngleX.."\nAngleZ: "..aSpectator.AngleZ.."\n\nOffset: "..aSpectator.Offset.."\nX: "..ox.."\nY: "..oy.."\nZ: "..oz.."\nDist: "..getDistanceBetweenPoints3D ( x, y, z, ox, oy, oz ), sx - 170, sy - 180, sx - 170, sy - 180, tocolor ( 255, 255, 255, 255 ), 1 )
Expand Down
4 changes: 2 additions & 2 deletions [admin]/admin/server/admin_ip2c.lua
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ function checkForIp2cFileUpdate( cor )
end

-- Fetch remote ip2c file
local fetchedCsv,errno = fetchRemoteContent( cor, IP2C_UPDATE_URL );
if errno ~= 0 then return end
local fetchedCsv,errno2 = fetchRemoteContent( cor, IP2C_UPDATE_URL );
if errno2 ~= 0 then return end

-- Check download was correct
local newMd5 = md5( fetchedCsv );
Expand Down
38 changes: 19 additions & 19 deletions [admin]/admin/server/admin_server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,35 @@ addEventHandler ( "onResourceStart", _root, function ( resource )
end
xmlUnloadFile ( node )
end
local node = xmlLoadFile ( "conf\\stats.xml" )
if ( node ) then
local node2 = xmlLoadFile ( "conf\\stats.xml" )
if ( node2 ) then
local stats = 0
while ( xmlFindChild ( node, "stat", stats ) ) do
local stat = xmlFindChild ( node, "stat", stats )
while ( xmlFindChild ( node2, "stat", stats ) ) do
local stat = xmlFindChild ( node2, "stat", stats )
local id = tonumber ( xmlNodeGetAttribute ( stat, "id" ) )
local name = xmlNodeGetAttribute ( stat, "name" )
aStats[id] = name
stats = stats + 1
end
xmlUnloadFile ( node )
xmlUnloadFile ( node2 )
end
local node = xmlLoadFile ( "conf\\weathers.xml" )
if ( node ) then
local node3 = xmlLoadFile ( "conf\\weathers.xml" )
if ( node3 ) then
local weathers = 0
while ( xmlFindChild ( node, "weather", weathers ) ~= false ) do
local weather = xmlFindChild ( node, "weather", weathers )
while ( xmlFindChild ( node3, "weather", weathers ) ~= false ) do
local weather = xmlFindChild ( node3, "weather", weathers )
local id = tonumber ( xmlNodeGetAttribute ( weather, "id" ) )
local name = xmlNodeGetAttribute ( weather, "name" )
aWeathers[id] = name
weathers = weathers + 1
end
xmlUnloadFile ( node )
xmlUnloadFile ( node3 )
end
local node = xmlLoadFile ( "conf\\reports.xml" )
if ( node ) then
local node4 = xmlLoadFile ( "conf\\reports.xml" )
if ( node4 ) then
local messages = 0
while ( xmlFindChild ( node, "message", messages ) ) do
subnode = xmlFindChild ( node, "message", messages )
while ( xmlFindChild ( node4, "message", messages ) ) do
subnode = xmlFindChild ( node4, "message", messages )
local author = xmlFindChild ( subnode, "author", 0 )
local subject = xmlFindChild ( subnode, "subject", 0 )
local category = xmlFindChild ( subnode, "category", 0 )
Expand Down Expand Up @@ -159,13 +159,13 @@ addEventHandler ( "onResourceStart", _root, function ( resource )
while #aReports > g_Prefs.maxmsgs do
table.remove( aReports, 1 )
end
xmlUnloadFile ( node )
xmlUnloadFile ( node4 )
end

local node = xmlLoadFile ( "conf\\messages.xml" )
if ( node ) then
local node5 = xmlLoadFile ( "conf\\messages.xml" )
if ( node5 ) then
for id, type in ipairs ( _types ) do
local subnode = xmlFindChild ( node, type, 0 )
local subnode = xmlFindChild ( node5, type, 0 )
if ( subnode ) then
aLogMessages[type] = {}
local groups = 0
Expand All @@ -187,7 +187,7 @@ addEventHandler ( "onResourceStart", _root, function ( resource )
end
end
end
xmlUnloadFile ( node )
xmlUnloadFile ( node5 )
end
end )

Expand Down
4 changes: 2 additions & 2 deletions [admin]/admin2/client/main/admin_acl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function aAclTab.RefreshAccess()
local temp = {}
local strip = aAclTab.GetViewedRight()
local names = guiGridListAddColumn(list, strip, 0.35)
local strip = strip .. "."
local strip2 = strip .. "."
local search = string.lower(guiGetText(aAclTab.AccessSearch))
if (search == "") then
search = false
Expand All @@ -127,7 +127,7 @@ function aAclTab.RefreshAccess()
local rights = aAclTab.Cache.ACL[acl]
local column = guiGridListAddColumn(list, acl, 0.10)
for right, access in pairs(rights) do
local name, found = string.gsub(right, strip, "")
local name, found = string.gsub(right, strip2, "")
if ((found ~= 0) and ((not search) or (string.find(string.lower(name), search)))) then
local row = temp[name]
if (not row) then
Expand Down
1 change: 0 additions & 1 deletion [admin]/admin2/client/widgets/admin_spectator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ function aSpectator.Render()
oz = z + math.tan(math.rad(aSpectator.AngleZ)) * offset
setCameraMatrix(ox, oy, oz, x, y, z)

local sx, sy = guiGetScreenSize()
dxDrawText(
"Spectating: " .. getPlayerName(aSpectator.Spectating),
sx - 170,
Expand Down
16 changes: 8 additions & 8 deletions [admin]/admin2/server/admin_functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ aFunctions = {
setTimer(textDestroyTextItem, 5000, 1, textItem)
setTimer(textDestroyDisplay, 5000, 1, textDisplay)
end,
["sethealth"] = function(player, health)
local health = tonumber(health)
["sethealth"] = function(player, health1)
local health = tonumber(health1)
if (health) then
if (health > 200 or health <= 0) then
health = 100
Expand All @@ -89,8 +89,8 @@ aFunctions = {
action = false
end
end,
["setarmour"] = function(player, armour)
local armour = tonumber(armour)
["setarmour"] = function(player, armour1)
local armour = tonumber(armour1)
if (armour) then
if (armour > 200 or armour <= 0) then
armour = 100
Expand All @@ -100,8 +100,8 @@ aFunctions = {
return false
end
end,
["setskin"] = function(player, skin)
local skin = tonumber(skin)
["setskin"] = function(player, skin1)
local skin = tonumber(skin1)
if (not skin) then
return false
end
Expand Down Expand Up @@ -153,8 +153,8 @@ aFunctions = {
end
return false
end,
["setdimension"] = function(player, dimension)
local dimension = tonumber(dimension)
["setdimension"] = function(player, dimension1)
local dimension = tonumber(dimension1)
if (dimension) then
if (dimension > 65535) or (dimension < 0) then
dimension = 0
Expand Down
4 changes: 2 additions & 2 deletions [admin]/admin2/server/admin_proxy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function setWorldSpecialPropertyEnabled(property, enabled)
end

local blurLevel = 36
function setBlurLevel(level)
local level = tonumber(level)
function setBlurLevel(blevel)
local level = tonumber(blevel)
if (level and level >= 0 and level <= 255) then
blurLevel = level
triggerClientEvent(client, EVENT_PROXY, client, PROXY_BLUR, blurLevel)
Expand Down
38 changes: 19 additions & 19 deletions [admin]/admin2/server/admin_storage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,35 @@ function aSetupStorage()
end
xmlUnloadFile(node)
end
local node = xmlLoadFile("conf\\stats.xml")
if (node) then
local node2 = xmlLoadFile("conf\\stats.xml")
if (node2) then
local stats = 0
while (xmlFindChild(node, "stat", stats)) do
local stat = xmlFindChild(node, "stat", stats)
while (xmlFindChild(node2, "stat", stats)) do
local stat = xmlFindChild(node2, "stat", stats)
local id = tonumber(xmlNodeGetAttribute(stat, "id"))
local name = xmlNodeGetAttribute(stat, "name")
aStats[id] = name
stats = stats + 1
end
xmlUnloadFile(node)
xmlUnloadFile(node2)
end
local node = xmlLoadFile("conf\\weathers.xml")
if (node) then
local node3 = xmlLoadFile("conf\\weathers.xml")
if (node3) then
local weathers = 0
while (xmlFindChild(node, "weather", weathers) ~= false) do
local weather = xmlFindChild(node, "weather", weathers)
while (xmlFindChild(node3, "weather", weathers) ~= false) do
local weather = xmlFindChild(node3, "weather", weathers)
local id = tonumber(xmlNodeGetAttribute(weather, "id"))
local name = xmlNodeGetAttribute(weather, "name")
aWeathers[id] = name
weathers = weathers + 1
end
xmlUnloadFile(node)
xmlUnloadFile(node3)
end
local node = xmlLoadFile("conf\\reports.xml")
if (node) then
local node4 = xmlLoadFile("conf\\reports.xml")
if (node4) then
local messages = 0
while (xmlFindChild(node, "message", messages)) do
subnode = xmlFindChild(node, "message", messages)
while (xmlFindChild(node4, "message", messages)) do
subnode = xmlFindChild(node4, "message", messages)
local author = xmlFindChild(subnode, "author", 0)
local subject = xmlFindChild(subnode, "subject", 0)
local category = xmlFindChild(subnode, "category", 0)
Expand Down Expand Up @@ -95,12 +95,12 @@ function aSetupStorage()
aReports[id].read = read
messages = messages + 1
end
xmlUnloadFile(node)
xmlUnloadFile(node4)
end
local node = xmlLoadFile("conf\\messages.xml")
if (node) then
local node5 = xmlLoadFile("conf\\messages.xml")
if (node5) then
for id, type in ipairs(_types) do
local subnode = xmlFindChild(node, type, 0)
local subnode = xmlFindChild(node5, type, 0)
if (subnode) then
aLogMessages[type] = {}
local groups = 0
Expand Down Expand Up @@ -130,7 +130,7 @@ function aSetupStorage()
end
end
end
xmlUnloadFile(node)
xmlUnloadFile(node5)
end
end

Expand Down
4 changes: 2 additions & 2 deletions [admin]/admin2/shared/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ function RGBToHex(red, green, blue, alpha)
end
end

function isAnonAdmin(player)
local player = (player or localPlayer)
function isAnonAdmin(aplayer)
local player = (aplayer or localPlayer)

if (not isElement(player)) then
return false
Expand Down