Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Garages.lua
- if type(F_InitGarages) ~= "function" then
- F_InitGarages = function()
- DATLoad("Garages.DAT", 1)
- GarageClearAll()
- GarageAdd(TRIGGER._Garage_SchoolGrounds, POINTLIST._Garage_SchoolGrounds)
- GarageAdd(TRIGGER._Garage_RichArea, POINTLIST._Garage_RichArea)
- GarageAdd(TRIGGER._Garage_BusinessArea, POINTLIST._Garage_BusinessArea)
- GarageAdd(TRIGGER._Garage_PoorArea, POINTLIST._Garage_PoorArea)
- end
- end
- shared.userDeviceIsPC = type(_G.ClassMusicSetPlayers) == "function" and true or false
- shared.gSaveAnywhere = {}
- _G.SaveAnywhere = function()
- while not SystemIsReady() do
- Wait(0)
- end
- shared.gSaveAnywhere.timer = GetTimer()
- while true do
- Wait(0)
- if not PlayerIsInAnyVehicle() and PedMePlaying(gPlayer, "Default_KEY") then
- if GetStickValue(6, 0) == 1 and GetStickValue(8, 0) == 1 then
- if GetTimer() >= shared.gSaveAnywhere.timer+3000 then
- if MissionActive() then
- if shared.userDeviceIsPC then
- TextPrintString("You can\'t save\nwhile in mission!", 3, 1)
- else
- MinigameSetAnnouncement("You can\'t save\nwhile in mission!", true)
- end
- --SoundPlay2D("WrongBtn")
- --Wait(1500)
- else
- local x, y, z = PedGetOffsetInWorldCoords(gPlayer, 0, 1, 1)
- local animSaveId, animSaveObj = CreatePersistentEntity("AnimSave", x, y, z, math.deg(PedGetHeading(gPlayer)), AreaGetVisible())
- Wait(50)
- PedSetActionNode(gPlayer, "/Global/WProps/SaveBookInteract", "Act/WProps.act")
- Wait(25)
- DeletePersistentEntity(animSaveId, animSaveObj)
- collectgarbage()
- end
- end
- else
- shared.gSaveAnywhere.timer = GetTimer()
- end
- end
- end
- end
- shared.gSaveAnywhere.mainThread = CreateThread("SaveAnywhere")
Add Comment
Please, Sign In to add comment