Forums Index >> Modding >> New gametype - Hide and seek.
Page : <1> :
This is like japanese to us "non scripters" lol
How do you identify those two variables?.I really don't know anything about scripting, I'm just modifying other scripts.
You do not need semi-colons after your if statements
Thnk you, that fixed one problem, but there are many more :( because, like I said, I really don't know scripting. I think I will make it a little simpler so I can actually pull it off.
You know warfare, if you would just send me the survivor script I would easily be able to do this. I won't give the survivor script to anyone else or use it on my server, I would just like to use it to learn scripting and finish my gametype.
Last edited: Friday, December 02, 2005 at 6:10:13 PM
Page : <1> :
I was thinking about making a gametype called hide and seek, where one team, invisible on the radar, would hide and the other team would have to find and kill them. I made a script with just one function, for scores, but it has a bug :o.
function TankData::onAdd(%this,%obj)
{
if(%obj.client.deaths == 0)
{
centerprint(%obj.client,"Welcome to Hide and Seek!",4,4);
}
}
//Default Preferences
$Server::MissionType = "Hide and Seek";
$Game::MissionType = "Hide and Seek";
$Server::TeamGame = false;
$Game::TeamGame = false;
//Loya
function TankData::onDestroyed(%db,%this,%killer)
{
$Suicided[%client] = false;
// need to deal with both ai bots and players as killer's and killee's
%client = %this.client;
%client.deaths++;
// echo("killed tank: " @ %this @ ", client: " @ %client);
// echo("killer tank: " @ %killer @ ", client: " @ %killerClient);
If (isObject(%killer))
{
$SaveTeam[%client] = %client.team;
if (%killer.client.team = "BlueTeam" & %client.team = "GreenTeam");
{
%killer.incScore(2,0);
}
else if (%killer.client.team = "GreenTeam" & %client.team = "BlueTeam");
{
%killer.incScore(1,0);
}
%killer.client.kills++;
else
{
%killer.incScore(0,0);
}
else
{
$Suicided[%client] = true;
}
if($Suicided[%client])
{
//%client.player.setprojectile("NoAmmoProjectile");
schedule(%waittorespawn2,false,"ssetprojectile",%client,"ZeroProjectile");
}
}
I got this error in my console:
Game/gametypes/HideSeek.cs Line: 41 - Syntax error.
>>> Advanced script error report. Line 81.
>>> Some error context, with ## on sides of error halt:
if (%killer.client.team = "BlueTeam" & %client.team = "GreenTeam");##
##
{
%killer.incScore(2,0);
}
Else if (%killer.client.team = "GreenTeam" & %client.team = "Bl
>>> Error report complete.
Could anyone tell me what the problem is? Also, how do I make it that everyone joining the server is automatically put on blue team? Thanks.
Last edited: Monday, November 28, 2005 at 12:55:59 PM