Created
July 23, 2016 14:21
-
-
Save Koncord/21ea1be2d827ca27df56d58517022034 to your computer and use it in GitHub Desktop.
Example for TES3MP GUI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function OnPlayerSendMessage(pid, message) | |
| local pname = tes3mp.GetName(pid) | |
| print(pname.."("..pid.."): "..message) | |
| if myMod.OnPlayerMessage(pid, message) == 0 then | |
| return 0 | |
| end | |
| if message:sub(1,1) == '/' then | |
| local cmd = (message:sub(2, #message)):split(" ") | |
| if cmd[1] == "test" then | |
| if cmd[2] == "1" then | |
| tes3mp.MessageBox(pid, 321, "Test Message Box") | |
| elseif cmd[2] == "2" then | |
| tes3mp.CustomMessageBox(pid, 2222, "Test Custom Message Box", "Btn1;Btn2;Btn3") | |
| elseif cmd[2] == "3" then | |
| tes3mp.InputDialog(pid, 31234, "Test Message Dialog") | |
| end | |
| return 0 | |
| end | |
| end | |
| return 1 | |
| end | |
| function OnGUIAction(pid, idGui, data) -- idGua - any numeric value, data - is string returned from client | |
| if idGui == 321 then | |
| print("MessageBox returned") | |
| elseif idGui == 2222 then | |
| print("CustomMessageBox returned: "..data) | |
| elseif idGui == 31234 then | |
| print("InputDialog returned: "..data) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment