Skip to content

Commit 3ed3219

Browse files
authored
Merge pull request #372 from multitheftauto/admin-previously-defined-fixes
Fix "previously defined" warnings in [admin]
2 parents 555a8ba + 4ffc5d0 commit 3ed3219

File tree

15 files changed

+73
-75
lines changed

15 files changed

+73
-75
lines changed

[admin]/acpanel/c_gui_ac.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ function aAntiCheatTab.Create ( tab )
6161
ypos = ypos + 5
6262

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

6868
ypos = ypos + 25
6969

@@ -123,9 +123,9 @@ function aAntiCheatTab.Create ( tab )
123123
ypos = ypos + 5
124124

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

130130
ypos = ypos + 25
131131

[admin]/acpanel/c_gui_block_mods.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function aBlockModsTab.Create ( tab )
3535
---------------------------------------------------------
3636
-- Definition list
3737
---------------------------------------------------------
38-
local label1 = guiCreateLabel ( xpos, ypos, 200, 16, "File name matches (one per line)", false, tab )
38+
local label2 = guiCreateLabel ( xpos, ypos, 200, 16, "File name matches (one per line)", false, tab )
3939
ypos = ypos + 20
4040
aBlockModsTab.memoDefinition = guiCreateMemo ( xpos, ypos, 250, 300, "", false, tab )
4141
ypos = ypos + 300

[admin]/acpanel/c_gui_config.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function aServerConfigTab.Create ( tab )
3434
---------------------------------------------------------
3535
-- Definition list
3636
---------------------------------------------------------
37-
local label1 = guiCreateLabel ( xpos, ypos, 200, 16, "Min client version:", false, tab )
37+
local label2 = guiCreateLabel ( xpos, ypos, 200, 16, "Min client version:", false, tab )
3838
ypos = ypos + 20
3939
--aServerConfigTab.memoDefinition = guiCreateMemo ( xpos, ypos, 250, 40, "", false, tab )
4040
aServerConfigTab.memoDefinition = guiCreateEdit ( xpos, ypos, 250, 30, "", false, tab )
@@ -102,20 +102,20 @@ function aServerConfigTab.Refresh()
102102

103103
local info = aServerConfigTab.getInfoForType("release")
104104
info.text = getPanelSetting( "lastFetchedReleaseVersion" )
105-
local info = aServerConfigTab.getInfoForType("latest")
106-
info.text = getPanelSetting( "lastFetchedLatestVersion" )
105+
local info2 = aServerConfigTab.getInfoForType("latest")
106+
info2.text = getPanelSetting( "lastFetchedLatestVersion" )
107107

108-
local info = aServerConfigTab.getInfoForType(type)
109-
guiRadioButtonSetSelected( info.button, true )
110-
if info.custom then
108+
local info3 = aServerConfigTab.getInfoForType(type)
109+
guiRadioButtonSetSelected( info3.button, true )
110+
if info3.custom then
111111
local customText = getPanelSetting( "minclientconfig.customText" )
112112
guiSetText( aServerConfigTab.memoDefinition, customText )
113113
guiEditSetReadOnly( aServerConfigTab.memoDefinition, false )
114114
guiSetAlpha ( aServerConfigTab.memoDefinition, 1 )
115115
bSaveMemoEdits = true
116116
else
117117
bSaveMemoEdits = false
118-
guiSetText( aServerConfigTab.memoDefinition, info.text )
118+
guiSetText( aServerConfigTab.memoDefinition, info3.text )
119119
guiEditSetReadOnly( aServerConfigTab.memoDefinition, true )
120120
guiSetAlpha ( aServerConfigTab.memoDefinition, 0.75 )
121121
end

[admin]/acpanel/s_img_mod.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ function isImgModBlocked( name )
5050
--outputDebug( tostring(defText) )
5151

5252
local lineList = split(defText,"\n")
53-
for _,line in ipairs(lineList) do
54-
local line = string.gsub(line, "\r", "")
53+
for _, line1 in ipairs(lineList) do
54+
local line = string.gsub(line1, "\r", "")
5555
--outputDebug( "Checking " .. name .. " against line " .. tostring(line) )
5656
if line == "*" or string.find(name,line) then
5757
return true

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ end
2929

3030
function aAdminMenu ()
3131
if ( aAdminForm == nil ) then
32-
local x, y = guiGetScreenSize()
33-
aAdminForm = guiCreateWindow ( x / 2 - 310, y / 2 - 260, 620, 520, "", false )
32+
local sx, sy = guiGetScreenSize()
33+
aAdminForm = guiCreateWindow ( sx / 2 - 310, sy / 2 - 260, 620, 520, "", false )
3434
guiWindowSetSizable ( aAdminForm, false )
3535
guiSetText ( aAdminForm, "Admin Panel - v".._version )
3636
guiCreateLabel ( 0.75, 0.05, 0.45, 0.04, "Admin Panel by lil_Toady", true, aAdminForm )

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function aListSkins ( mode )
131131
local skins = {}
132132
for name, group in pairs ( aSkins ) do
133133
if (name ~= "Special" or name == "Special" and getVersion().number >= 272) then
134-
for id, skin in pairs ( group ) do
134+
for i, skin in pairs ( group ) do
135135
local id = tonumber ( skin["model"] )
136136
skins[id] = skin["name"]
137137
end

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ function aSpectator.Render ()
266266
oz = z + math.tan ( math.rad ( aSpectator.AngleZ ) ) * offset
267267
setCameraMatrix ( ox, oy, oz, x, y, z )
268268

