Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. #include "zcommon.acs"
  2. #library "menu"
  3. #library "unem"
  4. #define CURSOR 200
  5.  
  6. #define id_cursor 9970
  7. #define id_choices 9980
  8.  
  9. int thisScript = 0;
  10. int menu = off;
  11. int currentchoice = 3;
  12. int maxchoices = 3;
  13.  
  14. function void ClearMsg ( int id )
  15. {
  16. HudMessage(s:""; 0,id,-1,0,0,0);
  17. }
  18.  
  19. function void Choice ( int number, int name )
  20. {
  21. SetHudSize(384,256,0);
  22. SetFont("SmallFont"); //You may change this...
  23. HudMessage(d:number+1,s:". \cl",s:name; // or this, to your liking. Everything else should probably stay the same.
  24. HUDMSG_PLAIN,id_choices+number,CR_GREEN,67.1,170.1+(number*8.0),9999.0);
  25. ACS_Execute(CURSOR,0);
  26. maxchoices = number;
  27. menu = off;
  28.  
  29. for(int x=1; x<=100; x++)
  30. ClearMsg(id_choices+number+x);
  31. }
  32.  
  33. function void ClearCursor ( void )
  34. {
  35. ACS_Terminate(CURSOR,0);
  36. ClearMsg(id_cursor);
  37. for(int x=0; x<=100; x++)
  38. ClearMsg(id_choices+x);
  39. LocalAmbientSound("menu/clear",127); //Get rid of this (or any other LocalAmbientSounds) if it annoys you. :P
  40. menu = OFF;
  41. }
  42.  
  43. // The following four scripts are best kept as scripts due to:
  44. // (a) functions being unable to handle delays
  45. // (b) "puke" being unable to grab the number of a script as defined in the scripts lump.
  46.  
  47. // You should define CURSOR as a number that won't interfere with your scripts.
  48. script CURSOR ( void )
  49. {
  50. SetHudSize(384,256,0);;
  51. HudMessage(s:"\cj*";
  52. HUDMSG_PLAIN,id_cursor,-1,52.1,170.1+(currentchoice*8.0),0.12);
  53. delay(5);
  54. restart;
  55. }
  56.  
  57. script 201 ( void ) NET // MENU UP.
  58. {
  59. if(menu==ON)
  60. {
  61. if(currentchoice>0) currentchoice--;
  62. LocalAmbientSound("menu/cursor",127);
  63. }
  64. }
  65.  
  66. script 202 ( void ) NET // MENU DOWN.
  67. {
  68. if(menu==ON)
  69. {
  70. if(currentchoice<=maxchoices-1) currentchoice++;
  71. LocalAmbientSound("menu/cursor",127);
  72. }
  73. }
  74.  
  75. script 203 ( void ) NET // MENU SELECT.
  76. {
  77. if(menu==ON)
  78. {
  79. ClearMsg(id_cursor);
  80. ACS_Execute(ThisScript,0);
  81. delay(1); // Don't ask me why this needs to be here; it just... does.
  82. currentchoice = 0;
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement