Forums Index >> Modding >> GTAT - Get The AdminTank
Page : <1> :
Very nice! Good job, so when are you gonna put this in functon?
P.S I think it should be at Shipwrecked 1 or 2.
I think the mistake is
// -- Functions
function TankData::OnAdd(%tank)
{
if(%tank.startingtankdb = LightTank)
%tank.setdatablock("BabyBoss");
if(%tank.startingtankdb = MediumTank)
%tank.setdatablock("BabyBoss");
if(%tank.startingtankdb = HeavyTank)
%tank.setdatablock("BabyBoss");
if(%tank.startingtankdb = BabyBoss)
%tank.setdatablock("BabyBoss");
if(%tank.startingtankdb = BossTank)
%tank.setdatablock("BabyBoss");
}
Anyways those lines up there should all be replaced with
if(%obj.client.deaths == 0)
%tank.setdatablock("BabyBoss");
They should also be merged into the function ABOVE (exactly same function name, so merge the code inside them into 1)
and then... You should add
changetanks(%this,%this.client);
To the function incScore in the file tank2.cs Bravetree released (and of course, execute that function)
Last edited: Monday, July 03, 2006 at 11:50:56 AM
Hurray! Thanks for the scripppt
Try this:
// ---------- GTAT ---------- //
// ---- Script By Cassie ---- //
// Thx Art Crazy and Dj Wings //
// -- Prefs
$Server::MissionType = "GTAT";
$Game::MissionType = "GTAT";
$Server::TeamGame = false;
$Game::TeamGame = false;
// -- StartFunction
function TankData::onAdd(%this,%obj)
{
if(%obj.client.deaths == 0)
{
centerprint(%obj.client,"Welcome To GTAT!",4,4);
bottomprint(%obj.client,"This Is An Alpha-Test",4,4);
%obj.client.startingtankdb = "BabyBoss";
%obj.setDataBlock("BabyBoss");
}
}
function change_tanks(%tank, %client)
{
if(%client.cumScore >= 10 && %client.cumScore < 25)
{
%tank.setdatablock("LightTank");
centerprintall(%client.nameBase SPC "Has 10 + Points - Changed To LightTank",3, 4);
echo(%client.nameBase SPC "Changed To LightTank");
}
else if(%client.cumScore >= 25 && %client.cumScore < 50)
{
%tank.setdatablock("MediumTank");
centerprintall(%client.nameBase SPC "Has 25 + Points - Changed To MediumTank", 3,4);
echo(%client.nameBase SPC "Changed To MediumTank");
}
else if(%client.cumscore >= 50 && %client.cumScore < 75)
{
%tank.setdatablock("HeavyTank");
centerprintall(%client.nameBase SPC "Has 50 + Points - Changed To HeavyTank", 3,4);
}
else if(%client.cumScore >= 75 && < %client.cumScore < 100)
{
%tank.setdatablock("BossTank");
centerprintall(%client.nameBase SPC "Has 75 + Points - Changed To BossTank", 4);
}
else if(%client.cumScore >= 100)
{
%tank.setdatablock("AdminTank");
centerprintall(%client.nameBase SPC "Has 100 + Points - Changed To AdminTank", 4);
}
}
package TankKilled
{
function TankData::onTargetDestroyed(%db,%this,%killer)
{
changetanks(%this,%this.client);
changetanks(%killer,%killer.client);
Parent::onTargetDestroyed(%db,%this,%killer);
}
};
activatePackage(TankKilled);
The other one woudn't work AT all.
^ oo..
Yeah , I noticed the other didnt work.
Lil rough posting a version that works in the same post in 1 week.. :(
Where does this function go? In the.mis file, or where? 8o
Page : <1> :
Hey all, as you (not) know, I've accepted a question from Gort, to make GTAT. Well, there is some error in it. The dedicated console gives no error.
Could somebody tell me how to fix.
// ---------- GTAT ---------- //
// ---- Script By Cassie ---- //
// Thx Art Crazy and Dj Wings //
// -- Prefs
$Server::MissionType = "GTAT";
$Game::MissionType = "GTAT";
$Server::TeamGame = false;
$Game::TeamGame = false;
// -- StartFunction
f unction TankData::onAdd(%this,%obj)
{
if(%obj.client.deaths == 0)
{
centerprint(%obj.client,"Welcome To GTAT!",4,4);
bottomprint(%obj.client,"This Is An Alpha-Test",4,4);
}
}
// -- Functions
f unction TankData::OnAdd(%tank)
{
if(%tank.startingtankdb = LightTank)
%tank.setdatablock("BabyBoss");
if(%tank.startingtankdb = MediumTank)
%tank.setdatablock("BabyBoss");
if(%tank.startingtankdb = HeavyTank)
%tank.setdatablock("BabyBoss");
if(%tank.startingtankdb = BabyBoss)
%tank.setdatablock("BabyBoss");
if(%tank.startingtankdb = BossTank)
%tank.setdatablock("BabyBoss");
}
f unction change_tanks(%tank, %client)
{
if(%client.incScore == 10)
{
%tank.setdatablock("LightTank");
centerprintall(%client.nameBase SPC "Has 10 Points - Changed To LightTank", 4);
echo(%client.nameBase SPC "Changed To LightTank");
}
if(%client.incScore == 25)
{
%tank.setdatablock("MediumTank");
centerprintall(%client.nameBase SPC "Has 25 Points - Changed To MediumTank", 4);
echo(%client.nameBase SPC "Changed To MediumTank");
}
if(%client.incScore == 50)
{
%tank.setdatablock("HeavyTank");
centerprintall(%client.nameBase SPC "Has 50 Points - Changed To HeavyTank", 4);
}
if(%client.incScore == 75)
{
%tank.setdatablock("BossTank");
centerprintall(%client.nameBase SPC "Has 75 Points - Changed To BossTank", 4);
}
if(%client.incScore == 100)
{
%tank.setdatablock("AdminTank");
centerprintall(%client.nameBase SPC "Has 100 Points - Changed To AdminTank", 4);
}
}
Non of the letters are capitalized in the script.