RanggaBS

Custom respects

Jul 18th, 2021 (edited)
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.36 KB | None | 0 0
  1. -- Custom respects
  2.  
  3. main = function()
  4.     while true do
  5.         Wait(0)
  6.         Respect()
  7.     end
  8. end
  9.  
  10. -- STimeCycle:
  11. function F_AttendedClass()
  12.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  13.         return
  14.     end
  15.     SetSkippedClass(false)
  16.     PlayerSetPunishmentPoints(0)
  17. end
  18. function F_MissedClass()
  19.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  20.         return
  21.     end
  22.     SetSkippedClass(true)
  23.     StatAddToInt(166)
  24. end
  25. function F_AttendedCurfew()
  26.     if not PedInConversation(gPlayer) and not MissionActive() then
  27.         TextPrintString("You got home in time for curfew", 4)
  28.     end
  29. end
  30. function F_MissedCurfew()
  31.     if not PedInConversation(gPlayer) and not MissionActive() then
  32.         TextPrint("TM_TIRED5", 4, 2)
  33.     end
  34. end
  35. function F_StartClass()
  36.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  37.         return
  38.     end
  39. end
  40. function F_EndClass()
  41.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  42.         return
  43.     end
  44. end
  45. function F_StartMorning()
  46.     F_UpdateTimeCycle()
  47. end
  48. function F_EndMorning()
  49.     F_UpdateTimeCycle()
  50. end
  51. function F_StartLunch()
  52.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  53.         F_UpdateTimeCycle()
  54.         return
  55.     end
  56.     F_UpdateTimeCycle()
  57. end
  58. function F_EndLunch()
  59.     F_UpdateTimeCycle()
  60. end
  61. function F_StartAfternoon()
  62.     F_UpdateTimeCycle()
  63. end
  64. function F_EndAfternoon()
  65.     F_UpdateTimeCycle()
  66. end
  67. function F_StartEvening()
  68.     F_UpdateTimeCycle()
  69. end
  70. function F_EndEvening()
  71.     F_UpdateTimeCycle()
  72. end
  73. function F_StartCurfew_SlightlyTired()
  74.     F_UpdateTimeCycle()
  75. end
  76. function F_StartCurfew_Tired()
  77.     F_UpdateTimeCycle()
  78. end
  79. function F_StartCurfew_MoreTired()
  80.     F_UpdateTimeCycle()
  81. end
  82. function F_StartCurfew_TooTired()
  83.     F_UpdateTimeCycle()
  84. end
  85. function F_EndCurfew_TooTired()
  86.     F_UpdateTimeCycle()
  87. end
  88. function F_EndTired()
  89.     F_UpdateTimeCycle()
  90. end
  91. function F_Nothing()
  92. end
  93. function F_ClassWarning()
  94.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  95.         return
  96.     end
  97.     local l_23_0 = math.random(1, 2)
  98. end
  99. function F_UpdateTimeCycle()
  100.     if not IsMissionCompleated("1_B") then
  101.         local l_24_0 = GetCurrentDay(false)
  102.         if l_24_0 < 0 or l_24_0 > 2 then
  103.             SetCurrentDay(0)
  104.         end
  105.     end
  106.     F_UpdateCurfew()
  107. end
  108. function F_UpdateCurfew()
  109.     local l_25_0 = shared.gCurfewRules
  110.     if not l_25_0 then
  111.         l_25_0 = F_CurfewDefaultRules
  112.     end
  113.     l_25_0()
  114. end
  115. function F_CurfewDefaultRules()
  116.     local l_26_0 = ClockGet()
  117.     if l_26_0 >= 23 or l_26_0 < 7 then
  118.         shared.gCurfew = false
  119.     else
  120.         shared.gCurfew = false
  121.     end
  122. end
  123.  
  124. Respect = function()
  125.     -- 1. Simple command to change all faction's respect to the same attitude/respect
  126.     for A = 0,12 do
  127.         PedSetDefaultTypeToTypeAttitude(A,13,4)
  128.         SetFactionRespect(A,100)
  129.     end
  130.    
  131.     --[[2. Command for changing faction's respect that only you've selected
  132.     to the same attitude]]
  133.     local B = {1, 2, 4, 5} -- <== Faction that you selected
  134.     for BB, b in ipairs(B) do
  135.         PedSetDefaultTypeToTypeAttitude(b, 13, 4)
  136.         SetFactionRespect(b, 100)
  137.     end
  138.    
  139.     -- 3. Command to change faction's respect that you selected to whatever you want
  140.     for C, ped in {PedFindInAreaXYZ(0, 0, 0, 99999)} do
  141.         if PedGetFaction(ped) == 1 then
  142.             PedSetDefaultTypeToTypeAttitude(ped, 13, 0)
  143.             SetFactionRespect(ped,0)
  144.         end
  145.         if PedGetFaction(ped) == 5 then
  146.             PedSetDefaultTypeToTypeAttitude(ped, 13, 0)
  147.             SetFactionRespect(ped,0)
  148.         end
  149.         if PedGetFaction(ped) == 9 then
  150.             PedSetDefaultTypeToTypeAttitude(ped, 13 ,0)
  151.         end
  152.     end
  153.    
  154.     --[[4. Another command to change faction's respect manually, 1 by 1.
  155.     With this command, you can change all faction's respect to different attitude]]
  156.     for D = 0,12 do
  157.         if D == 0 then
  158.             PedSetDefaultTypeToTypeAttitude(D,13,0)
  159.         elseif D == 1 then
  160.             PedSetDefaultTypeToTypeAttitude(D,13,4)
  161.             SetFactionRespect(D,100)
  162.         elseif D == 2 then
  163.             PedSetDefaultTypeToTypeAttitude(D,13,4)
  164.             SetFactionRespect(D,100)
  165.         elseif D == 3 then
  166.             PedSetDefaultTypeToTypeAttitude(D,13,4)
  167.             SetFactionRespect(D,100)
  168.         elseif D == 4 then
  169.             PedSetDefaultTypeToTypeAttitude(D,13,4)
  170.             SetFactionRespect(D,100)
  171.         elseif D == 5 then
  172.             PedSetDefaultTypeToTypeAttitude(D,13,4)
  173.             SetFactionRespect(Faction,100)
  174.         elseif D == 6 then
  175.             PedSetDefaultTypeToTypeAttitude(D,13,4)
  176.         elseif D == 7 then
  177.             PedSetDefaultTypeToTypeAttitude(D,13,4)
  178.         elseif D == 8 then
  179.             PedSetDefaultTypeToTypeAttitude(D,13,4)
  180.         elseif D == 9 then
  181.             PedSetDefaultTypeToTypeAttitude(D,13,4)
  182.         elseif D == 10 then
  183.             PedSetDefaultTypeToTypeAttitude(D,13,4)
  184.         elseif D == 11 then
  185.             PedSetDefaultTypeToTypeAttitude(D,13,4)
  186.             SetFactionRespect(D,100)
  187.         elseif D == 12 then
  188.             PedSetDefaultTypeToTypeAttitude(D,13,4)
  189.         end
  190.     end
  191. end
Add Comment
Please, Sign In to add comment