269-
local sx, sy = guiGetScreenSize ()
270269
dxDrawText ( "Spectating: "..getPlayerName ( aSpectator.Spectating ), sx - 170, 200, sx - 170, 200, tocolor ( 255, 255, 255, 255 ), 1 )
271270
if ( _DEBUG ) then
272271
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 )

[admin]/admin/server/admin_ip2c.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ function checkForIp2cFileUpdate( cor )
205205
end
206206

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

211211
-- Check download was correct
212212
local newMd5 = md5( fetchedCsv );

[admin]/admin/server/admin_server.lua

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,35 +72,35 @@ addEventHandler ( "onResourceStart", _root, function ( resource )
7272
end
7373
xmlUnloadFile ( node )
7474
end
75-
local node = xmlLoadFile ( "conf\\stats.xml" )
76-
if ( node ) then
75+
local node2 = xmlLoadFile ( "conf\\stats.xml" )
76+
if ( node2 ) then
7777
local stats = 0
78-
while ( xmlFindChild ( node, "stat", stats ) ) do
79-
local stat = xmlFindChild ( node, "stat", stats )
78+
while ( xmlFindChild ( node2, "stat", stats ) ) do
79+
local stat = xmlFindChild ( node2, "stat", stats )
8080
local id = tonumber ( xmlNodeGetAttribute ( stat, "id" ) )
8181
local name = xmlNodeGetAttribute ( stat, "name" )
8282
aStats[id] = name
8383
stats = stats + 1
8484
end
85-
xmlUnloadFile ( node )
85+
xmlUnloadFile ( node2 )
8686
end
87-
local node = xmlLoadFile ( "conf\\weathers.xml" )
88-
if ( node ) then
87+
local node3 = xmlLoadFile ( "conf\\weathers.xml" )
88+
if ( node3 ) then
8989
local weathers = 0
90-
while ( xmlFindChild ( node, "weather", weathers ) ~= false ) do
91-
local weather = xmlFindChild ( node, "weather", weathers )
90+
while ( xmlFindChild ( node3, "weather", weathers ) ~= false ) do
91+
local weather = xmlFindChild ( node3, "weather", weathers )
9292
local id = tonumber ( xmlNodeGetAttribute ( weather, "id" ) )
9393
local name = xmlNodeGetAttribute ( weather, "name" )
9494
aWeathers[id] = name
9595
weathers = weathers + 1
9696
end
97-
xmlUnloadFile ( node )
97+
xmlUnloadFile ( node3 )
9898
end
99-
local node = xmlLoadFile ( "conf\\reports.xml" )
100-
if ( node ) then
99+
local node4 = xmlLoadFile ( "conf\\reports.xml" )
100+
if ( node4 ) then
101101
local messages = 0
102-
while ( xmlFindChild ( node, "message", messages ) ) do
103-
subnode = xmlFindChild ( node, "message", messages )
102+
while ( xmlFindChild ( node4, "message", messages ) ) do
103+
subnode = xmlFindChild ( node4, "message", messages )
104104
local author = xmlFindChild ( subnode, "author", 0 )
105105
local subject = xmlFindChild ( subnode, "subject", 0 )
106106
local category = xmlFindChild ( subnode, "category", 0 )
@@ -159,13 +159,13 @@ addEventHandler ( "onResourceStart", _root, function ( resource )
159159
while #aReports > g_Prefs.maxmsgs do
160160
table.remove( aReports, 1 )
161161
end
162-
xmlUnloadFile ( node )
162+
xmlUnloadFile ( node4 )
163163
end
164164

165-
local node = xmlLoadFile ( "conf\\messages.xml" )
166-
if ( node ) then
165+
local node5 = xmlLoadFile ( "conf\\messages.xml" )
166+
if ( node5 ) then
167167
for id, type in ipairs ( _types ) do
168-
local subnode = xmlFindChild ( node, type, 0 )
168+
local subnode = xmlFindChild ( node5, type, 0 )
169169
if ( subnode ) then
170170
aLogMessages[type] = {}
171171
local groups = 0
@@ -187,7 +187,7 @@ addEventHandler ( "onResourceStart", _root, function ( resource )
187187
end
188188
end
189189
end
190-
xmlUnloadFile ( node )
190+
xmlUnloadFile ( node5 )
191191
end
192192
end )
193193

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function aAclTab.RefreshAccess()
115115
local temp = {}
116116
local strip = aAclTab.GetViewedRight()
117117
local names = guiGridListAddColumn(list, strip, 0.35)
118-
local strip = strip .. "."
118+
local strip2 = strip .. "."
119119
local search = string.lower(guiGetText(aAclTab.AccessSearch))
120120
if (search == "") then
121121
search = false
@@ -127,7 +127,7 @@ function aAclTab.RefreshAccess()
127127
local rights = aAclTab.Cache.ACL[acl]
128128
local column = guiGridListAddColumn(list, acl, 0.10)
129129
for right, access in pairs(rights) do
130-
local name, found = string.gsub(right, strip, "")
130+
local name, found = string.gsub(right, strip2, "")
131131
if ((found ~= 0) and ((not search) or (string.find(string.lower(name), search)))) then
132132
local row = temp[name]
133133
if (not row) then

0 commit comments

Comments
 (0)