Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------------------------------------------------
- // EXAMPLE FOR CHOOSED OPTION THAT HAS NO SUBMENU
- --------------------------------------------------------------------------
- function onPlayerDialog(player, dialogid, option)
- {
- switch(dialogid) // dialog ID - it starts with 0
- {
- case 0: // first dialog/menu created
- switch(option) // we are switching options now
- {
- case 1: // this means the first option from dialog/menu 0
- MessagePlayer("// code here for option 1 in dialog 0",player);
- break;
- case 2: // option 2
- // here script the code for the option2, when it is selected.
- break;
- default: break;
- }
- break;
- default: break;
- }
- }
- --------------------------------------------------------------------------
- // EXAMPLE FOR CHOOSED OPTION THAT ACTUALLY HAS A SUBMENU
- --------------------------------------------------------------------------
- function onPlayerSubDialog(player, subdialogid, option)
- {
- switch(subdialogid) // the ID of the selected option in main menu
- {
- case 1: // it starts with ID 1, and not with 0
- switch(option)
- {
- case 1: // the ID of the selected option in the sub menu - it also starts with ID 0
- MessagePlayer("You choosed the option 1 of the submenu with ID 1",player);
- break;
- case 2:
- MessagePlayer("// code here for the choosed option 2 of the submenu with ID 1",player);
- break;
- default: break;
- }
- break;
- default: break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement