#1
|
|||
|
|||
A little fun?
a quick, hopefully fun 'slalom race' offline mission with a timer and 'gate passing' script.
http://www.mediafire.com/download.php?2itdv8u9sclio7b script Code:
using System; using System.Collections; using System.Collections.Generic; using maddox.game; using maddox.game.world; using maddox.GP; using System.Diagnostics; public class Mission : AMission{ Stopwatch missionTimer = new Stopwatch(); int aa = 0;//trigger count double sw = 0;//stopwatch double se = 0;//stopwatch calculated public override void OnBattleStarted() { base.OnBattleStarted(); missionTimer.Start(); } public override void OnTrigger(int missionNumber, string shortName, bool active) { if ("start".Equals(shortName) && active) { aa = 0; missionTimer.Restart(); { GamePlay.gpHUDLogCenter("GO");//start } } if ("b".Equals(shortName) && active) {//gate 1 ++aa; {GamePlay.gpHUDLogCenter("1"); } } if ("c".Equals(shortName) && active) {//gate2 ++aa; {GamePlay.gpHUDLogCenter("2"); } } if ("d".Equals(shortName) && active) {//gate 3 ++aa; {GamePlay.gpHUDLogCenter("3"); } } if ("e".Equals(shortName) && active) {//gate 4 ++aa; {GamePlay.gpHUDLogCenter("4"); } } if ("finish".Equals(shortName) && active) { //finish missionTimer.Stop(); double initTime = 0.0; sw = missionTimer.Elapsed.TotalMilliseconds; se = sw/1000;{ GamePlay.gpHUDLogCenter("TIME:"+se); Timeout(initTime += 5.0, () => { GamePlay.gpHUDLogCenter("GATES:"+aa); }); } } } } |
#2
|
|||
|
|||
I like that Idea mate...
__________________
Asus P6T V2 Deluxe, I7 930, 3x2 GB RAM XMS3 Corsair1333 Mhz, Nvidia Leadtek GTX 470, Acer 1260p screen projector, Track IR 4 OS ver5, Saitek Pro Flight Rudder, Saitek X52, Win 7 x64 ultimate |
#3
|
|||
|
|||
Haha cool.
|
#4
|
|||
|
|||
Dude! that is a bit of fun
That code will come in handy for something I am sure. RED BULL RACING HERE WE COME!!!
__________________
__________________ Win7, 64bit Ultra Asus P8P67Pro MB Intel i7-2600K Coursair 16GB (4x 4GB), DDR3-1600MHz Gainward Nvidia 580GTX 3GB DDR5 850-Watt Modular Power Supply WIN7 and COD on Gskill SSD 240GB 40" Panasonic LCD TrackIR5 + Thrustmaster Warthog stick, throttle & pedals |
|
|