local areas = {
{name = "The Hole", camLookA = 8, camLookX = -772, camLookY = -134, camLook = 6, camSetX = -778, camSetY = -778, camSetZ = 13, music = "MS_RussellInTheHole"},
{name = "Main Building", camLookA = 2, camLookX = -628, camLookY = -312, camLookZ = -0, camSetX = -629, camSetY = -318, camSetZ = 10, music = "MS_FinalShowdown03High"},
{name = "Football Field", camLookA = 0, camLookX = -27, camLookY = -73, camLookZ = 2, camSetX = -12, camSetY = -109, camSetZ = 5, "MS_JockBossBattle"},
{name = "Old Observatory", camLookA = 0, camLookX = 34, camLookY = -134, camLookZ = 9, camSetX = 19, camSetY = -122, camSetZ = 10, "MS_EpicConfrontationHigh"},
{name = "THE WHOLE CAMPUS (GATES CLOSED!)", camLookA = 0, camLookX = 215, camLookY = -73, camLookZ = 9, camSetX = 271, camSetY = 73, camSetZ = 7, music = "MS_BikeActionHigh"},
}
local areaSelectionIndex = 1
local shouldStartInit = 1
function MissionSetup()
AreaTransitionXYZ(0, 270, -110, 6)
PlayerSetHealth(PedGetMaxHealth(gPlayer))
PlayerSetControl(0)
TextPrintString("test version", 3, 1)
Wait(3000)
PedSetFlag(gPlayer, 113, true)
PedSetFlag(gPlayer, 87, true)
PedSetFlag(gPlayer, 9, true)
PedSetFlag(gPlayer, 21, true)
shouldStart = true
end
function MissionCleanup()
collectgarbage()
end
function main()
while shouldStart do
if shouldStartInit == 1 then
PedSetEffectedByGravity(gPlayer, false)
AreaTransitionXYZ(areas[areaSelectionIndex].camLookA, areas[areaSelectionIndex].camLookX, areas[areaSelectionIndex].camLookY, areas[areaSelectionIndex].camLookZ)
CameraSetXYZ(areas[areaSelectionIndex].camSetX, areas[areaSelectionIndex].camSetY, areas[areaSelectionIndex].camSetZ)
CameraLookAtXYZ(areas[areaSelectionIndex].camLookX, areas[areaSelectionIndex].camLookY, areas[areaSelectionIndex].camLookZ)
SoundPlayStream(areas[areaSelectionIndex].music..".rsm", 0.5)
shouldStartInit = nil
end
F_SelectFightingArena()
Wait(0)
end
end
function F_SelectFightingArena()
if IsButtonPressed(0, 0) then
Wait(100)
areaSelectionIndex = areaSelectionIndex - 1
if areaSelectionIndex < 1 then
areaSelectionIndex = table.getn(areas)
end
AreaTransitionXYZ(areas[areaSelectionIndex].camLookA, areas[areaSelectionIndex].camLookX, areas[areaSelectionIndex].camLookY, areas[areaSelectionIndex].camLookZ)
CameraSetXYZ(areas[areaSelectionIndex].camSetX, areas[areaSelectionIndex].camSetY, areas[areaSelectionIndex].camSetZ)
CameraLookAtXYZ(areas[areaSelectionIndex].camLookX, areas[areaSelectionIndex].camLookY, areas[areaSelectionIndex].camLookZ)
SoundPlayStream(areas[areaSelectionIndex].music..".rsm", 0.5)
elseif IsButtonPressed(1, 0) then
Wait(100)
areaSelectionIndex = areaSelectionIndex + 1
if areaSelectionIndex > table.getn(areas) then
areaSelectionIndex = 1
end
AreaTransitionXYZ(areas[areaSelectionIndex].camLookA, areas[areaSelectionIndex].camLookX, areas[areaSelectionIndex].camLookY, areas[areaSelectionIndex].camLookZ)
CameraSetXYZ(areas[areaSelectionIndex].camSetX, areas[areaSelectionIndex].camSetY, areas[areaSelectionIndex].camSetZ)
CameraLookAtXYZ(areas[areaSelectionIndex].camLookX, areas[areaSelectionIndex].camLookY, areas[areaSelectionIndex].camLookZ)
SoundPlayStream(areas[areaSelectionIndex].music..".rsm", 0.5)
end
TextPrintString("SELECT ARENA\n<"..areas[areaSelectionIndex]..">", 0, 1)
TextPrintString("~dleft~/~dright~ - Navigate Menu (L/R)\n~SPRINT~ - Select Arena", 0, 2)
end
Everything's working. But when the loop in the main() function starts, it DOES do the stuff i made it do(the test thing) but it wont launch the function I called in it.
If that's hard to understand maybe try the mod. see what i mean.
The table isn't messed up, because in the first part of the loop, that works, and it calls everything on that table. But it seems that the function I called in the loop isn't being executed.