Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "zcommon.acs"
- #DEFINE shortDelay 35
- #DEFINE longDelay 70
- #DEFINE foreverDelay 9999*9999
- int playerAmount = 0;
- int crossedLine = 0;
- bool raceStarted = false;
- bool raceFinished = false;
- ////////////////////////////////////////////////////////////////////////////////////////////////////// 1st Countdown
- Script 01 OPEN
- {
- int countdown;
- //Static scripts.
- Sector_SetFriction(40, 45);
- //Countdown to bike.
- SetFont("BigFont");
- Delay(longDelay);
- for (int i = 0; i < 10; i++)
- {
- countdown = 10 - i;
- HudmessageBold(s: "You have ", d:countdown, s:" seconds to enter a wavebike!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 0.2);
- Delay(35);
- }
- HudmessageBold(s: "There's still time to enter a wavebike before the race starts!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 1.5);
- Delay(longDelay);
- ACS_Execute(11,0);
- }
- Script 02 (void) //Count down canceller.
- {
- for (int i = 0; i < 7; i++)
- {
- Suspend;
- }
- ACS_Terminate(1,0);
- SetFont("BigFont");
- HudmessageBold (s: "Wavebikes are all taken!!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 1.5);
- Delay(longDelay);
- ACS_Execute(11,0);
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////////// Telepoter Scripts
- Script 03 (void) //Teleport 1
- {
- if (raceStarted)
- terminate;
- Teleport(21, 0, 0);
- ACS_Execute(2,0);
- GiveInventory("BoatActivate",1);
- ACS_Execute(12,0);
- Floor_LowerInstant(9,0,6);
- Delay(foreverDelay); //Forever.
- }
- Script 04 (void) //Teleport 2
- {
- if (raceStarted)
- terminate;
- Teleport(22, 0, 0);
- ACS_Execute(2,0);
- GiveInventory("BoatActivate",1);
- ACS_Execute(12,0);
- Floor_LowerInstant(10,0,6);
- Delay(foreverDelay); //Forever.
- }
- Script 05 (void) //Teleport 3
- {
- if (raceStarted)
- terminate;
- Teleport(23, 0, 0);
- ACS_Execute(2,0);
- GiveInventory("BoatActivate",1);
- ACS_Execute(12,0);
- Floor_LowerInstant(11,0,6);
- Delay(foreverDelay); //Forever.
- }
- Script 06 (void) //Teleport 4
- {
- if (raceStarted)
- terminate;
- Teleport(24, 0, 0);
- ACS_Execute(2,0);
- GiveInventory("BoatActivate",1);
- ACS_Execute(12,0);
- Floor_LowerInstant(12,0,6);
- Delay(foreverDelay); //Forever.
- }
- Script 07 (void) //Teleport 5
- {
- if (raceStarted)
- terminate;
- Teleport(25, 0, 0);
- ACS_Execute(2,0);
- GiveInventory("BoatActivate",1);
- ACS_Execute(12,0);
- Floor_LowerInstant(13,0,6);
- Delay(foreverDelay); //Forever.
- }
- Script 08 (void) //Teleport 6
- {
- if (raceStarted)
- terminate;
- Teleport(26, 0, 0);
- ACS_Execute(2,0);
- GiveInventory("BoatActivate",1);
- ACS_Execute(12,0);
- Floor_LowerInstant(14,0,6);
- Delay(foreverDelay); //Forever.
- }
- Script 09 (void) //Teleport 7
- {
- if (raceStarted)
- terminate;
- Teleport(27, 0, 0);
- ACS_Execute(2,0);
- GiveInventory("BoatActivate",1);
- ACS_Execute(12,0);
- Floor_LowerInstant(15,0,6);
- Delay(foreverDelay); //Forever.
- }
- Script 10 (void) //Teleport 8
- {
- if (raceStarted)
- terminate;
- Teleport(28, 0, 0);
- ACS_Execute(2,0);
- GiveInventory("BoatActivate",1);
- ACS_Execute(12,0);
- Floor_LowerInstant(16,0,6);
- Delay(foreverDelay); //Forever.
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////////// Race scripts
- Script 11 (void) //Countdown to RACE
- {
- int countdown;
- //Countdown to bike.
- SetFont("BigFont");
- Delay(longDelay);
- for (int i = 0; i < 10; i++)
- {
- countdown = 10 - i;
- HudmessageBold(s: "\cgYou have ", d:countdown, s:" seconds until the race starts!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 0.2);
- AmbientSound("hurp/derp", 127);
- Delay(35);
- }
- HudmessageBold(s: "\cgThe race has started!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 0.2);
- Setmusic("CUTMUS");
- SetLineTexture(17,SIDE_FRONT,TEXTURE_MIDDLE,"-");
- SetLineTexture(17,SIDE_BACK,TEXTURE_MIDDLE,"-");
- SetLineBlocking(17,OFF);
- raceStarted = true;
- ACS_Execute(15,0);
- }
- Script 12 (void) //Adds a value to the 'playerAmount' variable
- {
- if (playerAmount > 8)
- {
- playerAmount = 8;
- HudmessageBold(s: "\chToo many racers!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 0.2);
- terminate;
- }
- playerAmount++;
- }
- Script 13 (void) //Kills the losing player
- {
- /*
- if ((crossedLine + 1) == playerAmount)
- {
- Hudmessage(s: "You died."; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 0.2);
- crossedLine = 0;
- }*/
- }
- Script 14 (void) //Checks if someone passed the finish line
- {
- int laps = playerAmount - 1;
- if (laps < 1)
- laps = 1;
- Hudmessage(s: "Laps done: ", d:laps, s:""; 0, 1, 0, 0.5,0.5, 1);
- crossedLine++;
- ACS_Execute(13,0);
- }
- Script 15 (void) //Checks players for laps
- {
- int laptotal = 1;
- while (!raceFinished)
- if (playerAmount == 1)
- {
- HudmessageBOLD(s: "Laps todo: Singleplayer"; 0, 2, 0, 0.5,0.4, 1);
- }
- else
- {
- HudmessageBOLD(s: "Laps todo: ", d:laptotal, s:""; 0, 2, 0, 0.5,0.4, 1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement