Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.54 KB | None | 0 0
  1. --- This script will update head models in your current save.
  2. --- Head models added in Patch 5, Patch 6, Patch 7 & Patch 8
  3.  
  4. --- HOW TO USE:
  5. --- https://i.imgur.com/xZMqzTc.gifv
  6. --- 1. Open Cheat table as usuall and enter your career.
  7. --- 2. In Cheat Engine click on "Memory View" button.
  8. --- 3. Press "CTRL + L" to open lua engine
  9. --- 4. Then press "CTRL + O" and open this script
  10. --- 5. Click on 'Execute' button to execute script and wait for 'done' message box.
  11.  
  12. --- AUTHOR: ARANAKTU
  13.  
  14. require 'lua/GUI/forms/playerseditorform/consts';
  15. require 'lua/consts';
  16.  
  17. local comp_desc = get_components_description_player_edit()
  18.  
  19. -- Players with updated head models
  20. -- http://soccergaming.com/index.php?threads/list-of-all-new-faces-added-in-title-update-6-tutorial-to-enable-faces.6467431/
  21. local new_headmodels = {
  22. 169078,
  23. 184274,
  24. 190362,
  25. 192449,
  26. 199383,
  27. 200855,
  28. 201368,
  29. 202541,
  30. 204193,
  31. 206517,
  32. 210881,
  33. 212300,
  34. 216433,
  35. 220197,
  36. 221982,
  37. 225748,
  38. 225793,
  39. 226078,
  40. 226162,
  41. 227222,
  42. 231743,
  43. 232381,
  44. 239097,
  45. 240060,
  46. 249119,
  47. 249179,
  48. 53050,
  49. 116308,
  50. 152997,
  51. 156519,
  52. 156616,
  53. 163050,
  54. 164491,
  55. 167665,
  56. 167943,
  57. 169607,
  58. 172143,
  59. 176930,
  60. 177937,
  61. 179605,
  62. 180818,
  63. 182837,
  64. 182879,
  65. 183900,
  66. 186143,
  67. 188154,
  68. 188289,
  69. 189177,
  70. 189388,
  71. 190752,
  72. 192546,
  73. 193141,
  74. 193849,
  75. 199827,
  76. 200746,
  77. 200807,
  78. 201155,
  79. 201519,
  80. 204210,
  81. 204936,
  82. 207863,
  83. 208268,
  84. 208808,
  85. 210828,
  86. 210985,
  87. 212214,
  88. 213260,
  89. 214153,
  90. 214378,
  91. 215135,
  92. 215162,
  93. 218464,
  94. 218731,
  95. 219455,
  96. 219754,
  97. 219806,
  98. 219914,
  99. 221363,
  100. 222404,
  101. 223113,
  102. 223885,
  103. 225028,
  104. 225252,
  105. 225647,
  106. 225878,
  107. 226110,
  108. 226753,
  109. 226783,
  110. 226911,
  111. 226912,
  112. 226913,
  113. 226915,
  114. 226917,
  115. 226922,
  116. 226923,
  117. 226927,
  118. 226929,
  119. 227145,
  120. 228251,
  121. 228618,
  122. 228687,
  123. 229582,
  124. 230613,
  125. 231292,
  126. 231478,
  127. 231507,
  128. 231979,
  129. 232363,
  130. 232757,
  131. 232758,
  132. 234236,
  133. 234906,
  134. 235569,
  135. 235889,
  136. 236401,
  137. 236441,
  138. 237604,
  139. 238067,
  140. 239380,
  141. 241461,
  142. 241711,
  143. 242444,
  144. 242491,
  145. 243249,
  146. 243812,
  147. 246104,
  148. 251804,
  149. 173434,
  150. 177896,
  151. 186116,
  152. 189099,
  153. 192317,
  154. 198904,
  155. 202017,
  156. 206152,
  157. 207935,
  158. 209660,
  159. 211382,
  160. 213591,
  161. 214659,
  162. 217710,
  163. 218208,
  164. 219841,
  165. 220702,
  166. 222994,
  167. 227394,
  168. 227678,
  169. 239322,
  170. 239454,
  171. 239461,
  172. 242479,
  173. 244288,
  174. 245725,
  175. 249224
  176. }
  177.  
  178. function has_new(playerid)
  179. for j=1, #new_headmodels do
  180. if (new_headmodels[j] == playerid) then
  181. table.remove(new_headmodels, j)
  182. return true
  183. end
  184. end
  185. return false
  186. end
  187.  
  188. -- players table
  189. local sizeOf = 112 -- Size of one record in players database table
  190.  
  191. -- iterate over all players in 'players' database table
  192. local i = 0
  193. local current_playerid = 0
  194. local updated_players = 0
  195. while true do
  196. local playerid_record = ADDR_LIST.getMemoryRecordByID(CT_MEMORY_RECORDS['PLAYERID'])
  197. local current_playerid = bAnd(bShr(readInteger(string.format('[%s]+%X', 'firstPlayerDataPtr', playerid_record.getOffset(0)+(i*sizeOf))), playerid_record.Binary.Startbit), (bShl(1, playerid_record.Binary.Size) - 1))
  198. if current_playerid == 0 then
  199. break
  200. end
  201.  
  202. writeQword('playerDataPtr', readPointer('firstPlayerDataPtr') + i*sizeOf)
  203.  
  204. if has_new(current_playerid) then
  205. if (
  206. tonumber(ADDR_LIST.getMemoryRecordByID(comp_desc['HasHighQualityHeadCB']['id']).Value) ~= 1 or
  207. tonumber(ADDR_LIST.getMemoryRecordByID(comp_desc['HeadClassCodeEdit']['id']).Value) ~= 0 or
  208. tonumber(ADDR_LIST.getMemoryRecordByID(comp_desc['HeadAssetIDEdit']['id']).Value) ~= current_playerid
  209. ) then
  210. updated_players = updated_players + 1
  211. ADDR_LIST.getMemoryRecordByID(comp_desc['HasHighQualityHeadCB']['id']).Value = 1
  212. ADDR_LIST.getMemoryRecordByID(comp_desc['HeadClassCodeEdit']['id']).Value = 0
  213. ADDR_LIST.getMemoryRecordByID(comp_desc['HeadAssetIDEdit']['id']).Value = current_playerid
  214. end
  215. end
  216.  
  217. i = i + 1
  218. if i >= 26000 then
  219. break
  220. end
  221. end
  222.  
  223. showMessage(string.format("Done\nUpdated head models: %d", updated_players))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement