Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Coord = { -- Coordinate = {areaCode, X, Y, Z}, Room = {X1, Y1, X2, Y2}
- Chemistry = {
- Room = {-590.6, 316.3, -599.2, 326.9},
- In = {4, -599.174, 326.887, 34.2},
- Out = {2, -606.42, -293.3, 0},
- InDoor = {4, -599.16, 329, 34.2},
- OutDoor = {2, -604, -290.8, 0}
- }, Biology = {
- Room = {-701.63, 313.85, -710.6, 325},
- In = {6, -710.42, 312.4, 33.38},
- Out = {2, -651.5, -293.5, 5.5},
- InDoor = {6, -712.9, 312.3, 33.38}
- }, English = {
- Area = {-554.7, 310, -572.3, 331.5},
- Room = {-556.315, 315.3, -564, 329},
- In = {15, -564, 316.5, -1.9},
- Out = {2, -651.7, -293.33, 0},
- InDoor = {15, -566, 316.6, -1.8},
- OutDoor = {2, -653.89, -290.6, 0}
- }, Art = {
- Room = {-528.5, 376.5, -536, 395},
- In = {17, -537, 376, 14},
- Out = {2, -670.7, -292.5, 5.5}
- }, Music = {
- Area = {-529.6, 310, -547, 331.5},
- Room = {-532.37, 316.45, -538.9, 329.55},
- In = {15, -539.38, 316.6, -1.945},
- Out = {2, -666.45, -303.1, 5.5},
- InDoor = {15, -541.38, 316.64, -1.942}
- }, Math = {
- In = {15, -564, 316.5, -1.9},
- Out = {2, -599.6, -297.26, 5.5},
- OutDoor = {2, -601.84, -299.83, 5.5}
- }, Geography = {
- Out = {2, -611.3, -322, 0}
- }, PrincipalOffice = {
- In = {5, -701.2, 216.6, 31.55},
- Out = {2, -630, -281, 6}
- }, Junkyard = {
- In = {43, -583, -621, 5},
- Out = {0, 549, -491, 5}
- }, Observatory = {
- In = {40, -696.4, 67.37, 20.25},
- Out = {0, 47.7, -134, 2.99}
- }, HarringtonHouse = {
- InDoor = {32, -572.9, 134, 46.15},
- Room1_1 = {-561.7, 138.5, -570.67, 128.3},
- Room1_2 = {-533, 136.4, -557.3, 128.9},
- Room2_1 = {-521.77, 145.54, -545.7, 141.85},
- Room2_2 = {-521.8, 148.64, -530, 120.5},
- Room2_3 = {-504, 117, -526.1, 112.8},
- Room3_1 = {-504.55, 136.3, -507.88, 112.95},
- Room3_2 = {-512.25, 145.3, -515.76, 121.14},
- Room3_3 = {-518.5, 142.5, -541.88, 125},
- Room3_4 = {-545, 142.7, -547.4, 124.2},
- Door1 = {32, -545, 138.6, 46.15},
- Door2 = {32, -534.8, 125.7, 46.15},
- Door3 = {32, -531.86, 123.65, 50.72}
- }, Autoshop = {
- InDoor = {18, -430.5, 364.9, 80.845},
- Room = {-427.94, 364.8, -416.4, 380}
- }, Warehouse = {
- InDoorF = {54, -677.5, -169, 0.05},
- InDoorB = {54, -572.9, -160.5, 10.516},
- FA1 = {-670, -149, -599.5, -171.8},
- FA2 = {-591.46, -143.24, -587.31, -171.46},
- FA3 = {-583.2, -151.1, -575.4, -172.3}
- }
- }
- function PopulatedClassrooms_mod()
- PopulatedClassrooms_setup()
- CreateThread("PopulatedClassrooms_main")
- end
- function PopulatedClassrooms_setup()
- Students, Books = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
- 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 85, 88, 90, 92, 93, 94, 95, 96, --[[98,]] 99,
- 102, 109, 110, 111, 112, 117, 118, 119, 121, 122,
- 130, 133, 134, 137, 138, 139, 142, 145, 146, 147,
- 155, 159, 160, 161, 162, 163, 164, 165, 166, 167,
- 168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
- 178, 179, 180, 181, 182, 186, 200, 201, 202, 203,
- 204, 205, 206, 207, 208, 209, 210, 211, 212, 213,
- 214, 215, 216, 217, 218, 224, 225, 226, 227, 228,
- 230, 231, 232, 235, 239, 240, 241, 242, 243, 244,
- 245, 246, 247, 255, 256, 257, 258
- }, {405, 413, 414, 415, 416}
- DATLoad("3_B.DAT", 2)
- DATLoad("3_B_BIKE_STUFF.DAT", 2)
- end
- function PopulatedClassrooms_main()
- while true do
- Wait(0)
- Hour, Minute = ClockGet()
- -- Chemistry class
- if AreaGetVisible() == 4 then
- x, y, z = Coord.Chemistry.InDoor[2], Coord.Chemistry.InDoor[3], Coord.Chemistry.InDoor[4]
- x1, y1, x2, y2 = Coord.Chemistry.Room[1], Coord.Chemistry.Room[2], Coord.Chemistry.Room[3], Coord.Chemistry.Room[4]
- if MorningTime() or LunchTime() then
- ChanceSpawnPedAndChanceToBringABookAndMoveHim(350, 40, math.random(x2, x1), math.random(y1, y2), Coord.Chemistry.InDoor[4])
- elseif ClassTime() then
- ChanceSpawnPedAndChanceToBringABookAndMoveHim(250, 60, math.random(x2, x1), math.random(y1, y2), Coord.Chemistry.InDoor[4])
- elseif NightTime() then
- CheckPedAtNight()
- end
- -- Biology class
- elseif AreaGetVisible() == 6 then
- x, y, z = Coord.Biology.In[2], Coord.Biology.In[3], Coord.Biology.In[4]
- x1, y1, x2, y2 = Coord.Biology.Room[1], Coord.Biology.Room[2], Coord.Biology.Room[3], Coord.Biology.Room[4]
- if MorningTime() or LunchTime() then
- ChanceSpawnPedAndChanceToBringABookAndMoveHim(350, 40, math.random(x2, x1), math.random(y1, y2), Coord.Biology.In[4])
- elseif ClassTime() then
- ChanceSpawnPedAndChanceToBringABookAndMoveHim(250, 60, math.random(x2, x1), math.random(y1, y2), Coord.Biology.In[4])
- elseif NightTime() then
- CheckPedAtNight()
- end
- elseif AreaGetVisible() == 15 then
- -- English, Math, and Geography class
- if PedInRectangle(gPlayer, Coord.English.Area[1], Coord.English.Area[2], Coord.English.Area[3], Coord.English.Area[4]) then
- x, y, z = Coord.English.InDoor[2], Coord.English.InDoor[3], Coord.English.InDoor[4]
- x1, y1, x2, y2 = Coord.English.Room[1], Coord.English.Room[2], Coord.English.Room[3], Coord.English.Room[4]
- if MorningTime() or LunchTime() then
- ChanceSpawnPedAndChanceToBringABookAndMoveHim(350, 40, math.random(x2, x1), math.random(y1, y2), Coord.English.In[4])
- elseif ClassTime() then
- ChanceSpawnPedAndChanceToBringABookAndMoveHim(250, 60, math.random(x2, x1), math.random(y1, y2), Coord.English.In[4])
- elseif NightTime() then
- CheckPedAtNight()
- end
- -- Music class
- elseif PedInRectangle(gPlayer, Coord.Music.Area[1], Coord.Music.Area[2], Coord.Music.Area[3], Coord.Music.Area[4]) then
- x, y, z = Coord.Music.InDoor[2], Coord.Music.InDoor[3], Coord.Music.InDoor[4]
- x1, y1, x2, y2 = Coord.Music.Room[1], Coord.Music.Room[2], Coord.Music.Room[3], Coord.Music.Room[4]
- if MorningTime() or LunchTime() then
- ChanceSpawnPedAndChanceToBringABookAndMoveHim(350, 40, math.random(x2, x1), math.random(y1, y2), Coord.Music.InDoor[4])
- elseif ClassTime() then
- ChanceSpawnPedAndChanceToBringABookAndMoveHim(250, 60, math.random(x2, x1), math.random(y1, y2), Coord.Music.InDoor[4])
- elseif NightTime() then
- CheckPedAtNight()
- end
- end
- -- Art class
- elseif AreaGetVisible() == 17 then
- x, y, z = Coord.Art.In[2], Coord.Art.In[3], Coord.Art.In[4]
- x1, y1, x2, y2 = Coord.Art.Room[1], Coord.Art.Room[2], Coord.Art.Room[3], Coord.Art.Room[4]
- if MorningTime() or LunchTime() then
- ChanceSpawnPedAndChanceToBringABookAndMoveHim(250, 40, math.random(x2, x1), math.random(y1, y2), Coord.Art.In[4])
- elseif ClassTime() then
- ChanceSpawnPedAndChanceToBringABookAndMoveHim(150, 60, math.random(x2, x1), math.random(y1, y2), Coord.Art.In[4])
- elseif NightTime() then
- CheckPedAtNight()
- end
- -- Autoshop
- elseif AreaGetVisible() == 18 then
- greasers, summonGreaser = {
- 27, 173, 203,
- 24,
- 28,
- 21, 202,
- 22, 200,
- 29, 201,
- 23, 217,
- 25, 96
- }, function(xm, ym, zm)
- greaser = PedCreateXYZ(greasers[math.random(table.getn(greasers))], x, y, z)
- PedMakeAmbient(greaser)
- PedMoveToXYZ(greaser, 0, xm, ym, zm)
- end
- x, y, z = Coord.Autoshop.InDoor[2], Coord.Autoshop.InDoor[3], Coord.Autoshop.InDoor[4]
- x1, y1, x2, y2 = Coord.Autoshop.Room[1], Coord.Autoshop.Room[2], Coord.Autoshop.Room[3], Coord.Autoshop.Room[4]
- if MorningTime() or LunchTime() then
- if math.random(400) <= 2 then
- summonGreaser(math.random(x1, x2), math.random(y1, y2), Coord.Autoshop.InDoor[4])
- end
- elseif ClassTime() then
- if math.random(300) >= 297 then
- summonGreaser(math.random(x1, x2), math.random(y1, y2), Coord.Autoshop.InDoor[4])
- end
- elseif NightTime() then
- CheckPedAtNight()
- end
- -- Harrington House
- elseif AreaGetVisible() == 32 then
- if not MissionActiveSpecific("2_08") and not MissionActiveSpecific("6_03") then
- preps, summonPrep = {
- 30, 214,
- 31, 177, 213,
- 34, 118, 179, 212, 244, 245,
- 40, 119, 163, 211, 246, 247,
- 35, 36, 178, 239, 240,
- 32, 117, 241, 242,
- 33, 133, 172, 243,
- 37, 218,
- 38, 94, 167, 175, 182
- }, function(xm, ym, zm)
- prep = PedCreateXYZ(preps[math.random(table.getn(preps))], x, y, z)
- PedMakeAmbient(prep)
- PedMoveToXYZ(prep, 0, xm, ym, zm)
- end
- if Hour >= 7 and Hour < 19 then
- local ChooseHHSpawn, ChooseHHRoom, ChooseHHFloor = math.random(4), math.random(9), math.random(3)
- if ChooseHHSpawn == 1 then
- x, y, z = Coord.HarringtonHouse.InDoor[2], Coord.HarringtonHouse.InDoor[3], Coord.HarringtonHouse.InDoor[4]
- elseif ChooseHHSpawn == 2 then
- x, y, z = Coord.HarringtonHouse.Door1[2], Coord.HarringtonHouse.Door1[3], Coord.HarringtonHouse.Door1[4]
- elseif ChooseHHSpawn == 3 then
- x, y, z = Coord.HarringtonHouse.Door2[2], Coord.HarringtonHouse.Door2[3], Coord.HarringtonHouse.Door2[4]
- elseif ChooseHHSpawn == 4 then
- x, y, z = Coord.HarringtonHouse.Door3[2], Coord.HarringtonHouse.Door3[3], Coord.HarringtonHouse.Door3[4]
- end
- if ChooseHHFloor == 1 and ChooseHHRoom == 1 then
- Z = 46.15
- x1, y1, x2, y2 = Coord.HarringtonHouse.Room1_1[1], Coord.HarringtonHouse.Room1_1[2], Coord.HarringtonHouse.Room1_1[3], Coord.HarringtonHouse.Room1_1[4]
- elseif ChooseHHFloor == 1 and ChooseHHRoom == 2 then
- Z = 46.15
- x1, y1, x2, y2 = Coord.HarringtonHouse.Room1_2[1], Coord.HarringtonHouse.Room1_2[2], Coord.HarringtonHouse.Room1_2[3], Coord.HarringtonHouse.Room1_2[4]
- elseif ChooseHHFloor == 2 and ChooseHHRoom == 1 then
- Z = 50.72
- x1, y1, x2, y2 = Coord.HarringtonHouse.Room2_1[1], Coord.HarringtonHouse.Room2_1[2], Coord.HarringtonHouse.Room2_1[3], Coord.HarringtonHouse.Room2_1[4]
- elseif ChooseHHFloor == 2 and ChooseHHRoom == 2 then
- Z = 50.72
- x1, y1, x2, y2 = Coord.HarringtonHouse.Room2_2[1], Coord.HarringtonHouse.Room2_2[2], Coord.HarringtonHouse.Room2_2[3], Coord.HarringtonHouse.Room2_2[4]
- elseif ChooseHHFloor == 2 and ChooseHHRoom == 3 then
- Z = 50.72
- x1, y1, x2, y2 = Coord.HarringtonHouse.Room2_3[1], Coord.HarringtonHouse.Room2_3[2], Coord.HarringtonHouse.Room2_3[3], Coord.HarringtonHouse.Room2_3[4]
- elseif ChooseHHFloor == 3 and ChooseHHRoom == 1 then
- Z = 55.65
- x1, y1, x2, y2 = Coord.HarringtonHouse.Room3_1[1], Coord.HarringtonHouse.Room3_1[2], Coord.HarringtonHouse.Room3_1[3], Coord.HarringtonHouse.Room3_1[4]
- elseif ChooseHHFloor == 3 and ChooseHHRoom == 2 then
- Z = 55.65
- x1, y1, x2, y2 = Coord.HarringtonHouse.Room3_2[1], Coord.HarringtonHouse.Room3_2[2], Coord.HarringtonHouse.Room3_2[3], Coord.HarringtonHouse.Room3_2[4]
- elseif ChooseHHFloor == 3 and ChooseHHRoom == 3 then
- Z = 55.65
- x1, y1, x2, y2 = Coord.HarringtonHouse.Room3_3[1], Coord.HarringtonHouse.Room3_3[2], Coord.HarringtonHouse.Room3_3[3], Coord.HarringtonHouse.Room3_3[4]
- elseif ChooseHHFloor == 3 and ChooseHHRoom == 4 then
- Z = 57.12
- x1, y1, x2, y2 = Coord.HarringtonHouse.Room3_4[1], Coord.HarringtonHouse.Room3_4[2], Coord.HarringtonHouse.Room3_4[3], Coord.HarringtonHouse.Room3_4[4]
- end
- if math.random(300) >= 297 then
- summonPrep(math.random(x2, x1), math.random(y2, y1), Z)
- end
- end
- end
- -- Junkyard
- elseif AreaGetVisible() == 43 then
- if not MissionActiveSpecific("3_B") then
- if not bike or not VehicleIsValid(bike) then
- local bikeModel = {277, 278, 279, 280, 281, 282, 283}
- bike = VehicleCreatePoint(bikeModel[math.random(table.getn(bikeModel))], POINTLIST._PLAYERBIKEFIRSTSTART)
- VehicleMakeAmbient(bike)
- end
- end
- -- Warehouse
- elseif AreaGetVisible() == 54 then
- if not MissionActiveSpecific("5_02") and not MissionActiveSpecific("5_G5") then
- townies, summonTownie = {
- 41, 42, 43, 44, 45, 46, 47, 91, 125, 150, 153, 154, 196, 197, 198, 199
- }, function(xm, ym, zm)
- townie = PedCreateXYZ(townies[math.random(table.getn(townies))], x, y, z)
- PedMakeAmbient(townie)
- PedMoveToXYZ(townie, 0, xm, ym, zm)
- end
- local ChooseWHspawn, ChooseWHarea = math.random(2) math.random(3)
- if ChooseWHspawn == 1 then
- x, y, z = Coord.Warehouse.InDoorF[2], Coord.Warehouse.InDoorF[3], Coord.Warehouse.InDoorF[4]
- elseif ChooseWHspawn == 2 then
- x, y, z = Coord.Warehouse.InDoorB[2], Coord.Warehouse.InDoorB[3], Coord.Warehouse.InDoorB[4]
- end
- if ChooseWHarea == 1 then
- Z = 0.05
- x1, y1, x2, y2 = Coord.Warehouse.FA1[1], Coord.Warehouse.FA1[2], Coord.Warehouse.FA1[3], Coord.Warehouse.FA1[4]
- elseif ChooseWHarea == 2 then
- Z = 6.74
- x1, y1, x2, y2 = Coord.Warehouse.FA2[1], Coord.Warehouse.FA2[2], Coord.Warehouse.FA2[3], Coord.Warehouse.FA2[4]
- elseif ChooseWHarea == 3 then
- Z = 10.5
- x1, y1, x2, y2 = Coord.Warehouse.FA3[1], Coord.Warehouse.FA3[2], Coord.Warehouse.FA3[3], Coord.Warehouse.FA3[4]
- end
- if math.random(300) >= 298 then
- summonTownie(math.random(x1, x2), math.random(y2, y1), Z)
- end
- end
- else
- x, y, z = 0, 0, 0
- x1, y1, x2, y2 = 0, 0, 0, 0
- Z = 0
- if VehicleIsValid(bike) then
- VehicleDelete(bike)
- end
- end
- end
- end
- function AreaAndInterior_mod()
- CreatePersistentEntity("DPE_Dumpster", -736, -630.1, 3.55, 90, 43)
- CreateThread("AreaAndInterior_main")
- end
- function CreateBlips()
- -- Chemistry
- BlipAddXYZ(Coord.Chemistry.Out[2], Coord.Chemistry.Out[3], Coord.Chemistry.Out[4], 1, 0, 8)
- BlipAddXYZ(Coord.Chemistry.In[2], Coord.Chemistry.In[3], Coord.Chemistry.In[4], 1, 0, 8)
- -- Principal Office
- BlipAddXYZ(Coord.PrincipalOffice.Out[2], Coord.PrincipalOffice.Out[3], Coord.PrincipalOffice.Out[4], 1, 0, 8)
- BlipAddXYZ(Coord.PrincipalOffice.In[2], Coord.PrincipalOffice.In[3], Coord.PrincipalOffice.In[4], 1, 0, 12)
- -- Junkyard
- BlipAddXYZ(Coord.Junkyard.Out[2], Coord.Junkyard.Out[3], Coord.Junkyard.Out[4], 1, 0, 8)
- BlipAddXYZ(Coord.Junkyard.In[2], Coord.Junkyard.In[3], Coord.Junkyard.In[4], 1, 0, 12)
- -- Art
- BlipAddXYZ(Coord.Art.In[2], Coord.Art.In[3], Coord.Art.In[4], 1, 0, 12)
- -- Math
- BlipAddXYZ(Coord.Math.Out[2], Coord.Math.Out[3], Coord.Math.Out[4], 1, 0, 8)
- -- Biology
- BlipAddXYZ(Coord.Biology.Out[2], Coord.Biology.Out[3], Coord.Biology.Out[4], 1, 0, 8)
- BlipAddXYZ(Coord.Biology.In[2], Coord.Biology.In[3], Coord.Biology.In[4], 1, 0, 12)
- -- English
- BlipAddXYZ(Coord.English.Out[2], Coord.English.Out[3], Coord.English.Out[4], 1, 0, 8)
- -- Music
- BlipAddXYZ(Coord.Music.InDoor[2], Coord.Music.InDoor[3], Coord.Music.InDoor[4], 1, 0, 12)
- BlipAddXYZ(Coord.Music.Out[2], Coord.Music.Out[3], Coord.Music.Out[4], 1, 0, 8)
- -- Geography
- BlipAddXYZ(Coord.Geography.Out[2], Coord.Geography.Out[3], Coord.Geography.Out[4], 1, 0, 8)
- -- Observatory
- BlipAddXYZ(Coord.Observatory.Out[2], Coord.Observatory.Out[3], Coord.Observatory.Out[4], 1, 0, 8)
- BlipAddXYZ(Coord.Observatory.In[2], Coord.Observatory.In[3], Coord.Observatory.In[4], 1, 0, 12)
- end
- function AreaAndInterior_main()
- while true do
- Wait(0)
- CreateBlips()
- AreaSetAllDoorsUnlocked()
- -- Chemistry
- if PedIsInAreaXYZ(gPlayer, Coord.Chemistry.Out[2], Coord.Chemistry.Out[3], Coord.Chemistry.Out[4], 1) then
- TextPrintString("\b Enter", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.Chemistry.In[1], Coord.Chemistry.In[2], Coord.Chemistry.In[3], Coord.Chemistry.In[4])
- end
- -- Chemistry class exit
- elseif PedIsInAreaXYZ(gPlayer, Coord.Chemistry.In[2], Coord.Chemistry.In[3], Coord.Chemistry.In[4], 1) then
- TextPrintString("\b Exit", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.Chemistry.Out[1], Coord.Chemistry.Out[2], Coord.Chemistry.Out[3], Coord.Chemistry.Out[4])
- end
- -- Principal office
- elseif PedIsInAreaXYZ(gPlayer, Coord.PrincipalOffice.Out[2], Coord.PrincipalOffice.Out[3], Coord.PrincipalOffice.Out[4], 1) then
- TextPrintString("\b Enter", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.PrincipalOffice.In[1], Coord.PrincipalOffice.In[2], Coord.PrincipalOffice.In[3], Coord.PrincipalOffice.In[4])
- end
- -- Principal office exit
- elseif PedIsInAreaXYZ(gPlayer, Coord.PrincipalOffice.In[2], Coord.PrincipalOffice.In[3], Coord.PrincipalOffice.In[4], 1) then
- TextPrintString("\b Exit", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(2, -630, -281, 6)
- end
- -- Art class exit
- elseif PedIsInAreaXYZ(gPlayer, Coord.Art.In[2], Coord.Art.In[3], Coord.Art.In[4], 1) then
- TextPrintString("\b Exit", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.Art.Out[1], Coord.Art.Out[2], Coord.Art.Out[3], Coord.Art.Out[4])
- end
- -- Junkyard
- elseif PedIsInAreaXYZ(gPlayer, Coord.Junkyard.Out[2], Coord.Junkyard.Out[3], Coord.Junkyard.Out[4], 1) then
- TextPrintString("\b Enter", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.Junkyard.In[1], Coord.Junkyard.In[2], Coord.Junkyard.In[3], Coord.Junkyard.In[4])
- end
- -- Junkyard exit
- elseif PedIsInAreaXYZ(gPlayer, Coord.Junkyard.In[2], Coord.Junkyard.In[3], Coord.Junkyard.In[4], 1) then
- TextPrintString("\b Exit", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.Junkyard.Out[1], Coord.Junkyard.Out[2], Coord.Junkyard.Out[3], Coord.Junkyard.Out[4])
- end
- -- Music
- elseif PedIsInAreaXYZ(gPlayer, Coord.Music.Out[2], Coord.Music.Out[3], Coord.Music.Out[4], 1) then
- TextPrintString("\b Enter", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.Music.In[1], Coord.Music.In[2], Coord.Music.In[3], Coord.Music.In[4])
- end
- -- Music exit
- elseif PedIsInAreaXYZ(gPlayer, Coord.Music.InDoor[2], Coord.Music.InDoor[3], Coord.Music.InDoor[4], 1) then
- TextPrintString("\b Exit", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.Music.Out[1], Coord.Music.Out[2], Coord.Music.Out[3], Coord.Music.Out[4])
- end
- -- Biology
- elseif PedIsInAreaXYZ(gPlayer, Coord.Biology.Out[2], Coord.Biology.Out[3], Coord.Biology.Out[4], 1) then
- TextPrintString("\b Enter", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.Biology.In[1], Coord.Biology.In[2], Coord.Biology.In[3], Coord.Biology.In[4])
- end
- -- Biology exit
- elseif PedIsInAreaXYZ(gPlayer, Coord.Biology.In[2], Coord.Biology.In[3], Coord.Biology.In[4], 1) then
- TextPrintString("\b Exit", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.Biology.Out[1], Coord.Biology.Out[2], Coord.Biology.Out[3], Coord.Biology.Out[4])
- end
- -- Math
- elseif PedIsInAreaXYZ(gPlayer, Coord.Math.Out[2], Coord.Math.Out[3], Coord.Math.Out[4], 1) then
- TextPrintString("\b Enter", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.Math.In[1], Coord.Math.In[2], Coord.Math.In[3], Coord.Math.In[4])
- end
- -- English
- elseif PedIsInAreaXYZ(gPlayer, Coord.English.Out[2], Coord.English.Out[3], Coord.English.Out[4], 1) then
- TextPrintString("\b Enter", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.English.In[1], Coord.English.In[2], Coord.English.In[3], Coord.English.In[4])
- end
- -- Geography
- elseif PedIsInAreaXYZ(gPlayer, Coord.Geography.Out[2], Coord.Geography.Out[3], Coord.Geography.Out[4], 1) then
- TextPrintString("\b Enter", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.English.In[1], Coord.English.In[2], Coord.English.In[3], Coord.English.In[4])
- end
- -- Observatory
- elseif PedIsInAreaXYZ(gPlayer, Coord.Observatory.Out[2], Coord.Observatory.Out[3], Coord.Observatory.Out[4], 1) then
- TextPrintString("\b Enter", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.Observatory.In[1], Coord.Observatory.In[2], Coord.Observatory.In[3], Coord.Observatory.In[4])
- end
- -- Observatory exit
- elseif PedIsInAreaXYZ(gPlayer, Coord.Observatory.In[2], Coord.Observatory.In[3], Coord.Observatory.In[4], 1) then
- TextPrintString("\b Exit", 0, 2)
- if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- AreaTransitionXYZ(Coord.Observatory.Out[1], Coord.Observatory.Out[2], Coord.Observatory.Out[3], Coord.Observatory.Out[4])
- end
- end
- --[[if IsButtonBeingPressed(9, 0) and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
- if PedIsInAreaXYZ(gPlayer, -599, 326, 35, 1) then
- AreaTransitionXYZ(Coord.Chemistry.Out[1], Coord.Chemistry.Out[2], Coord.Chemistry.Out[3], Coord.Chemistry.Out[4])
- PedFaceXYZ(gPlayer, Coord.Chemistry.OutDoor[2], Coord.Chemistry.OutDoor[3], Coord.Chemistry.OutDoor[4])
- elseif PedIsInAreaXYZ(gPlayer, -630, -281, 6, 1) then
- AreaTransitionXYZ(5, -701, 216, 32)
- PedFaceXYZ(gPlayer, -701, 214, 32)
- elseif PedIsInAreaXYZ(gPlayer, -701, 216, 32, 1) then
- AreaTransitionXYZ(2, -630, -281, 6)
- elseif PedIsInAreaXYZ(gPlayer, -536, 377, 15, 1) then
- AreaTransitionXYZ(2, -670, -294, 6)
- PedFaceXYZ(gPlayer, -670, -296, 6)
- elseif PedIsInAreaXYZ(gPlayer, 549, -491, 5, 1) then
- AreaTransitionXYZ(43, -583, -621, 5)
- elseif PedIsInAreaXYZ(gPlayer, -583, -621, 5, 1) then
- AreaTransitionXYZ(0, 549, -491, 5)
- end
- end]]
- end
- end
- function ChanceSpawnPedAndChanceToBringABookAndMoveHim(chance, chance1, X1, Y1, Z1)
- if math.random(chance) == chance/2 then
- student = PedCreateXYZ(Students[math.random(table.getn(Students))], x, y, z)
- PedMakeAmbient(student)
- if ChanceBringABook(chance1) then
- PedSetWeapon(student, Books[math.random(table.getn(Books))], 1)
- end
- PedMoveToXYZ(student, 0, X1, Y1, Z1)
- end
- end
- function CheckPedAtNight()
- for you, PED in {PedFindInAreaXYZ(0, 0, 0, 99999)} do
- if PedIsValid(PED) and PED ~= gPlayer then
- PedMoveToXYZ(PED, 1, x, y, z)
- if PedIsInAreaXYZ(PED, x, y, z, 1.2) then
- PedDelete(PED)
- end
- end
- end
- end
- function ChanceBringABook(c)
- return math.random(100) <= c
- end
- function MorningTime()
- if Hour >= 7 and Hour < 9 then
- return true
- end
- return false
- end
- function ClassTime()
- if ((Hour >= 9 and Minute >= 0) and (Hour <= 11 and Minute < 30)) or ((Hour >= 13 and Minute >= 0) and (Hour <= 15 and Minute < 30)) then
- return true
- end
- return false
- end
- function LunchTime()
- if (Hour >= 11 and Minute >= 30) and (Hour < 13) then
- return true
- end
- return false
- end
- function FreeTime()
- if (Hour >= 15 and Minute >= 30) and Hour < 19 then
- return true
- end
- return false
- end
- function NightTime()
- if Hour >= 19 or Hour < 7 then
- return true
- end
- return false
- end
- function AreaSetAllDoorsUnlocked()
- AreaSetDoorLocked(TRIGGER._DT_ischool_AuditorDoorL, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_AuditorDoorL, false)
- AreaSetDoorLocked(TRIGGER._DT_iSafeDrop_DoorL, false)
- AreaSetDoorLocked(TRIGGER._5_03_Control_Room_Door, false)
- AreaSetDoorLocked(TRIGGER._DT_TINDUST_CHEMEX_DOOR, false)
- AreaSetDoorLocked(TRIGGER._DT_Observatory, false)
- AreaSetDoorLocked(TRIGGER._DT_ASYLUM_FRONT_DOOR, false)
- AreaSetDoorLocked(TRIGGER._DT_classr_doorL, false)
- AreaSetDoorLocked(TRIGGER._DT_classr_doorL, false)
- AreaSetDoorLocked(TRIGGER._DT_classr2_doorL, false)
- AreaSetDoorLocked(TRIGGER._DT_ChemPlant_DoorL, false)
- AreaSetDoorLocked(TRIGGER._3_S11_Path1_Door1, false)
- AreaSetDoorLocked(TRIGGER._3_S11_Path1_Door3, false)
- AreaSetDoorLocked(TRIGGER._3_S11_Path2_Door1, false)
- AreaSetDoorLocked(TRIGGER._3_S11_Path2_Door2, false)
- AreaSetDoorLocked(TRIGGER._5_03_Rec_Room, false)
- AreaSetDoorLocked(TRIGGER._5_03_Patient_Room1, false)
- AreaSetDoorLocked(TRIGGER._5_03_Patient_Room2, false)
- AreaSetDoorLocked(TRIGGER._5_03_Patient_Room3, false)
- AreaSetDoorLocked(TRIGGER._DT_ASYLUM_BACK_EXIT, false)
- AreaSetDoorLocked(TRIGGER._DT_ASYLUM_FRONT_DOOR, false)
- AreaSetDoorLocked(TRIGGER._DT_ASYLUM_SIDE_EXIT, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_RoofDoor, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_RoofDoor, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_Staff, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_Staff, false)
- AreaSetDoorLocked(TRIGGER._DT_ISCHOOL_BIO, false)
- AreaSetDoorLocked(TRIGGER._DT_ISCHOOL_BIO, false)
- AreaSetDoorLocked(TRIGGER._DT_iSafeDrop_DoorL, false)
- AreaSetDoorLocked(TRIGGER._DT_tind_SafeDrop, false)
- AreaSetDoorLocked(TRIGGER._DT_tschool_SafeJock, false)
- AreaSetDoorLocked(TRIGGER._DT_iSafeGrsr_DoorL, false)
- AreaSetDoorLocked(TRIGGER._DT_tpoor_SafeGreaser, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_Art, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_Art, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_AuditorBalc, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_Classroom, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_Classroom, false)
- AreaSetDoorLocked(TRIGGER._DT_tschool_SchoolSideDoorL, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_Door01, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_Door01, false)
- AreaSetDoorLocked(TRIGGER._DT_Janitor_SchoolExit, false)
- AreaSetDoorLocked(TRIGGER._DT_Janitor_MainExit, false)
- AreaSetDoorLocked(TRIGGER._DT_ASYLUM_FRONT_DOOR, false)
- AreaSetDoorLocked(TRIGGER._DT_ASYLUM_SIDE_EXIT, false)
- AreaSetDoorLocked(TRIGGER._DT_classr_doorL, false)
- AreaSetDoorLocked(TRIGGER._DT_classr_doorL, false)
- AreaSetDoorLocked(TRIGGER._DT_ChemPlant_DoorL, false)
- AreaSetDoorLocked(TRIGGER._DT_ChemPlant_DoorL, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_Classroom, false)
- AreaSetDoorLocked(TRIGGER._DT_ISCHOOL_CHEM, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_Janitor, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_PrincipalDoorL, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_Classroom, false)
- AreaSetDoorLocked(TRIGGER._DT_ischool_Art, false)
- AreaSetDoorLocked(TRIGGER._DT_Tenement_Window, false)
- AreaSetDoorLocked(TRIGGER._DT_Tenement_Window, false)
- AreaSetDoorLocked(TRIGGER._DT_ASYLUM_BACK_EXIT, false)
- AreaSetDoorLocked(TRIGGER._DT_ASYLUM_BACK_EXIT, false)
- AreaSetDoorLocked(TRIGGER._DT_iSafeNerd_DoorL, false)
- AreaSetDoorLocked(TRIGGER._DT_iSafeNerd_DoorL, false)
- AreaSetDoorLocked(TRIGGER._5_03_Control_Orderly_Path, false)
- AreaSetDoorLocked(TRIGGER._3_S11_Asylum_Gate_Warning, false)
- AreaSetDoorLocked(TRIGGER._3_S11_Asylum_Gate_Warning2, false)
- AreaSetDoorLocked(TRIGGER._ASYLUM_FRONT_GATE_DOOR, false)
- AreaSetDoorLocked(TRIGGER._ASYLUM_FRONT_DOOR_R, false)
- AreaSetDoorLocked(TRIGGER._DT_tschool_SchoolSideDoorL, false)
- AreaSetDoorLocked(TRIGGER._DT_tschool_SchoolSideDoorL, false)
- AreaSetDoorLocked(TRIGGER._5_B_DEBUG_STAGE4, false)
- AreaSetDoorLocked(TRIGGER._5_B_EDGARMOVETO, false)
- AreaSetDoorLocked(TRIGGER._ChemPlantLower, false)
- AreaSetDoorLocked(TRIGGER._ChemPlantStairTunnel, false)
- AreaSetDoorLocked(TRIGGER._DT_TSCHOOL_ROOFDOOR, false)
- AreaSetDoorLocked(TRIGGER._DT_ISCHOOL_ROOFDOOR, false)
- AreaSetDoorLocked(TRIGGER._ISCHOOL_DOOR25, false)
- AreaSetDoorLocked(TRIGGER._DT_gym_doorL,false)
- AreaSetDoorLocked(TRIGGER._DOOR_PREPHOUSE_STAIRS, false)
- AreaSetDoorLocked(TRIGGER._DT_TSCHOOL_PREPPYL, false)
- AreaSetDoorLocked(TRIGGER._DT_TSCHOOL_PREPPYL, false)
- AreaSetDoorLocked(TRIGGER._DOOR_PREPHOUSE_FOYER, false)
- AreaSetDoorLocked(TRIGGER._DT_PREPTOMAIN, false)
- end
- function main()
- while not SystemIsReady() or AreaIsLoading() do
- Wait(0)
- end
- TextPrintString("Populated classrooms\n&\nUnlocked interiors\n\nBy: RBS ID", 3, 1)
- PopulatedClassrooms_mod()
- AreaAndInterior_mod()
- while true do
- Wait(0)
- end
- end
- -- STimeCycle:
- F_AttendedClass = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- SetSkippedClass(false)
- PlayerSetPunishmentPoints(0)
- end
- F_MissedClass = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- SetSkippedClass(true)
- StatAddToInt(166)
- end
- F_AttendedCurfew = function()
- if not PedInConversation(gPlayer) and not MissionActive() then
- TextPrintString("You got home in time for curfew", 4)
- end
- end
- F_MissedCurfew = function()
- if not PedInConversation(gPlayer) and not MissionActive() then
- TextPrint("TM_TIRED5", 4, 2)
- end
- end
- F_StartClass = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- F_RingSchoolBell()
- local l_6_0 = PlayerGetPunishmentPoints() + GetSkippingPunishment()
- end
- F_EndClass = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- F_RingSchoolBell()
- end
- F_StartMorning = function()
- F_UpdateTimeCycle()
- end
- F_EndMorning = function()
- F_UpdateTimeCycle()
- end
- F_StartLunch = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- F_UpdateTimeCycle()
- return
- end
- F_UpdateTimeCycle()
- end
- F_EndLunch = function()
- F_UpdateTimeCycle()
- end
- F_StartAfternoon = function()
- F_UpdateTimeCycle()
- end
- F_EndAfternoon = function()
- F_UpdateTimeCycle()
- end
- F_StartEvening = function()
- F_UpdateTimeCycle()
- end
- F_EndEvening = function()
- F_UpdateTimeCycle()
- end
- F_StartCurfew_SlightlyTired = function()
- F_UpdateTimeCycle()
- end
- F_StartCurfew_Tired = function()
- F_UpdateTimeCycle()
- end
- F_StartCurfew_MoreTired = function()
- F_UpdateTimeCycle()
- end
- F_StartCurfew_TooTired = function()
- F_UpdateTimeCycle()
- end
- F_EndCurfew_TooTired = function()
- F_UpdateTimeCycle()
- end
- F_EndTired = function()
- F_UpdateTimeCycle()
- end
- F_Nothing = function()
- end
- F_ClassWarning = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- local l_23_0 = math.random(1, 2)
- end
- F_UpdateTimeCycle = function()
- if not IsMissionCompleated("1_B") then
- local l_24_0 = GetCurrentDay(false)
- if l_24_0 < 0 or l_24_0 > 2 then
- SetCurrentDay(0)
- end
- end
- F_UpdateCurfew()
- end
- F_UpdateCurfew = function()
- local l_25_0 = shared.gCurfewRules
- if not l_25_0 then
- l_25_0 = F_CurfewDefaultRules
- end
- l_25_0()
- end
- F_CurfewDefaultRules = function()
- local l_26_0 = ClockGet()
- if l_26_0 >= 23 or l_26_0 < 7 then
- shared.gCurfew = true
- else
- shared.gCurfew = false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment