News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: LUA Time Lock  (Read 10954 times)

0 Members and 1 Guest are viewing this topic.

Offline SWEGTA

  • Da Forum Luffs Me!
  • *****
  • Posts: 6,422
  • Gender: Male
  • Swee Gee Tee Ayy
    • View Profile
    • Bully & GTA videos
Re: LUA Time Lock
« Reply #15 on: April 21, 2013, 07:15:13 AM »
SWEGTA completely deserves being a moderator, he will make a good one for sure.


Pfffshaauwww Yoooouuuuu  :wub:

Offline FearlessBloodseeker

  • X-Strygwyr-X
  • Jr. Member
  • **
  • Posts: 24
  • Gender: Male
  • X-Bloodseeker-X
    • View Profile
Re: LUA Time Lock
« Reply #16 on: April 21, 2013, 08:46:21 AM »
Err, sorry to interrupt. Well maybe I'm pretty rude, but I'm uh, asking how to freeze the time, not about moderator..? xD

Offline xbetstyler

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: LUA Time Lock
« Reply #17 on: April 21, 2013, 09:01:22 AM »
You can used this command to freeze and unfreeze the game clock:

PauseGameClock()
UnpauseGameClock()

Offline Evolution

  • Elitist
  • *********
  • Posts: 13,574
  • Gender: Male
    • View Profile
Re: LUA Time Lock
« Reply #18 on: April 21, 2013, 09:05:46 AM »
Err, sorry to interrupt. Well maybe I'm pretty rude, but I'm uh, asking how to freeze the time, not about moderator..? xD

RUDE BASTARD!!!! HOW DARE YOU ASK FOR WHAT YOU PREVIOUSLY REQUESTED BEFORE IT GOT DERAILED AND THAN YOU CHANGED THE TOPIC BACK ON TOPIC, HOW RUDE!!!! :P

Anyways, Betstyler (Now esai) explained how.

Offline xbetstyler

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: LUA Time Lock
« Reply #19 on: April 21, 2013, 09:12:11 AM »
Do you mean how to script the command?

Offline FearlessBloodseeker

  • X-Strygwyr-X
  • Jr. Member
  • **
  • Posts: 24
  • Gender: Male
  • X-Bloodseeker-X
    • View Profile
Re: LUA Time Lock
« Reply #20 on: April 21, 2013, 09:14:23 AM »
Well, via LUA of course :) and yes. What is the command should I add in the LUA script to freeze the time..?

Offline xbetstyler

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: LUA Time Lock
« Reply #21 on: April 21, 2013, 09:18:38 AM »
I used if statement script:

example: if IsButtonPressed(14, 0) then
              PauseGameClock()
              elseif IsButtonPressed(15, 0) then
              UnpauseGameClock()

Offline FearlessBloodseeker

  • X-Strygwyr-X
  • Jr. Member
  • **
  • Posts: 24
  • Gender: Male
  • X-Bloodseeker-X
    • View Profile
Re: LUA Time Lock
« Reply #22 on: April 21, 2013, 09:21:27 AM »
Well, how do I permanently freeze the time which is at 12:00 (or something) that has no class and spawns more students?

Offline xbetstyler

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: LUA Time Lock
« Reply #23 on: April 21, 2013, 09:27:39 AM »
You can freeze and unfreeze anytime you want.
And to spawn more student you have to edit the PedPop.dat.

deadpoolXYZ

  • Guest
Re: LUA Time Lock
« Reply #24 on: April 21, 2013, 09:38:25 AM »
He is asking if you can change the time to 12:00 and freeze it.

Save your game at 11:50 and start the arcade machine to freeze the time.

Offline xbetstyler

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: LUA Time Lock
« Reply #25 on: April 21, 2013, 09:44:20 AM »
Like I said..the time will freeze when you press the "x" button.
so press the button at 12.00 to freeze the clock at that time.

Edit: You still can access your save book when you freeze the clock.
« Last Edit: April 21, 2013, 09:47:38 AM by www.Esai.cn »

deadpoolXYZ

  • Guest
Re: LUA Time Lock
« Reply #26 on: April 21, 2013, 10:03:41 AM »
I know it. -.-

Im just saying that he should save his game at 11:50 so everytime he loads it he doesn't have to wait.

Offline FearlessBloodseeker

  • X-Strygwyr-X
  • Jr. Member
  • **
  • Posts: 24
  • Gender: Male
  • X-Bloodseeker-X
    • View Profile
