Skip to content
VN_fnc_showMultipleOptionsModal

VN_fnc_showMultipleOptionsModal

v1.00Theme: UI and HUDGroup: Options dialogEffects: localReturns: Boolean

Opens up a modal dialog that allows for single or multiple choices.

Syntax

[title, options, onExit, singleChoice] call VN_fnc_showMultipleOptionsModal

Parameters

ParameterTypeDefaultDescription
title String— title of the vote
options Array of String— options items are in format [title, action, arguments]:
• title: String
• action: Code
• arguments: Array
onExit Code— function called when a player exits the modal, a nested array is passed to the function. Nested array is as follow: [_this: See OnUnload EH, _selected: Array of selected option indexes]
singleChoice Booleantrue if set to true, options act like a radio button (only one option can be selected); false allows to select multiple options.

Return value

Boolean - true if the dialog was successfully created. Empty title or no options will return false

Examples

[
	"Do you like pineapple on pizza?",
	[
		["Yes", { systemChat str _this; }, []],
		["No", { systemChat str _this; }, []],
		["No, but I never tried", { systemChat str _this; }, []],
		["Yes, but I never tried", { systemChat str _this; }, []],
		["I am neutral", { systemChat str _this; }, []]
	],
	{ systemChat str _this; },
	true
] call VN_fnc_showMultipleOptionsModal;

Documented by Heyoxe.