Difference between revisions of "LUA:SendOptionWindow"

(Created page with "= LUA Functions: SendOptionWindow() = Sends the option window to the given client ==== Syntax ==== SendOptionWindow(param1, param2, param3, [param4]) ==== Parameters ==== ; Re...")
 
(No difference)

Latest revision as of 21:41, 8 January 2013

LUA Functions: SendOptionWindow()

Sends the option window to the given client


Syntax

SendOptionWindow(param1, param2, param3, [param4])

Parameters

Required - param1 (Option Window), param2 (Spawn), param3 (String)
param1 The option window to send
param2 The player to send the window to
param3 The option window title
Optional - param4 (String)
param4 The lua function to call if the cancel button is selected


Usage

function hailed(NPC, Spawn)
	window = CreateOptionWindow();
	AddOptionWindowOption(window, "Test 1", "Test 1 description", 0, 0, "Test1")
	AddOptionWindowOption(window, "Test 2", "Test 2 description", 0, 1, "Test2")
	SendOptionWindow(window, Spawn, "Option Window Test", "TestCancel")
end

function Test1(NPC, Spawn)
	Shout(Spawn, "Test 1")
end

function Test2(NPC, Spawn)
	Shout(Spawn, "Test 2")
end

function TestCancel(NPC, Spawn)
	Shout(Spawn, "Test cancel")
end

Sends the option window to the player