Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "zcommon.acs"
- #library "menu"
- #library "unem"
- #define CURSOR 200
- #define id_cursor 9970
- #define id_choices 9980
- int thisScript = 0;
- int menu = off;
- int currentchoice = 3;
- int maxchoices = 3;
- function void ClearMsg ( int id )
- {
- HudMessage(s:""; 0,id,-1,0,0,0);
- }
- function void Choice ( int number, int name )
- {
- SetHudSize(384,256,0);
- SetFont("SmallFont"); //You may change this...
- HudMessage(d:number+1,s:". \cl",s:name; // or this, to your liking. Everything else should probably stay the same.
- HUDMSG_PLAIN,id_choices+number,CR_GREEN,67.1,170.1+(number*8.0),9999.0);
- ACS_Execute(CURSOR,0);
- maxchoices = number;
- menu = off;
- for(int x=1; x<=100; x++)
- ClearMsg(id_choices+number+x);
- }
- function void ClearCursor ( void )
- {
- ACS_Terminate(CURSOR,0);
- ClearMsg(id_cursor);
- for(int x=0; x<=100; x++)
- ClearMsg(id_choices+x);
- LocalAmbientSound("menu/clear",127); //Get rid of this (or any other LocalAmbientSounds) if it annoys you. :P
- menu = OFF;
- }
- // The following four scripts are best kept as scripts due to:
- // (a) functions being unable to handle delays
- // (b) "puke" being unable to grab the number of a script as defined in the scripts lump.
- // You should define CURSOR as a number that won't interfere with your scripts.
- script CURSOR ( void )
- {
- SetHudSize(384,256,0);;
- HudMessage(s:"\cj*";
- HUDMSG_PLAIN,id_cursor,-1,52.1,170.1+(currentchoice*8.0),0.12);
- delay(5);
- restart;
- }
- script 201 ( void ) NET // MENU UP.
- {
- if(menu==ON)
- {
- if(currentchoice>0) currentchoice--;
- LocalAmbientSound("menu/cursor",127);
- }
- }
- script 202 ( void ) NET // MENU DOWN.
- {
- if(menu==ON)
- {
- if(currentchoice<=maxchoices-1) currentchoice++;
- LocalAmbientSound("menu/cursor",127);
- }
- }
- script 203 ( void ) NET // MENU SELECT.
- {
- if(menu==ON)
- {
- ClearMsg(id_cursor);
- ACS_Execute(ThisScript,0);
- delay(1); // Don't ask me why this needs to be here; it just... does.
- currentchoice = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement