Advertisement
DaBOSS54320

Bully LUA: Node Finder

Sep 20th, 2015
670
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.80 KB | None | 0 0
  1. function main()
  2.   -- Let the game initialize:
  3.   Wait(500)
  4.  
  5.   -- If this is true, the node the player is playing will be searched for; if it is false, the player's target will be used instead.
  6.   local usePlayer = true
  7.  
  8.   -- Toggle for if the node should be shown or not, toggled by button (3,0).
  9.   local show = true
  10.  
  11.   -- This table of nodes will be used to guess which node the player/target is playing:
  12.   local nodes = {
  13.     "Global",
  14.     "Default",
  15.     "Default_KEY",
  16.     "Ambient",
  17.     "HitTree",
  18.   }
  19.  
  20.   -- Main loop:
  21.   while true do
  22.     -- Toggle:
  23.     if IsButtonBeingPressed(3,0) then
  24.       show = not show
  25.     end
  26.    
  27.     -- Show node:
  28.     local ped = (usePlayer and gPlayer) or PedGetTargetPed(gPlayer)
  29.     if show then
  30.       if PedIsValid(ped) then
  31.         local node = "/Global/"
  32.         for i,v in ipairs(nodes) do
  33.           if PedIsPlaying(ped,node..v,true) then
  34.             node = node..v.."/"
  35.             i = 1
  36.           end
  37.         end
  38.         TextPrintString(node,0,2)
  39.       else
  40.         TextPrintString("(invalid target)",0,2)
  41.       end
  42.     end
  43.     Wait(0)
  44.   end
  45. end
  46.  
  47. -- STimeCycle:
  48. function F_AttendedClass()
  49.   if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  50.     return
  51.   end
  52.   SetSkippedClass(false)
  53.   PlayerSetPunishmentPoints(0)
  54. end
  55. function F_MissedClass()
  56.   if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  57.     return
  58.   end
  59.   SetSkippedClass(true)
  60.   StatAddToInt(166)
  61. end
  62. function F_AttendedCurfew()
  63.   if not PedInConversation(gPlayer) and not MissionActive() then
  64.     TextPrintString("You got home in time for curfew", 4)
  65.   end
  66. end
  67. function F_MissedCurfew()
  68.   if not PedInConversation(gPlayer) and not MissionActive() then
  69.     TextPrint("TM_TIRED5", 4, 2)
  70.   end
  71. end
  72. function F_StartClass()
  73.   if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  74.     return
  75.   end
  76.   F_RingSchoolBell()
  77.   local l_6_0 = PlayerGetPunishmentPoints() + GetSkippingPunishment()
  78. end
  79. function F_EndClass()
  80.   if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  81.     return
  82.   end
  83.   F_RingSchoolBell()
  84. end
  85. function F_StartMorning()
  86.   F_UpdateTimeCycle()
  87. end
  88. function F_EndMorning()
  89.   F_UpdateTimeCycle()
  90. end
  91. function F_StartLunch()
  92.   if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  93.     F_UpdateTimeCycle()
  94.     return
  95.   end
  96.   F_UpdateTimeCycle()
  97. end
  98. function F_EndLunch()
  99.   F_UpdateTimeCycle()
  100. end
  101. function F_StartAfternoon()
  102.   F_UpdateTimeCycle()
  103. end
  104. function F_EndAfternoon()
  105.   F_UpdateTimeCycle()
  106. end
  107. function F_StartEvening()
  108.   F_UpdateTimeCycle()
  109. end
  110. function F_EndEvening()
  111.   F_UpdateTimeCycle()
  112. end
  113. function F_StartCurfew_SlightlyTired()
  114.   F_UpdateTimeCycle()
  115. end
  116. function F_StartCurfew_Tired()
  117.   F_UpdateTimeCycle()
  118. end
  119. function F_StartCurfew_MoreTired()
  120.   F_UpdateTimeCycle()
  121. end
  122. function F_StartCurfew_TooTired()
  123.   F_UpdateTimeCycle()
  124. end
  125. function F_EndCurfew_TooTired()
  126.   F_UpdateTimeCycle()
  127. end
  128. function F_EndTired()
  129.   F_UpdateTimeCycle()
  130. end
  131. function F_Nothing()
  132. end
  133. function F_ClassWarning()
  134.   if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  135.     return
  136.   end
  137.   local l_23_0 = math.random(1, 2)
  138. end
  139. function F_UpdateTimeCycle()
  140.   if not IsMissionCompleated("1_B") then
  141.     local l_24_0 = GetCurrentDay(false)
  142.     if l_24_0 < 0 or l_24_0 > 2 then
  143.       SetCurrentDay(0)
  144.     end
  145.   end
  146.   F_UpdateCurfew()
  147. end
  148. function F_UpdateCurfew()
  149.   local l_25_0 = shared.gCurfewRules
  150.   if not l_25_0 then
  151.     l_25_0 = F_CurfewDefaultRules
  152.   end
  153.   l_25_0()
  154. end
  155. function F_CurfewDefaultRules()
  156.   local l_26_0 = ClockGet()
  157.   if l_26_0 >= 23 or l_26_0 < 6 then
  158.     shared.gCurfew = true
  159.   else
  160.     shared.gCurfew = false
  161.   end
  162. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement