Hello fellow MTA'ers,
I am having the following problem. I have had a spawn menu for ages now and this problem has been bothering me for some time. I have a grid list called Spawn. And an XML file where its loaded from. the XML looks like this
< just an example >
<city name="North">
<class name="Admin" r="200" g="200" b="200">
<spawn name="Admin 1" all the info... >
<skin>217</skin>
</spawn>
<spawn name="Admin 2" all the info... >
<skin>217</skin>
</spawn>
<spawn name="Admin 3" all the info... >
<skin>217</skin>
</spawn>
</class>
</city>
Instead of outputting the Grid like this
- Admin 1
- Admin 2
- Admin 3
it outputs it like:
- Admin 1
- Admin 3
- Admin 2
How is this possible? the script wich creates te list is below.
function onClassClick(button)
if source == classGridList and button == "left" then
if guiGridListGetSelectedCount(cityGridList) > 0 and guiGridListGetSelectedCount(classGridList) > 0 then
guiGridListClear(spawnGridList)
local selectedRow, selectedCol = guiGridListGetSelectedItem( cityGridList );
local cityName = guiGridListGetItemText( cityGridList, selectedRow, selectedCol )
local selectedRow, selectedCol = guiGridListGetSelectedItem( classGridList );
local className = guiGridListGetItemText( classGridList, selectedRow, selectedCol )
local classSkins = cities[cityName][className]
for x, y in pairs(classSkins) do
local row = guiGridListAddRow(spawnGridList)
guiGridListSetItemText(spawnGridList, row, 1, x, false, false)
end
guiSetProperty(spawnScreenOKButton, "Disabled", "True")
guiSetProperty(skinPrevButton, "Disabled", "True")
guiSetProperty(skinNextButton, "Disabled", "True")
guiSetText(skinNumberLabel, 1)
unRenderSkin()
end
end
end