Altamurenza

Bully SE: BBGun

Jan 27th, 2018
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.04 KB | None | 0 0
  1. function main()
  2.     -- Wait for the game:
  3.     while not SystemIsReady() or AreaIsLoading() do
  4.         Wait(0)
  5.     end
  6.    
  7.     -- Process:
  8.     while true do
  9.         -- Activation:
  10.         if IsButtonBeingReleased(3,0) then
  11.             -- Lock Weapon HUD:
  12.             PlayerWeaponHudLock(true)
  13.            
  14.             -- Unlock Camera:
  15.             CameraAllowChange(true)
  16.            
  17.             -- Set BBGun:
  18.             PedSetWeaponNow(gPlayer, 391, 25)
  19.            
  20.             -- Set Camera:
  21.             CameraSetActive(2)
  22.             CameraSetShot(2,"ShootingGallery",true)
  23.            
  24.             -- Lock Camera:
  25.             CameraAllowChange(false)
  26.            
  27.             -- Show Counter HUD:
  28.             CounterMakeHUDVisible(true)
  29.            
  30.             -- Ammo:
  31.             local ammo = 15
  32.            
  33.             -- Set Counter:
  34.             CounterSetCurrent(15)
  35.             CounterSetMax(15)
  36.            
  37.             -- Wait:
  38.             Wait(200)
  39.            
  40.             repeat
  41.                 if not PedHasWeapon(gPlayer,391) then
  42.                     PedSetWeaponNow(gPlayer,391,25)
  43.                 end
  44.                 if IsButtonBeingReleased(12,0) then
  45.                     ammo = ammo - 1
  46.                     CounterSetCurrent(ammo)
  47.                 end
  48.                 TextPrintString("~LOOK_BACK~ Exit",0,1)
  49.                
  50.                 Wait(0)
  51.             until IsButtonBeingReleased(14,0) or ammo < 1
  52.            
  53.             -- Reset:
  54.             CameraAllowChange(true)
  55.             CameraSetShot(2, 0)
  56.             CameraReturnToPlayer()
  57.             PlayerWeaponHudLock(false)
  58.             CameraDefaultFOV()
  59.             if not PedHasWeapon(gPlayer,-1) then
  60.                 PedDestroyWeapon(gPlayer, 391)
  61.             end
  62.             CameraSetActive(1)
  63.         end
  64.        
  65.         Wait(0)
  66.     end
  67. end
  68.  
  69. -- STimeCycle.lur functions:
  70.  
  71. function F_AttendedClass()
  72.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  73.         return
  74.     end
  75.     SetSkippedClass(false)
  76.     PlayerSetPunishmentPoints(0)
  77. end
  78. function F_MissedClass()
  79.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  80.         return
  81.     end
  82.     SetSkippedClass(true)
  83.     StatAddToInt(166)
  84. end
  85. function F_AttendedCurfew()
  86.     if not PedInConversation(gPlayer) and not MissionActive() then
  87.         TextPrintString("You got home in time for curfew", 4)
  88.     end
  89. end
  90. function F_MissedCurfew()
  91.     if not PedInConversation(gPlayer) and not MissionActive() then
  92.         TextPrint("TM_TIRED5", 4, 2)
  93.     end
  94. end
  95. function F_StartClass()
  96.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  97.         return
  98.     end
  99. end
  100. function F_EndClass()
  101.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  102.         return
  103.     end
  104. end
  105. function F_StartMorning()
  106.     F_UpdateTimeCycle()
  107. end
  108. function F_EndMorning()
  109.     F_UpdateTimeCycle()
  110. end
  111. function F_StartLunch()
  112.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  113.         F_UpdateTimeCycle()
  114.         return
  115.     end
  116.     F_UpdateTimeCycle()
  117. end
  118. function F_EndLunch()
  119.     F_UpdateTimeCycle()
  120. end
  121. function F_StartAfternoon()
  122.     F_UpdateTimeCycle()
  123. end
  124. function F_EndAfternoon()
  125.     F_UpdateTimeCycle()
  126. end
  127. function F_StartEvening()
  128.     F_UpdateTimeCycle()
  129. end
  130. function F_EndEvening()
  131.     F_UpdateTimeCycle()
  132. end
  133. function F_StartCurfew_SlightlyTired()
  134.     F_UpdateTimeCycle()
  135. end
  136. function F_StartCurfew_Tired()
  137.     F_UpdateTimeCycle()
  138. end
  139. function F_StartCurfew_MoreTired()
  140.     F_UpdateTimeCycle()
  141. end
  142. function F_StartCurfew_TooTired()
  143.     F_UpdateTimeCycle()
  144. end
  145. function F_EndCurfew_TooTired()
  146.     F_UpdateTimeCycle()
  147. end
  148. function F_EndTired()
  149.     F_UpdateTimeCycle()
  150. end
  151. function F_Nothing()
  152. end
  153. function F_ClassWarning()
  154.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  155.         return
  156.     end
  157.     local l_23_0 = math.random(1, 2)
  158. end
  159. function F_UpdateTimeCycle()
  160.     if not IsMissionCompleated("1_B") then
  161.         local l_24_0 = GetCurrentDay(false)
  162.         if l_24_0 < 0 or l_24_0 > 2 then
  163.             SetCurrentDay(0)
  164.         end
  165.     end
  166.     F_UpdateCurfew()
  167. end
  168. function F_UpdateCurfew()
  169.     local l_25_0 = shared.gCurfewRules
  170.     if not l_25_0 then
  171.         l_25_0 = F_CurfewDefaultRules
  172.     end
  173.     l_25_0()
  174. end
  175. function F_CurfewDefaultRules()
  176.     local l_26_0 = ClockGet()
  177.     if l_26_0 >= 23 or l_26_0 < 7 then
  178.         shared.gCurfew = true
  179.     else
  180.         shared.gCurfew = false
  181.     end
  182. end
Advertisement
Add Comment
Please, Sign In to add comment