free_pc_virus_removal
Recruit
I've spent quite a long time trying to figure out how to get this working for my multiplayer NW server. Basically, I want the var2 number for the "custom_button_instant" to determine the item the player receives when they use the button. It works perfectly in single player mode with this script :
But it doesn't work in multiplayer. It simply does nothing in multiplayer.
This next script, on the other hand, works in multiplayer when the var2 number is set to "1", but does nothing when its set to 2
I'm very confused why the first one can't work in multiplayer, and ideally if someone could give me a way to make it work with the same format would be my best bet. The second script also confuses me, that it would work for "eq, button type 1" but doesnt do **** for button type 2. Any insight or help is greatly appreciated!
Code:
("custom_button_instant",spr_use_time(0),"0","cannon_button_collision", [
(ti_on_scene_prop_use,
[
(store_trigger_param_1, ":agent_id"),
(store_trigger_param_2, ":instance_id"),
(prop_instance_get_variation_id_2, ":button_type", ":instance_id"),
(try_begin),
(eq, ":button_type", 1),
(agent_get_item_slot, ":item_id", ":agent_id", 4), #ek_head
(gt,":item_id",-1), # even have a item there?
(agent_unequip_item, ":agent_id", ":item_id", 4), #ek_head
(agent_equip_item, ":agent_id", "itm_pirate_hat"),
(else_try),
(eq, ":button_type", 2),
(agent_get_item_slot, ":item_id", ":agent_id", 4), #ek_head
(gt,":item_id",-1), # even have a item there?
(agent_unequip_item, ":agent_id", ":item_id", 4), #ek_head
(agent_equip_item, ":agent_id", "itm_rus_partisan_hat3"),
(try_end),
]),
]),
But it doesn't work in multiplayer. It simply does nothing in multiplayer.
This next script, on the other hand, works in multiplayer when the var2 number is set to "1", but does nothing when its set to 2
Code:
("custom_button_instant",spr_use_time(0),"0","cannon_button_collision", [
(ti_on_scene_prop_use,
[
(store_trigger_param_1, ":agent_id"),
(store_trigger_param_2, ":instance_id"),
(prop_instance_get_variation_id_2, ":button_type", ":instance_id"),
(try_begin),
(eq, ":button_type", 1),
(multiplayer_send_3_int_to_player, ":agent_id", multiplayer_event_return_agent_set_item, ":agent_id", "itm_rus_pavlovsk_ranker", 4),
(else_try),
(eq, ":button_type", 2),
(agent_equip_item,":agent_id","itm_spyglass"),
(else_try),
(eq, ":button_type", 3),
(try_for_players, ":player_no", 1),
(player_is_active, ":player_no"),
(multiplayer_send_3_int_to_player, ":agent_id", multiplayer_event_return_agent_set_item, ":agent_id", "itm_pirate_hat", 4),
(try_end),
]),
]),
I'm very confused why the first one can't work in multiplayer, and ideally if someone could give me a way to make it work with the same format would be my best bet. The second script also confuses me, that it would work for "eq, button type 1" but doesnt do **** for button type 2. Any insight or help is greatly appreciated!
Last edited by a moderator: