diff --git a/[admin]/acpanel/c_gui_ac.lua b/[admin]/acpanel/c_gui_ac.lua index c4bd00a93..1259fb37c 100644 --- a/[admin]/acpanel/c_gui_ac.lua +++ b/[admin]/acpanel/c_gui_ac.lua @@ -61,9 +61,9 @@ function aAntiCheatTab.Create ( tab ) ypos = ypos + 5 local msg = "To turn OFF an AC#, add number to 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 @@ -123,9 +123,9 @@ function aAntiCheatTab.Create ( tab ) ypos = ypos + 5 local msg = "To turn ON a SD#, add number to 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 diff --git a/[admin]/acpanel/c_gui_block_mods.lua b/[admin]/acpanel/c_gui_block_mods.lua index 0341f00cf..06ff1db7a 100644 --- a/[admin]/acpanel/c_gui_block_mods.lua +++ b/[admin]/acpanel/c_gui_block_mods.lua @@ -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 diff --git a/[admin]/acpanel/c_gui_config.lua b/[admin]/acpanel/c_gui_config.lua index 94c52c892..6458d9d3f 100644 --- a/[admin]/acpanel/c_gui_config.lua +++ b/[admin]/acpanel/c_gui_config.lua @@ -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 ) @@ -102,12 +102,12 @@ 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 ) @@ -115,7 +115,7 @@ function aServerConfigTab.Refresh() 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 diff --git a/[admin]/acpanel/s_img_mod.lua b/[admin]/acpanel/s_img_mod.lua index 94b648b23..28d2c9c4b 100644 --- a/[admin]/acpanel/s_img_mod.lua +++ b/[admin]/acpanel/s_img_mod.lua @@ -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 diff --git a/[admin]/admin/client/gui/admin_main.lua b/[admin]/admin/client/gui/admin_main.lua index e971fafe1..99718ec8b 100644 --- a/[admin]/admin/client/gui/admin_main.lua +++ b/[admin]/admin/client/gui/admin_main.lua @@ -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 ) diff --git a/[admin]/admin/client/gui/admin_skin.lua b/[admin]/admin/client/gui/admin_skin.lua index 087f32494..0729cddf5 100644 --- a/[admin]/admin/client/gui/admin_skin.lua +++ b/[admin]/admin/client/gui/admin_skin.lua @@ -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 diff --git a/[admin]/admin/client/gui/admin_spectator.lua b/[admin]/admin/client/gui/admin_spectator.lua index efc1d3929..4ad0f33a2 100644 --- a/[admin]/admin/client/gui/admin_spectator.lua +++ b/[admin]/admin/client/gui/admin_spectator.lua @@ -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 ) diff --git a/[admin]/admin/server/admin_ip2c.lua b/[admin]/admin/server/admin_ip2c.lua index f902e1d53..f09d29d21 100644 --- a/[admin]/admin/server/admin_ip2c.lua +++ b/[admin]/admin/server/admin_ip2c.lua @@ -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 ); diff --git a/[admin]/admin/server/admin_server.lua b/[admin]/admin/server/admin_server.lua index eef86c188..560a2ec14 100644 --- a/[admin]/admin/server/admin_server.lua +++ b/[admin]/admin/server/admin_server.lua @@ -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 ) @@ -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 @@ -187,7 +187,7 @@ addEventHandler ( "onResourceStart", _root, function ( resource ) end end end - xmlUnloadFile ( node ) + xmlUnloadFile ( node5 ) end end ) diff --git a/[admin]/admin2/client/main/admin_acl.lua b/[admin]/admin2/client/main/admin_acl.lua index 8427aa118..79ec03638 100644 --- a/[admin]/admin2/client/main/admin_acl.lua +++ b/[admin]/admin2/client/main/admin_acl.lua @@ -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 @@ -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 diff --git a/[admin]/admin2/client/widgets/admin_spectator.lua b/[admin]/admin2/client/widgets/admin_spectator.lua index 3f85a3e21..a648341f0 100644 --- a/[admin]/admin2/client/widgets/admin_spectator.lua +++ b/[admin]/admin2/client/widgets/admin_spectator.lua @@ -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, diff --git a/[admin]/admin2/server/admin_functions.lua b/[admin]/admin2/server/admin_functions.lua index 5e5e053be..f503c8a40 100644 --- a/[admin]/admin2/server/admin_functions.lua +++ b/[admin]/admin2/server/admin_functions.lua @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/[admin]/admin2/server/admin_proxy.lua b/[admin]/admin2/server/admin_proxy.lua index 937f6a67c..c57a58482 100644 --- a/[admin]/admin2/server/admin_proxy.lua +++ b/[admin]/admin2/server/admin_proxy.lua @@ -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) diff --git a/[admin]/admin2/server/admin_storage.lua b/[admin]/admin2/server/admin_storage.lua index 497b37350..66c049fe8 100644 --- a/[admin]/admin2/server/admin_storage.lua +++ b/[admin]/admin2/server/admin_storage.lua @@ -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) @@ -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 @@ -130,7 +130,7 @@ function aSetupStorage() end end end - xmlUnloadFile(node) + xmlUnloadFile(node5) end end diff --git a/[admin]/admin2/shared/utils.lua b/[admin]/admin2/shared/utils.lua index 04110383b..1a5482471 100644 --- a/[admin]/admin2/shared/utils.lua +++ b/[admin]/admin2/shared/utils.lua @@ -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