Advertisement
_Sebastian_

MBAC scripts (c)

Jan 4th, 2018
1,512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 19.81 KB | None | 0 0
  1. #MBAC begin
  2. from module_items import items
  3.  
  4. attack_dir_caps = [
  5. #down
  6.   itcf_thrust_onehanded|
  7.   itcf_thrust_twohanded|
  8.   itcf_thrust_polearm|
  9.   itcf_horseback_thrust_onehanded|
  10.   itcf_thrust_onehanded_lance|
  11.   itcf_thrust_onehanded_lance_horseback|
  12.   itcf_thrust_musket,
  13. #up
  14.   itcf_overswing_onehanded|
  15.   itcf_overswing_twohanded|
  16.   itcf_overswing_polearm|
  17.   itcf_horseback_overswing_right_onehanded|
  18.   itcf_horseback_overswing_left_onehanded|
  19.   itcf_overswing_spear|
  20.   itcf_overswing_musket,
  21. #right
  22.   itcf_slashright_onehanded|
  23.   itcf_slashright_twohanded|
  24.   itcf_slashright_polearm|
  25.   itcf_horseback_slashright_onehanded|
  26.   itcf_horseback_slash_polearm,
  27. #left
  28.   itcf_slashleft_onehanded|
  29.   itcf_slashleft_twohanded|
  30.   itcf_slashleft_polearm|
  31.   itcf_horseback_slashleft_onehanded|
  32.   itcf_horseback_slash_polearm
  33. ]
  34.  
  35. def mbac_pre_init():
  36.   objects = []
  37.   for i in xrange(num_hacks):
  38.     objects.append((troop_set_slot, i, slot_troop_enable_anti_cheat, hack_detection[i]))
  39.     objects.append((troop_set_slot, i, slot_troop_hack_percentage, hack_percentage[i]))
  40.     objects.append((troop_set_slot, i, slot_troop_hack_consequence, hack_consequence[i]))
  41.     objects.append((troop_set_slot, i, slot_troop_hack_warn_threshold, hack_warn_threshold[i]))
  42.   for i in xrange(len(attack_dir_caps)):
  43.     objects.append((troop_set_slot, i, slot_troop_item_attack_dir_caps, attack_dir_caps[i]))
  44.   return objects[:]
  45.  
  46. scripts += [
  47.   ("mbac_pre_init", mbac_pre_init()),
  48.  
  49.   ("mbac_init", [
  50.     (call_script, "script_mbac_pre_init"),
  51.  
  52.     (assign, "$first_player_joined", 0),
  53.  
  54.     (assign, "$advanced_logging", 1),#logs plenty of data for later parameter fine-tuning
  55.     (assign, "$player_join_message", 1),#sends the joining player a message that this server is unsing anti cheat
  56.     (assign, "$broadcast_hack_warnings", msg_admins),
  57.     (assign, "$broadcast_hack_consequences", msg_players),
  58.  
  59.     (assign, "$hack_check_period", 30000),#miliseconds
  60.     (assign, "$warnings_til_consequences", 3),#warnings til consequence
  61.  
  62.     #check for attack directions
  63.     (try_for_range, ":item", 0, len(items)),
  64.       (item_get_type, ":item_type", ":item"),
  65.       (is_between, ":item_type", itp_type_one_handed_wpn, itp_type_arrows),
  66.       (assign, ":num_attacks", 0),
  67.       (try_for_range, ":i", 0, 4),
  68.         (troop_get_slot, ":capability", ":i", slot_troop_item_attack_dir_caps),
  69.         (item_has_capability, ":item", ":capability"),
  70.         (val_add, ":num_attacks", 1),
  71.       (try_end),
  72.       (item_set_slot, ":item", slot_item_num_attacks, ":num_attacks"),
  73.     (try_end),
  74.   ]),
  75.  
  76.   ("cf_mbac_console_command", [
  77.     (store_script_param, ":command", 1),
  78.     (store_script_param, ":value", 2),
  79.  
  80.     #reuse class limiter commands and values
  81.     (val_sub, ":command", 66),
  82.     (val_sub, ":value", 102),#allows for -1
  83.  
  84.     (str_clear, s0),
  85.     (try_begin),
  86.       (eq, ":command", cmd_advanced_logging),
  87.       (is_between, ":value", 0, 2),
  88.       (assign, "$advanced_logging", ":value"),
  89.  
  90.       (store_add, ":string", "str_hack_option_0", ":value"),
  91.       (str_store_string, s1, ":string"),
  92.       (str_store_string, s0, "@Advanced logging {s1}"),
  93.  
  94.     (else_try),
  95.       (eq, ":command", cmd_player_join_message),
  96.       (is_between, ":value", 0, 2),
  97.       (assign, "$player_join_message", ":value"),
  98.  
  99.       (store_add, ":string", "str_hack_option_0", ":value"),
  100.       (str_store_string, s1, ":string"),
  101.       (str_store_string, s0, "@Player join message {s1}"),
  102.  
  103.     (else_try),
  104.       (eq, ":command", cmd_broadcast_hack_warnings),
  105.       (is_between, ":value", -1, 2),
  106.       (assign, "$broadcast_hack_warnings", ":value"),
  107.  
  108.       (store_add, ":string", "str_hack_broadcast_option_0", ":value"),
  109.       (str_store_string, s1, ":string"),
  110.       (str_store_string, s0, "@Hack-warning message set to {s1}"),
  111.  
  112.     (else_try),
  113.       (eq, ":command", cmd_broadcast_hack_consequences),
  114.       (is_between, ":value", -1, 2),
  115.       (assign, "$broadcast_hack_consequences", ":value"),
  116.  
  117.       (store_add, ":string", "str_hack_broadcast_option_0", ":value"),
  118.       (str_store_string, s1, ":string"),
  119.       (str_store_string, s0, "@Hack-consequences message set to {s1}"),
  120.  
  121.     (else_try),
  122.       (is_between, ":command", cmd_hacks_option, cmd_hacks_consequence),
  123.       (is_between, ":value", 0, 2),
  124.       (val_sub, ":command", cmd_hacks_option),
  125.       (troop_set_slot, ":command", slot_troop_enable_anti_cheat, ":value"),
  126.  
  127.       (store_add, ":string", "str_hack_option_0", ":value"),
  128.       (str_store_string, s1, ":string"),
  129.       (store_add, ":string", "str_hack_0", ":command"),
  130.       (str_store_string, s2, ":string"),
  131.       (str_store_string, s0, "@{s2} detection {s1}"),
  132.  
  133.     (else_try),
  134.       (is_between, ":command", cmd_hacks_consequence, cmd_end),
  135.       (is_between, ":value", -1, 3),
  136.       (val_sub, ":command", cmd_hacks_consequence),
  137.       (troop_set_slot, ":command", slot_troop_hack_consequence, ":value"),
  138.  
  139.       (store_add, ":string", "str_hack_consequence_option_0", ":value"),
  140.       (str_store_string, s1, ":string"),
  141.       (store_add, ":string", "str_hack_0", ":command"),
  142.       (str_store_string, s2, ":string"),
  143.       (str_store_string, s0, "@{s2} hack consequence set to {s1}"),
  144.     (try_end),
  145.  
  146.     (neg|str_is_empty, s0),
  147.   ]),
  148.  
  149.   ("mbac_init_player", [
  150.     (store_script_param, ":player", 1),
  151.  
  152.     (try_for_range, ":slot", slot_player_unblockable_warnings, slot_player_unblockable_warnings + num_hacks),
  153.       (player_set_slot, ":player", ":slot", 0),
  154.     (try_end),
  155.   ]),
  156.  
  157.   ("mbac_set_up_message", [
  158.     (store_script_param, ":msg_type", 1),
  159.  
  160.     (try_begin),
  161.       (neq, ":msg_type", msg_log_only),
  162.       (try_for_players, ":player", "$is_dedi"),
  163.         (try_begin),
  164.           (eq, ":msg_type", msg_players),
  165.           (multiplayer_send_string_to_player, ":player", multiplayer_event_show_server_message, s0),
  166.         (else_try),
  167.           (player_is_admin, ":player"),
  168.           (multiplayer_send_string_to_player, ":player", multiplayer_event_show_server_message, s0),
  169.         (try_end),
  170.       (try_end),
  171.     (try_end),
  172.  
  173.     #logging
  174.     (assign, reg61, mbac_v_maj),
  175.     (assign, reg62, mbac_v_min),
  176.     (assign, reg63, mbac_v_rev),
  177.     (str_store_string, s0, "@[MBAC v{reg61}.{reg62}.{reg63}]: {s0}"),
  178.     (try_begin),
  179.       (eq, "$is_dedi", 1),
  180.       (server_add_message_to_log, s0),
  181.     (else_try),
  182.       (display_message, s0),
  183.     (try_end),
  184.   ]),
  185.  
  186.   ("mbac_hack_consequence", [
  187.     (store_script_param, ":player", 1),
  188.  
  189.     (assign, ":hack_consequence", con_message),
  190.     (assign, ":hack_count", 0),
  191.     (try_for_range, ":i", 0, num_hacks),
  192.       (store_add, ":slot", slot_player_unblockable_warnings, ":i"),
  193.       (player_slot_ge, ":player", ":slot", "$warnings_til_consequences"),
  194.       (val_add, ":hack_count", 1),
  195.       (store_add, ":string", "str_hack_0", ":i"),
  196.       (try_begin),
  197.         (eq, ":hack_count", 1),
  198.         (str_store_string, s0, ":string"),
  199.       (else_try),
  200.         (str_store_string, s1, ":string"),
  201.         (str_store_string, s0, "@{s0}, {s1}"),
  202.       (try_end),
  203.  
  204.       (troop_get_slot, ":cur_consequence", ":i", slot_troop_hack_consequence),
  205.       (gt, ":cur_consequence", con_message),
  206.       (try_begin),
  207.         (eq, ":hack_consequence", con_message),
  208.         (assign, ":hack_consequence", ":cur_consequence"),
  209.       (else_try),#check for consequence hierarchy
  210.         (lt, ":cur_consequence", ":hack_consequence"),
  211.         (assign, ":hack_consequence", ":cur_consequence"),
  212.       (try_end),
  213.     (try_end),
  214.  
  215.     (store_add, ":string", "str_hack_consequence_0", ":hack_consequence"),
  216.     (str_store_string, s1, ":string"),
  217.     (str_store_string, s0, "@got {s1} for using cheats({s0})"),
  218.  
  219.     (str_store_player_username, s1, ":player"),
  220.     (player_get_unique_id, reg0, ":player"),
  221.     (str_store_string, s0, "@Player {s1} with UID {reg0} {s0}"),
  222.  
  223.     (call_script, "script_mbac_set_up_message", "$broadcast_hack_consequences"),
  224.  
  225.     (try_begin),#notification only
  226.       (this_or_next|player_is_admin, ":player"),
  227.       (eq, ":hack_consequence", con_message),
  228.       (call_script, "script_mbac_init_player", ":player"),
  229.     (else_try),#ban
  230.       (is_between, ":hack_consequence", con_perma_ban, con_temp_ban + 1),
  231.       (ban_player, ":player", ":hack_consequence", 0),
  232.       (save_ban_info_of_player, ":player"),
  233.     (else_try),#kick
  234.       (kick_player, ":player"),
  235.     (try_end),
  236.   ]),
  237.  
  238.   ("cf_mbac_ti_player_joined", [
  239.     (store_trigger_param, ":player", 1),
  240.    
  241.     (call_script, "script_mbac_init_player", ":player"),
  242.     (try_begin),
  243.       (eq, "$player_join_message", 1),
  244.       (this_or_next|eq, "$first_player_joined", 0),
  245.       (player_slot_ge, ":player", slot_player_join_time, 5),#not on map change
  246.  
  247.       (assign, reg0, mbac_v_maj),
  248.       (assign, reg1, mbac_v_min),
  249.       (assign, reg2, mbac_v_rev),
  250.       (str_store_string, s0, "@This server is using MB Anti Cheat v{reg0}.{reg1}.{reg2}"),
  251.       (multiplayer_send_string_to_player, ":player", multiplayer_event_show_server_message, s0),
  252.     (try_end),
  253.  
  254.     (eq, "$first_player_joined", 0),
  255.     (assign, "$first_player_joined", 1),
  256.   ]),
  257.  
  258.   ("cf_mbac_ti_mission_end", [
  259.     (multiplayer_is_server),
  260.     (try_for_players, ":player", "$is_dedi"),
  261.       (call_script, "script_mbac_init_player", ":player"),
  262.     (try_end),
  263.   ]),
  264.  
  265.   ("cf_mbac_ti_agent_spawn", [
  266.     (store_trigger_param, ":agent", 1),
  267.  
  268.     (agent_is_human, ":agent"),
  269.     (store_mission_timer_a_msec, ":time"),
  270.     (store_random_in_range, ":check_time", 0, 100),#randomize check time within 0.1 sec
  271.     (val_add, ":check_time", ":time"),
  272.     (agent_set_slot, ":agent", slot_agent_tick_check_time, ":check_time"),
  273.     (agent_set_slot, ":agent", slot_agent_defend_dir, -1),
  274.  
  275.     (neg|agent_is_non_player, ":agent"),#only players
  276.     (store_random_in_range, ":check_time", 0, "$hack_check_period"),#randomize reset time
  277.     (val_add, ":check_time", ":time"),
  278.     (agent_set_slot, ":agent", slot_agent_period_reset_time, ":check_time"),
  279.   ]),
  280.  
  281.   ("cf_mbac_ti_agent_hit", [
  282.     (store_trigger_param, ":v_agent", 1),
  283.     (store_trigger_param, ":d_agent", 2),
  284.     (store_trigger_param, ":v_bone", 4),
  285.     (assign, ":d_item", reg0),
  286.  
  287.     (neg|agent_is_non_player, ":d_agent"),
  288.     (agent_is_human, ":v_agent"),
  289.  
  290.     (neq, ":d_item", -1),
  291.     (item_get_type, ":item_type", ":d_item"),
  292.  
  293.     (try_begin),#melee
  294.       (is_between, ":item_type", itp_type_one_handed_wpn, itp_type_arrows),
  295.       #unblockable detection
  296.       (try_begin),
  297.         (troop_slot_eq, hack_unblockable, slot_troop_enable_anti_cheat, 1),
  298.  
  299.         (agent_get_slot, ":hits", ":d_agent", slot_agent_period_melee_hits),
  300.         (val_add, ":hits", 1),
  301.         (agent_set_slot, ":d_agent", slot_agent_period_melee_hits, ":hits"),
  302.  
  303.         (item_get_slot, ":num_attacks", ":d_item", slot_item_num_attacks),
  304.         (is_between, ":num_attacks", 1, 4),#exclude melee weapons with no, or 4 valid attack directions
  305.         (agent_get_defend_action, ":defend_action", ":v_agent"), #returned values: free = 0, parrying = 1, blocking = 2
  306.         (neq, ":defend_action", 0),
  307.  
  308.         (agent_get_action_dir, ":v_dir", ":v_agent"), #invalid = -1, down = 0, right = 1, left = 2, up = 3
  309.         (agent_get_action_dir, ":d_dir", ":d_agent"), #invalid = -1, down = 0, right = 1, left = 2, up = 3
  310.         (eq, ":v_dir", ":d_dir"),
  311.  
  312.         (agent_get_slot, ":defend_ticks", ":v_agent", slot_agent_defend_ticks),
  313.         (gt, ":defend_ticks", 1),
  314.  
  315.         (agent_get_animation, ":v_anim", ":v_agent", 0),
  316.         (neq, ":v_anim", "anim_kick_right_leg"),
  317.  
  318.         (assign, ":crush_check", 1),
  319.         (try_begin),
  320.           (eq, ":d_dir", 3),
  321.           (item_has_property, ":d_item", itp_crush_through),
  322.           (assign, ":crush_check", 0),
  323.         (try_end),
  324.         (eq, ":crush_check", 1),
  325.  
  326.         (agent_get_position, pos1, ":v_agent"),
  327.         (agent_get_position, pos2, ":d_agent"),
  328.         (neg|position_is_behind_position, pos2, pos1),
  329.  
  330.         (set_fixed_point_multiplier, 1),
  331.         (get_angle_between_positions, ":angle", pos1, pos2),
  332.         (set_fixed_point_multiplier, 100),
  333.  
  334.         (val_abs, ":angle"),# 180 = face to face
  335.         (gt, ":angle", 105),
  336.  
  337.         (agent_get_slot, ":hits", ":d_agent", slot_agent_period_unblocks),
  338.         (val_add, ":hits", 1),
  339.         (agent_set_slot, ":d_agent", slot_agent_period_unblocks, ":hits"),
  340.  
  341.         # (set_trigger_result, 0),
  342.  
  343.         #logging
  344.         (try_begin),
  345.           (eq, "$advanced_logging", 1),
  346.           (agent_get_player_id, ":player", ":d_agent"),
  347.           (str_store_player_username, s0, ":player"),
  348.           (player_get_unique_id, reg1, ":player"),
  349.           (assign, reg2, ":hits"),
  350.           (assign, reg3, ":angle"),
  351.           (get_distance_between_positions, reg4, pos1, pos2),
  352.           (assign, reg5, ":defend_action"),
  353.           (assign, reg6, ":v_dir"),
  354.           (assign, reg7, ":num_attacks"),
  355.           (assign, reg8, ":defend_ticks"),
  356.           (str_store_string, s0, "@Player:{s0} UID:{reg1} [period_unblocks({reg2}) angle({reg3}) dist({reg4}) defend({reg5}) dir({reg6}) num_att({reg7}) def_ticks({reg8})]"),
  357.           (call_script, "script_mbac_set_up_message", msg_log_only),
  358.         (try_end),
  359.       (try_end),
  360.  
  361.     (else_try),#ranged
  362.       (troop_slot_eq, hack_aimbot, slot_troop_enable_anti_cheat, 1),
  363.  
  364.       (agent_get_slot, ":hits", ":d_agent", slot_agent_period_ranged_hits),
  365.       (val_add, ":hits", 1),
  366.       (agent_set_slot, ":d_agent", slot_agent_period_ranged_hits, ":hits"),
  367.  
  368.       (eq, ":v_bone", 9),#head
  369.       (agent_get_slot, ":hits", ":d_agent", slot_agent_period_head_shots),
  370.       (val_add, ":hits", 1),
  371.       (agent_set_slot, ":d_agent", slot_agent_period_head_shots, ":hits"),
  372.     (try_end),
  373.   ]),
  374.  
  375.   ("cf_mbac_ti_once", [
  376.     (multiplayer_is_server),
  377.     (try_begin),
  378.       (multiplayer_is_dedicated_server),
  379.       (assign, "$is_dedi", 1),
  380.     (else_try),
  381.       (assign, "$is_dedi", 0),
  382.     (try_end),
  383.   ]),
  384.  
  385.   ("cf_mbac_ti_each_frame", [
  386.     (multiplayer_is_server),
  387.     (store_mission_timer_a_msec, ":time"),
  388.     (server_get_control_block_dir, ":cbd"),
  389.  
  390.     (try_for_agents, ":agent", 0, 0),
  391.       (agent_is_alive, ":agent"),
  392.       (agent_is_human, ":agent"),
  393.       (agent_get_slot, ":check_time", ":agent", slot_agent_tick_check_time),
  394.       (try_begin),
  395.         (ge, ":time", ":check_time"),#check agents in batches, splits the workload across as many frames as possible
  396.         (val_add, ":check_time", 100),
  397.         (agent_set_slot, ":agent", slot_agent_tick_check_time, ":check_time"),
  398.         (agent_get_defend_action, ":defend", ":agent"), #returned values: free = 0, parrying = 1, blocking = 2
  399.         (try_begin),
  400.           (eq, ":defend", 2),
  401.           (agent_get_action_dir, ":dir", ":agent"), #invalid = -1, down = 0, right = 1, left = 2, up = 3
  402.           (agent_set_slot, ":agent", slot_agent_defend_dir, ":dir"),
  403.           (agent_get_slot, ":ticks", ":agent", slot_agent_defend_ticks),
  404.           (val_add, ":ticks", 1),
  405.           (agent_set_slot, ":agent", slot_agent_defend_ticks, ":ticks"),
  406.           (try_begin),
  407.             (troop_slot_eq, hack_autoblock, slot_troop_enable_anti_cheat, 1),
  408.             (neg|agent_is_non_player, ":agent"),#only players
  409.  
  410.             (eq, ":ticks", 1),#count only once per block
  411.             (agent_get_slot, ":blocks", ":agent", slot_agent_period_blocks),
  412.             (val_add, ":blocks", 1),
  413.             (agent_set_slot, ":agent", slot_agent_period_blocks, ":blocks"),
  414.  
  415.             (eq, ":cbd", 1),#manual block enabled
  416.             (eq, ":dir", 0),#down
  417.             (agent_get_slot, ":blocks", ":agent", slot_agent_period_down_blocks),
  418.             (val_add, ":blocks", 1),
  419.             (agent_set_slot, ":agent", slot_agent_period_down_blocks, ":blocks"),
  420.           (try_end),
  421.         (else_try),
  422.           (agent_set_slot, ":agent", slot_agent_defend_dir, -1),
  423.           (agent_set_slot, ":agent", slot_agent_defend_ticks, 0),
  424.         (try_end),
  425.       (try_end),
  426.  
  427.       #check for hack consequences, reset period logs
  428.       (neg|agent_is_non_player, ":agent"),#only players
  429.       (agent_get_slot, ":check_time", ":agent", slot_agent_period_reset_time),
  430.       (ge, ":time", ":check_time"),#check agents in batches, splits the workload across as many frames as possible
  431.       (val_add, ":check_time", "$hack_check_period"),
  432.       (agent_set_slot, ":agent", slot_agent_period_reset_time, ":check_time"),
  433.  
  434.       (agent_get_player_id, ":player", ":agent"),
  435.       (assign, ":message", 0),
  436.  
  437.       (try_begin),
  438.         (eq, "$advanced_logging", 1),
  439.         (str_clear, s0),
  440.       (try_end),
  441.  
  442.       (try_for_range, ":i", 0, num_hacks),
  443.         (troop_slot_eq, ":i", slot_troop_enable_anti_cheat, 1),
  444.  
  445.         (store_add, ":slot", slot_agent_period_unblocks, ":i"),
  446.         (agent_get_slot, ":incidents", ":agent", ":slot"),
  447.         (agent_set_slot, ":agent", ":slot", 0),#reset
  448.  
  449.         (store_add, ":slot", slot_agent_period_melee_hits, ":i"),
  450.         (agent_get_slot, ":total", ":agent", ":slot"),
  451.         (agent_set_slot, ":agent", ":slot", 0),#reset
  452.  
  453.         (this_or_next|eq, "$advanced_logging", 1),
  454.         (neg|troop_slot_ge, ":i", slot_troop_hack_warn_threshold, ":incidents"),
  455.  
  456.         (try_begin),
  457.           (gt, ":total", 0),
  458.           (store_mul, ":cur_percentage", ":incidents", 100),
  459.           (val_div, ":cur_percentage", ":total"),
  460.         (else_try),
  461.           (assign, ":cur_percentage", 0),
  462.         (try_end),
  463.  
  464.         (try_begin),
  465.           (eq, "$advanced_logging", 1),
  466.           (neq, ":incidents", 0),
  467.           (assign, reg0, ":total"),
  468.           (assign, reg1, ":incidents"),
  469.           (assign, reg2, ":cur_percentage"),
  470.           (store_add, ":string", "str_hack_0_log", ":i"),
  471.           (str_store_string, s1, ":string"),
  472.           (str_store_string, s0, "@{s0}, {s1}"),
  473.         (try_end),
  474.  
  475.         (neg|troop_slot_ge, ":i", slot_troop_hack_warn_threshold, ":incidents"),
  476.         (neg|troop_slot_ge, ":i", slot_troop_hack_percentage, ":cur_percentage"),
  477.  
  478.         (store_add, ":slot", slot_player_unblockable_warnings, ":i"),
  479.         (player_get_slot, ":warnings", ":player", ":slot"),
  480.         (try_begin),
  481.           (lt, ":warnings", "$warnings_til_consequences"),
  482.           (val_add, ":warnings", 1),
  483.           (player_set_slot, ":player", ":slot", ":warnings"),
  484.           (try_begin),
  485.             (eq, ":warnings", "$warnings_til_consequences"),
  486.             (assign, ":message", 2),
  487.           (else_try),
  488.             (neq, ":message", 2),
  489.             (assign, ":message", 1),
  490.           (try_end),
  491.         (else_try),
  492.           (assign, ":message", 2),
  493.         (try_end),
  494.       (try_end),
  495.  
  496.       (try_begin),
  497.         (this_or_next|eq, "$advanced_logging", 1),
  498.         (eq, ":message", 1),
  499.         (str_store_player_username, s1, ":player"),
  500.         (player_get_unique_id, reg0, ":player"),
  501.       (try_end),
  502.  
  503.       (try_begin),
  504.         (eq, "$advanced_logging", 1),
  505.         (neg|str_is_empty, s0),
  506.         (str_store_string, s0, "@Player:{s1} UID:{reg0} {s0}"),
  507.         (call_script, "script_mbac_set_up_message", msg_log_only),
  508.       (try_end),
  509.  
  510.       (try_begin),#admin notification
  511.         (eq, ":message", 1),
  512.         (str_store_string, s0, "@Player {s1} with UID {reg0} might be using cheats"),
  513.         (try_for_range, ":i", 0, num_hacks),
  514.           (store_add, ":string", "str_hack_0", ":i"),
  515.           (str_store_string, s1, ":string"),
  516.           (store_add, ":slot", slot_player_unblockable_warnings, ":i"),
  517.           (player_get_slot, reg0, ":player", ":slot"),
  518.           (gt, reg0, 0),
  519.           (assign, reg1, "$warnings_til_consequences"),
  520.           (str_store_string, s0, "@{s0} {s1}({reg0}/{reg1})"),
  521.         (try_end),
  522.         (call_script, "script_mbac_set_up_message", "$broadcast_hack_warnings"),
  523.       (else_try),#consequence
  524.         (eq, ":message", 2),
  525.         (call_script, "script_mbac_hack_consequence", ":player"),
  526.       (try_end),
  527.     (try_end),
  528.   ]),
  529. ]
  530. #MBAC end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement