diff --git a/Auto Updater/Lib.lua b/Auto Updater/Lib.lua index ce94947..dd80dc1 100644 --- a/Auto Updater/Lib.lua +++ b/Auto Updater/Lib.lua @@ -1,4 +1,4 @@ -lib_version = "1.2.0" +lib_version = "1.2.1" local lib = { globals = {}, @@ -198,7 +198,7 @@ end function lib.globals.process_transaction(hash, amount) script.set_global_i(4537212 + 1, 2147483646) - script.set_global_i(4537212 + 7, int_max) + script.set_global_i(4537212 + 7, 2147483647) script.set_global_i(4537212 + 6, 0) script.set_global_i(4537212 + 5, 0) script.set_global_i(4537212 + 3, hash) @@ -211,7 +211,7 @@ function lib.globals.remove_money(value) end function lib.globals.add_money(value) - lib.globals.process_transaction(1633116913, value) + lib.globals.process_transaction(gameplay.get_hash_key("SERVICE_EARN_JUGGALO_STORY_MISSION"), value) end function lib.globals.chips_5k() @@ -258,11 +258,10 @@ local Script_Event = { ["teleport to interior"] = -1638522928, ["kick from organization"] = -11681548, ["destroy personal vehicle"] = 109434679, - ["Anarchy user"] = 418948324, ["teleport to warehouse"] = -1253241415, ["fake notification"] = -1773335296, ["bribe authorities"] = 3989788954, - ["collectibles"] = 18148138417, + ["collectibles"] = 968269233, } local Notification = { @@ -382,7 +381,6 @@ function lib.scriptevent.unblock_passive(pid) end function lib.scriptevent.set_bounty(pid, value, anonymous) - local anonymous if anonymous then anonymous = 1 else @@ -449,134 +447,72 @@ function lib.scriptevent.kick_from_interior(pid) end function lib.scriptevent.notif_1(pid) - local notif = {1964206081, 1685756725, 1920532265, -2088366475, -1362893813, -2045676423, 270407371, -185190021, 2092359122, -1279215969, -1117941225, -267741801, 1141680977, 94410750, -295926414, -242911964, -1374270823, 2087589787, 1498778633, -2023231970, -46427861, -1707786097, -537443435, 1657385274, 654590235, 1269083963, 2132210459, -631514137, 67449837, 1992801007, 2115283476, -1369501940, 700755157, -1110346671, -1147871280, 1286242155, 566326167, 1562851728, 1698144520, 175357111, -1178382538, 519603574, 25909718, -1569748362, -537988351, -52851778, -589496483, -1297578857, 1206358365, 1267106989, -659682088, 211288551, -506771808, -1528989704, 162649603, 1549986304, 1156367985, 1745717132, -1774258313, -123622067, 595566634, 333252100, -915107409, -185531943, -1397371731, -2067421797, 2122635939, 1294354544, 2076814537, 1653008132, -1957780196, -424891290, 1919354072, -1624215847, -1862640534, -953119221, 1537935777, 726383212, 1892011737, -908435400, 253112446, -804372901, -1269736344, -1496102984, 1242824391, -1655353383, 1481401191, -232274478, -1190864176, -484919611, 1851947159, -364374038, 387266354, 1873087566, -1825342546, 357634101, -1532850163, -1027120231, -1349748149, -263823283, -220827101, 244166737, -2145992078, 1478734661, -469990501, -336031718, 141644746, -512168382, 108239599, 2002419216, 1328709869, 89161948, -136196471, 438579306, -266556338, -62711246, 992057563, -274941786, -920137029, -1224230215, -30226546, -2070880806, 1999203482, 660101052, -1365920592, 87330564, -1854450559, 508279757, 1771687713, -1791283050, -2122605143, 692289645, 633054128, -729642880, -555185917, -1079941038, -578453253, 1590597533, -1209401092, 1840946429, 2073500011, -1496350145, 1119717573, -798284174, 688031806, -1853142904, -180954442, 1063231237, 611829658, -416870648, 466505354, -154142402, 509575003, -994541138, -466069025, 1879493586, -246319824, 514341487, 1601625667, -1995714668, -196790853, -657909624, 65771285, -1612031558, -749778730, 1511668108, 1588930412, -721023931, 1102524542, -1871052553, 110435988, 49800390, 1603709302, 1010866129, -1294527261, -1235125723, 1566953145, -753304341, -376947579, -264328576, -1135093486, -1233120647, 677413145, -690370280} + local notif = {1964206081, 1685756725, 1920532265, -2088366475, -1362893813, -2045676423, 270407371, -185190021, 2092359122, -1279215969, -1117941225, -267741801, 1141680977, 94410750, -295926414, + -242911964, -1374270823, 2087589787, 1498778633, -2023231970, -46427861, -1707786097, -537443435, 1657385274, 654590235, 1269083963, 2132210459, -631514137, 67449837, 1992801007, 2115283476, -1369501940, + 700755157, -1110346671, -1147871280, 1286242155, 566326167, 1562851728, 1698144520, 175357111, -1178382538, 519603574, 25909718, -1569748362, -537988351, -52851778, -589496483, -1297578857, 1206358365, + 1267106989, -659682088, 211288551, -506771808, -1528989704, 162649603, 1549986304, 1156367985, 1745717132, -1774258313, -123622067, 595566634, 333252100, -915107409, -185531943, -1397371731, -2067421797, + 2122635939, 1294354544, 2076814537, 1653008132, -1957780196, -424891290, 1919354072, -1624215847, -1862640534, -953119221, 1537935777, 726383212, 1892011737, -908435400, 253112446, -804372901, -1269736344, + -1496102984, 1242824391, -1655353383, 1481401191, -232274478, -1190864176, -484919611, 1851947159, -364374038, 387266354, 1873087566, -1825342546, 357634101, -1532850163, -1027120231, -1349748149, -263823283, + -220827101, 244166737, -2145992078, 1478734661, -469990501, -336031718, 141644746, -512168382, 108239599, 2002419216, 1328709869, 89161948, -136196471, 438579306, -266556338, -62711246, 992057563, -274941786, + -920137029, -1224230215, -30226546, -2070880806, 1999203482, 660101052, -1365920592, 87330564, -1854450559, 508279757, 1771687713, -1791283050, -2122605143, 692289645, 633054128, -729642880, -555185917, + -1079941038, -578453253, 1590597533, -1209401092, 1840946429, 2073500011, -1496350145, 1119717573, -798284174, 688031806, -1853142904, -180954442, 1063231237, 611829658, -416870648, 466505354, -154142402, + 509575003, -994541138, -466069025, 1879493586, -246319824, 514341487, 1601625667, -1995714668, -196790853, -657909624, 65771285, -1612031558, -749778730, 1511668108, 1588930412, -721023931, 1102524542, + -1871052553, 110435988, 49800390, 1603709302, 1010866129, -1294527261, -1235125723, 1566953145, -753304341, -376947579, -264328576, -1135093486, -1233120647, 677413145, -690370280} lib.essentials.send_script_event(pid, Script_Event["notification"], player.player_id(), 0, notif[math.random(1, #notif)], math.random(int_min, int_max), 1, 0, 0, 0, 0, 0, pid, player.player_id(), pid, 0) end -function lib.scriptevent.movie_props(pid) - for i = 0, 9 do - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, 0, i, 1, 1, 1) - end -end - -function lib.scriptevent.hidden_caches(pid) - for i = 0, 9 do - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, 1, i, 1, 1, 1) - end -end - -function lib.scriptevent.treasure_chests(pid) - for i = 0, 1 do - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, 2, i, 1, 1, 1) - end -end - -function lib.scriptevent.radio_antennas(pid) - for i = 0, 9 do - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, 3, i, 1, 1, 1) - end -end - -function lib.scriptevent.media_usb(pid) - for i = 0, 19 do - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, 4, i, 1, 1, 1) - end -end - -function lib.scriptevent.shipwrecks(pid) - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, 5, 0, 1, 1, 1) -end - -function lib.scriptevent.buried_stashes(pid) - for i = 0, 1 do - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, 6, i, 1, 1, 1) - end -end - -function lib.scriptevent.halloween_tshirt(pid) - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, 7, 0, 1, 1, 1) -end - -function lib.scriptevent.jack_o_lanterns(pid) - for i = 0, 9 do - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, 8, i, 1, 1, 1) - end -end - -function lib.scriptevent.ld_organics_merchandise(pid) - for i = 0, 99 do - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, 9, i, 1, 1, 1) - end -end - -function lib.scriptevent.junk_energy_skydives(pid) - for i = 0, 9 do - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, 10, i, 1, 1, 1) - end -end - -function lib.scriptevent.snowmen(pid) - for i = 0, 24 do - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, 16, i, 1, 1, 1) - end -end - -function lib.scriptevent.g_s_cache(pid) - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, 17, 0, 1, 1, 1) -end - -function lib.scriptevent.all_collectibles(pid) - for a = 0, 20 do - for b = 0, 99 do - lib.essentials.send_script_event(pid, Script_Event["collectibles"], 0, a, b, 1, 1, 1) +function lib.scriptevent.give_collectibles(pid, mode) + if mode == "Movie Props" then + for i = 0, 9 do + lib.essentials.send_script_event(pid, Script_Event["collectibles"], player.player_id(), 0, 0, i, 1, 1, 1) end + elseif mode == "Hidden Caches" then + for i = 0, 9 do + lib.essentials.send_script_event(pid, Script_Event["collectibles"], player.player_id(), 0, 1, i, 1, 1, 1) + end + elseif mode == "Treasure Chests" then + for i = 0, 1 do + lib.essentials.send_script_event(pid, Script_Event["collectibles"], player.player_id(), 0, 2, i, 1, 1, 1) + end + elseif mode == "Radio Antennas" then + for i = 0, 9 do + lib.essentials.send_script_event(pid, Script_Event["collectibles"], player.player_id(), 0, 3, i, 1, 1, 1) + end + elseif mode == "Media USBs" then + for i = 0, 19 do + lib.essentials.send_script_event(pid, Script_Event["collectibles"], player.player_id(), 0, 4, i, 1, 1, 1) + end + elseif mode == "Shipwrecks" then + for i = 0, 6 do + lib.essentials.send_script_event(pid, Script_Event["collectibles"], player.player_id(), 0, 5, i, 1, 1, 1) + end + elseif mode == "Buried Stashes" then + for i = 0, 9 do + lib.essentials.send_script_event(pid, Script_Event["collectibles"], player.player_id(), 0, 6, i, 1, 1, 1) + end + elseif mode == "Halloween Tshirt" then + lib.essentials.send_script_event(pid, Script_Event["collectibles"], player.player_id(), 0, 7, 0, 1, 1, 1) + elseif mode == "Jack O' Lanterns" then + for i = 0, 9 do + lib.essentials.send_script_event(pid, Script_Event["collectibles"], player.player_id(), 0, 8, i, 1, 1, 1) + end + elseif mode == "LD Organics Merchandise" then + for i = 0, 99 do + lib.essentials.send_script_event(pid, Script_Event["collectibles"], player.player_id(), 0, 9, i, 1, 1, 1) + end + elseif mode == "Junk Energy Skydives" then + for i = 0, 9 do + lib.essentials.send_script_event(pid, Script_Event["collectibles"], player.player_id(), 0, 10, i, 1, 1, 1) + end + elseif mode == "Snowmen" then + for i = 0, 24 do + lib.essentials.send_script_event(pid, Script_Event["collectibles"], player.player_id(), 0, 16, i, 1, 1, 1) + end + elseif mode == "G's Cache" then + lib.essentials.send_script_event(pid, Script_Event["collectibles"], player.player_id(), 0, 17, 0, 1, 1, 1) end end -function lib.scriptevent.random(pid) - local random_int = math.random(1, 10) - if random_int == 1 then - lib.essentials.send_script_event(pid, math.random(int_min, int_max), player.player_id(), 0, math.random(int_min, int_max), math.random(int_min, int_max)) - elseif random_int == 2 then - lib.essentials.send_script_event(pid, math.random(int_min, int_max), player.player_id(), 0) - elseif random_int == 3 then - lib.essentials.send_script_event(pid, math.random(int_min, int_max), player.player_id(), 0, math.random(0, 100)) - elseif random_int == 4 then - lib.essentials.send_script_event(pid, math.random(int_min, int_max), player.player_id(), 0, 0, 0, 0, 0, math.random(int_min, int_max), 0, 0) - elseif random_int == 5 then - lib.essentials.send_script_event(pid, math.random(int_min, int_max), player.player_id(), 0, math.random(int_min, int_max), 0, 0, 0, math.random(int_min, int_max), 0, 0) - elseif random_int == 6 then - lib.essentials.send_script_event(pid, math.random(int_min, int_max), player.player_id(), 0, math.random(int_min, int_max), 0) - elseif random_int == 7 then - lib.essentials.send_script_event(pid, math.random(int_min, int_max), player.player_id(), 0, math.random(int_min, int_max), 0, math.random(0, 5), 0) - elseif random_int == 8 then - lib.essentials.send_script_event(pid, math.random(int_min, int_max), player.player_id(), 0, math.random(int_min, int_max), 0, math.random(0, 100), 0, math.random(0, 99999)) - elseif random_int == 9 then - lib.essentials.send_script_event(pid, math.random(int_min, int_max), player.player_id(), 0, 0, math.random(0, 100), math.random(0, 100), 0, math.random(int_min, int_max), 0, math.random(0, 5)) - elseif random_int == 10 then - lib.essentials.send_script_event(pid, math.random(int_min, int_max), player.player_id(), 0, 0, math.random(int_min, int_max), math.random(0, 100), 0, 1, 0, math.random(int_min, int_max)) - end -end - -function lib.scriptevent.lag(pid) - local random = math.random(int_min, int_max) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) - lib.essentials.send_script_event_no_wait(pid, random, player.player_id(), 0, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random, random) -end - --PPPPPPPPPPPPPPPPP lllllll --P::::::::::::::::P l:::::l --P::::::PPPPPP:::::P l:::::l @@ -827,11 +763,10 @@ function lib.player.list(include_me) end function lib.player.get_player_name(pid) - local name = player.get_player_name(pid) - if name == nil then - return "Unknown" + if pid and player.is_player_valid(pid) then + return player.get_player_name(pid) else - return name + return "Unknown_Player" end end @@ -1113,7 +1048,7 @@ function lib.entity.get_seat_ped_is_in(Ped) end function lib.entity.get_hash_offset_dimension(hash) - local dim = lib.entity.spawn_entity(hash, v3(8000, 8000, -1000), 0, false, true, false, true, false, false) + local dim = lib.entity.spawn_entity(hash, v3(10000, 10000, 2600), 0, false, true, false, true, false, false) local min_dim, max_dim = entity.get_entity_model_dimensions(dim) entity.delete_entity(dim) lib.essentials.table_remove(anarchy_spawned_entity, Entity) @@ -1122,15 +1057,15 @@ end function lib.entity.fix_vehicle(Vehicle) fire.stop_entity_fire(Vehicle) - vehicle.set_vehicle_fixed(Vehicle) + lib.natives.REMOVE_DECALS_FROM_VEHICLE(Vehicle) + lib.natives.SET_ENTITY_RENDER_SCORCHED(Vehicle, false) lib.natives.SET_VEHICLE_BODY_HEALTH(Vehicle, 1000) - vehicle.set_vehicle_engine_health(Vehicle, 1000) + lib.natives.SET_VEHICLE_DIRT_LEVEL(Vehicle, 0) lib.natives.SET_VEHICLE_PETROL_TANK_HEALTH(Vehicle, 1000) vehicle.set_vehicle_deformation_fixed(Vehicle) - lib.natives.SET_VEHICLE_DIRT_LEVEL(Vehicle, 0) + vehicle.set_vehicle_engine_health(Vehicle, 1000) + vehicle.set_vehicle_fixed(Vehicle) vehicle.set_vehicle_undriveable(Vehicle, false) - lib.natives.SET_ENTITY_RENDER_SCORCHED(Vehicle, false) - lib.natives.REMOVE_DECALS_FROM_VEHICLE(Vehicle) end function lib.entity.clone_vehicle(Vehicle, pos, dir) @@ -1235,7 +1170,7 @@ do vehicle.set_vehicle_custom_secondary_colour(Entity, lib.essentials.random_rgb()) vehicle.set_vehicle_custom_pearlescent_colour(Entity, lib.essentials.get_rgb(0, 0, 0, 0)) vehicle.set_vehicle_custom_wheel_colour(Entity, lib.essentials.random_rgb()) - if not streaming.is_model_a_heli(entity.get_entity_model_hash(Entity)) then + if not streaming.is_model_a_heli(entity.get_entity_model_hash(Entity)) and not streaming.is_model_a_plane(entity.get_entity_model_hash(Entity)) then for extra = 1, 14 do if vehicle.does_extra_exist(Entity, extra) then vehicle.set_vehicle_extra(Entity, extra, false) @@ -1553,6 +1488,34 @@ end --E::::::::::::::::::::E s:::::::::::ss s:::::::::::ss ee:::::::::::::e n::::n n::::n tt:::::::::::tti::::::i a::::::::::aa:::al::::::l s:::::::::::ss --EEEEEEEEEEEEEEEEEEEEEE sssssssssss sssssssssss eeeeeeeeeeeeee nnnnnn nnnnnn ttttttttttt iiiiiiii aaaaaaaaaa aaaallllllll sssssssssss +function lib.essentials.input(title, default, len, input_type, feat, min_value, max_value) + local input_response, input_val + repeat + input_response, input_val = input.get(title, default, len, input_type) + system.wait() + until input_response ~= 1 + if not input_val or input_response == 2 then + feat.on = false + lua_notify_alert("Input canceled.", feat.name) + return false + else + if input_type == 3 or input_type == 5 then + input_val = tonumber(input_val) + if input_val > max_value then + input_val = max_value + elseif input_val < min_value then + input_val = min_value + end + return input_val + end + return input_val + end +end + +function lib.essentials.distance_between(pos1, pos2) + return pos1:magnitude(pos2) +end + function lib.essentials.verif_timestamp_for_table(tbl, source) system.wait(500) for i = #tbl, 1, -1 do @@ -117919,7 +117882,6 @@ do "ufo_eye", "ufo_lod", "ufo", - "unknown_object_name", "urbandryfrnds_01", "urbandrygrass_01", "urbangrnfrnds_01",