Code: Select all
function StartPU::OnEnter(%db, %this, %tank)
{
switch( $TimerStarted );
{
%client = %tank.client;
case 1:
deactivatePackage(Timer);
messageAll(1,"The Maximum Time Has Exceded" NL "Ride Through The Starter To Restart It!",1);
break;
case 0:
activatePackage(Timer);
messageAll(1,"The Timer Has Been Started By:" SPC %client.nameBase,1);
break;
}
switch ( %client.passedCheckpoint );
{
%client = %tank.client;
case 1:
messageAll(1,%client.nameBase SPC "Has Finished The Race In" SPC %timer SPC "Sec.",1);
messageClient(%client,'serverMessage', "Congrats! You've Finished In" SPC %timer SPC "Sec.",4,4);
%client.incScore(1,0);
%client.hurtMe(999);
break;
case 0:
messageAll(1,%client.nameBase SPC "Has Started The Race!",1);
%client.started = 1;
}
}
function HalfPU::OnEnter(%this, %db, %tank)
{
switch(%client.started);
{
%client = %tank.client;
case 1:
messageClient(%client,'serverMessage',"Go Go Go!" NL "Your At The Half!",4,4);
%client.started = 0;
break;
case 0:
messageAll(1,%client.nameBase SPC "Tryed To Cheat & Has To Redo The Track!",1);
%client.hurtMe(999);
break;
}
}
$PupTypes = 3;
$Pup[0] = "3";
$Pup[1] = "10";
$Pup[2] = "5";
function TimePU::OnEnter(%this, %db, %tank)
{
%client = %tank.client;
messageClient(%client,'serverMessage',"You've Caught A Time-PU",4,4);
%choice = getRandom($PupTypes-1)
%timer = %timer - $PupTypes[%choice];
}
$maxTime = 600;
package Timer()
{
function timer(%timer)
{
while(%timer <maxTime> %timer)
return;
}
};
datablock powerupdata(StartPU)
{
category = "PowerUp";
shape = "~/data/shapes/ogmshapes/Checkpoint2/checkpoint.dts";
type = "bounce";
shadow = false;
shadowAnimation = false;
startOn = true;
minOff = 1;
maxOff = 2;
Sound = "";
soundOff = "";
};
datablock powerupdata(HalfPU)
{
category = "PowerUp";
shape = "~/data/shapes/ogmshapes/Checkpoint2/checkpoint.dts";
type = "bounce";
shadow = false;
shadowAnimation = false;
startOn = true;
minOff = 1;
maxOff = 2;
Sound = "";
soundOff = "";
};
datablock powerupdata(TimePU)
{
category = "PowerUp";
shape = "~/data/shapes/CasRace1/TimePU.dts";
type = "bounce";
shadow = false;
shadowAnimation = false;
startOn = true;
minOff = 1;
maxOff = 2;
Sound = "";
soundOff = "";
};
Console Error
Codeweaver Error[/i]game/gametypes/CasRace2.cs Line: 17 - Syntax error.
>>> Advanced script error report. Line 33.
>>> Some error context, with ## on sides of error halt:
function StartPU::OnEnter(%db, %this, %tank)
{
^switch( $TimerStarted );##
##
^^{
^^%client = %tank.client;
^^case 1:
^^deactivatePackage(Timer);
>>> Error report complete.