Re: LUA Time Lock
« Reply #27 on: April 23, 2013, 08:16:41 AM »
Alright. I tried like what you said, but I got an error in the uh.."prompting" stuffs.
So this is my LUA (Madman's)

Code: [Select]
GlobalImportScript("SObjTest.lua")
ImportScript("Library/LibTable.lua")
ImportScript("SZone.lua")

  l_0_0 = 60

MissionSetup = function()
  local l_1_0 = 270
  local l_1_1 = -110
  local l_1_2 = 6.4000000953674
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
  TextPrintString("Bully: Scholarship Edition Multi-Bodyguard  Mod v1 BETA.", 4, 1)
  Wait(5000)
  TextPrintString("By: |XF|-MadmaN [AR] ", 4, 1)
  Wait(5000)
     
  l_0_3 = PedCreatePoint(37, POINTLIST._BEGGINING, 1) -- Darby BOSS
  l_0_4 = PedCreatePoint(33, POINTLIST._BEGGINING, 1) -- Bif
   l_0_5 = PedCreatePoint(35, POINTLIST._BEGGINING, 1) -- Bryce
   l_0_6 = PedCreatePoint(34, POINTLIST._BEGGINING, 1) -- Justin
   l_0_7 = PedCreatePoint(40, POINTLIST._BEGGINING, 1) -- Parker
   l_0_8 = PedCreatePoint(32, POINTLIST._BEGGINING, 1) -- Chad
   l_0_9 = PedCreatePoint(30, POINTLIST._BEGGINING, 1) -- Gord
   l_1_0 = PedCreatePoint(31, POINTLIST._BEGGINING, 1) -- Tad
   l_1_1 = PedCreatePoint(38, POINTLIST._BEGGINING, 1) -- Pinky

 
        PedSetActionTree(gPlayer, "/Global/P_Striker_A", "Act/Anim/P_Striker_A.act") -- Player
    PedSetActionTree(l_0_3, "/Global/BOSS_Darby", "Act/Anim/BOSS_Darby.act") -- Darby BOSS
    PedSetActionTree(l_0_4, "/Global/P_Striker_A", "Act/Anim/P_Striker_A.act") -- Bif
        PedSetActionTree(l_0_5, "/Global/P_Grappler_A", "Act/Anim/P_Grappler_A.act") -- Bryce
        PedSetActionTree(l_0_6, "/Global/P_Striker_B", "Act/Anim/P_Striker_B.act") -- Justin
        PedSetActionTree(l_0_7, "/Global/P_Striker_B", "Act/Anim/P_Striker_B.act") -- Parker
        PedSetActionTree(l_0_8, "/Global/P_Grappler_A", "Act/Anim/P_Grappler_A.act") -- Chad
        PedSetActionTree(l_0_9, "/Global/P_Striker_A", "Act/Anim/P_Striker_A.act") -- Gord
        PedSetActionTree(l_1_0, "/Global/P_Striker_A", "Act/Anim/P_Striker_A.act") -- Tad
        PedSetActionTree(l_1_1, "/Global/GS_Female_A", "Act/Anim/GS_Female_A.act") -- Pinky                     
     
   -- Ally Blip Code Start
   --
    l_2_7 = AddBlipForChar(l_0_3, 6, 2, 2)
    l_2_8 = AddBlipForChar(l_0_4, 6, 2, 2)
   l_2_9 = AddBlipForChar(l_0_5, 6, 2, 2)
   l_3_0 = AddBlipForChar(l_0_6, 6, 2, 2)
   l_3_1 = AddBlipForChar(l_0_7, 6, 2, 2)
   l_3_2 = AddBlipForChar(l_0_8, 6, 2, 2)
   l_3_3 = AddBlipForChar(l_0_9, 6, 2, 2)
   l_3_4 = AddBlipForChar(l_1_0, 6, 2, 2)
   l_3_5 = AddBlipForChar(l_1_1, 6, 2, 2)
   
   -- Infinite Sprint Code Start for Allies
   --
    PedSetInfiniteSprint(l_0_3, true)
    PedSetInfiniteSprint(l_0_4, true)
   PedSetInfiniteSprint(l_0_5, true)
   PedSetInfiniteSprint(l_0_6, true)
   PedSetInfiniteSprint(l_0_7, true)
   PedSetInfiniteSprint(l_0_8, true)
   PedSetInfiniteSprint(l_0_9, true)
   PedSetInfiniteSprint(l_1_0, true)
   PedSetInfiniteSprint(l_1_1, true)
   
   PedSetHealth(l_0_3, 100000)
   PedSetHealth(l_0_4, 100000)
   PedSetHealth(l_0_5, 100000)
   PedSetHealth(l_0_6, 100000)
   PedSetHealth(l_0_7, 100000)
   PedSetHealth(l_0_8, 100000)
   PedSetHealth(l_0_9, 100000)
   PedSetHealth(l_1_0, 100000)
   PedSetHealth(l_1_1, 100000)
   
   -- Ped Recruit Code Start
   --
    PedRecruitAlly(gPlayer, l_0_3)
    PedRecruitAlly(l_0_3, l_0_4)
   PedRecruitAlly(l_0_4, l_0_5)
   PedRecruitAlly(l_0_5, l_0_6)
   PedRecruitAlly(l_0_6, l_0_7)
   PedRecruitAlly(l_0_7, l_0_8)
   PedRecruitAlly(l_0_8, l_0_9)
   PedRecruitAlly(l_0_9, l_1_0)
   PedRecruitAlly(l_1_0, l_1_1)
   
   PedSetAllyAutoEngage(l_0_3, true)
   PedSetAllyAutoEngage(l_0_4, true)
   PedSetAllyAutoEngage(l_0_5, true)
   PedSetAllyAutoEngage(l_0_6, true)
   PedSetAllyAutoEngage(l_0_7, true)
   PedSetAllyAutoEngage(l_0_8, true)
   PedSetAllyAutoEngage(l_0_9, true)
   PedSetAllyAutoEngage(l_1_0, true)
   PedSetAllyAutoEngage(l_1_1, true)
   

SoundPlayInteractiveStream("MS_DishonorableFight.rsm",MUSIC_DEFAULT_VOLUME)
SoundSetMidIntensityStream("MS_JockBossBattle.rsm",MUSIC_DEFAULT_VOLUME)
SoundSetHighIntensityStream("MS_TenementsHigh.rsm",MUSIC_DEFAULT_VOLUME)

              IsButtonPressed(14, 0) then
              PauseGameClock()
              IsButtonPressed(15, 0) then
              UnpauseGameClock()
end


F_MissionSetup = function()
  PlayerSetControl(1)
  CameraFollowPed(gPlayer)
  ClockSet(9, 30)
  ClockSetTickRate(0.0060000000521541)
  LaunchScript("SObjTest.lua")

end



MissionCleanup = function()
  ClearTextQueue()
  EnablePOI()
  gMissionRunning = false
  shared.gMissionEventFunction = nil
  WeatherRelease()
  PlayerSetControl(1)
  PlayerSetPunishmentPoints(0) 
end



main = function()
  F_MissionSetup()
  gMissionRunning = true
  while gMissionRunning do
    UpdateTextQueue()
    Wait(0)
   end
end

Two questions:
1. What should I add in?
2. Which section should I add in?

Offline xbetstyler

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: LUA Time Lock
« Reply #28 on: April 23, 2013, 09:10:43 AM »
If your launch the script with arcade game the command doesn't effect.
Better you just compile this timecycle script.
It will lock the time at 1 pm.
compile the script as STimeCycle.lur and replace it in your Scripts.img.

Code: [Select]
main = function()
  repeat
    Wait(1000)
  until not Alive
end
 
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()
  PauseGameClock()
end
 
F_StartAfternoon = function()
  F_UpdateTimeCycle()
  PauseGameClock()
end
 
F_EndAfternoon = function()
  F_UpdateTimeCycle()
  PauseGameClock()
end
 
F_StartEvening = function()
  F_UpdateTimeCycle()
  PauseGameClock()
end
 
F_EndEvening = function()
  F_UpdateTimeCycle()
  PauseGameClock()
end
 
F_StartCurfew_SlightlyTired = function()
  F_UpdateTimeCycle()
  PauseGameClock()
end
 
F_StartCurfew_Tired = function()
  F_UpdateTimeCycle()
  PauseGameClock()
end
 
F_StartCurfew_MoreTired = function()
  F_UpdateTimeCycle()
  PauseGameClock()
end
 
F_StartCurfew_TooTired = function()
  F_UpdateTimeCycle()
  PauseGameClock()
end
 
F_EndCurfew_TooTired = function()
  F_UpdateTimeCycle()
  PauseGameClock()
end
 
F_EndTired = function()
  F_UpdateTimeCycle()
  PauseGameClock()
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
« Last Edit: April 23, 2013, 09:27:46 AM by www.Esai.cn »

deadpoolXYZ

  • Guest
Re: LUA Time Lock
« Reply #29 on: April 23, 2013, 06:27:54 PM »
Does STimeCycle.lur make changes to the game?
Because Im sick of starting the arcade machine everytime I start a custom script.