PDA

View Full Version : I Am Trying To Add A Count Message


The Horny Rat
2003-11-12, 01:12 AM
I am trying to add a count message that lets you know the number of turrets currently deployed, this should be easy, but I am haveing a problem, any ideas????????





%turret = new Turret()
{
dataBlock = %data.placedName;
rotation = %rot;
position = %pos;
collideable = true;
static = true;
team = %obj.client.team;
client = %obj.client;
//scale = "2.5 2.5 3.5";
scale = "9.0 9.0 9.0";
};
MissionCleanup.add(%turret);
$Server::DeployedObjects[%data, %obj.client.team]++;
%turret.setShapeName("Deployable Plasma Turret");


messageClient(%obj.client, 'MsgTurretDeployed', 'Turret Deployed! :: %1', %turret);


// New Count Message
%count = $Server::DeployedObjects[%data, %obj.client.team] == Game.maxDeployables[%data, count];
messageClient(%obj.client, 'MsgTurretCount', "Your team has "@ %count @" deployable plasma turrets deployed.");
// END

RoDent
2003-11-15, 10:28 PM
What exactly is the problem?

%count = $Server::DeployedObjects[%data, %obj.client.team] == Game.maxDeployables[%data, count];

does look a bit suspect tho...
That would cause %count to be 0, or 1, forever.

AIWarlord
2003-12-05, 10:41 PM
%count = $Server::DeployedObjects[%data, %obj.client.team];
messageClient(%obj.client, 'MsgTurretCount', "Your team has " @ %count @ " deployable plasma turrets deployed.");

Should fix it.

If you want a blahblah out of blahblah, then ya want something like:

%count = $Server::DeployedObjects[%data, %obj.client.team];
messageClient(%obj.client, 'MsgTurretCount', "Your team has " @ %count @ " out of " @ Game.maxDeployables[%data] @ " deployable plasma turrets deployed.");