Forums Index >> Modding >> GTAT - Get The AdminTank



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.

 

 

 

 

Sunday, July 02, 2006 at 11:56:40 PM

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.

Monday, July 03, 2006 at 5:37:32 AM

... ^ he asked for help... :o

Sct

Monday, July 03, 2006 at 9:32:49 AM

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

Monday, July 03, 2006 at 9:39:10 AM

Hurray! Thanks for the scripppt

Monday, July 03, 2006 at 11:09:29 AM

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.

Thursday, July 06, 2006 at 8:46:35 AM

^ oo..

Yeah , I noticed the other didnt work.

Lil rough posting a version that works in the same post in 1 week.. :(

Saturday, July 08, 2006 at 4:36:04 AM

It's not rough I just did that because people might have wanted a working version.... Not to diminish the first ;)

Saturday, July 08, 2006 at 9:27:41 PM

Where does this function go? In the.mis file, or where? 8o

 

Saturday, July 15, 2006 at 3:53:02 PM

Try putting it in a new.cs file, otherwise move it around...

If you have it executed after all game things, it should work... Just make sure no other gametypes are active

Saturday, July 15, 2006 at 9:19:53 PM

Page : <1> :

insert quote insert url insert email insert image bold italic underline superscript subscript horizontal rule : : Help on using forum codes

Add comment:

HTML is disabled within comments, but ZBB Code is enabled.

Back to the top

Web site designed, maintained and funded by -z- and Dan MacDonald