use client tags. shooterclient / damagedclient in the on damage function.
and this for the leave / enter functions.
%client = Player::getClient(%this);
mission area
Re: mission area
Replace %friendlyfire = true; with return;
Don't do what crow said. That had nothing to do with anything.
Don't do what crow said. That had nothing to do with anything.
Re: mission area
makes it easier to use in other functions.perrinoia wrote:Replace %friendlyfire = true; with return;
Don't do what crow said. That had nothing to do with anything.
Re: mission area
Oh, I see what Crow is talking about, now.
%object is shooter client, not player.
He wanted you to set Player::getClient(%this).outArea = 1; in function Player::leaveMissionArea(%this) and set Player::getClient(%this).outArea = ""; in function Player::enterMissionArea(%this) as well as leaving %this.outArea = 1; and %this.outArea = ""; in both functions so you could use clientID and playerID interchangeably in function Player::onDamage...
My suggestion is easier.
%object is shooter client, not player.
Code: Select all
if(!%this.outArea || !Client::getControlObject(%object).outArea)
{
Client::sendMessage(%object, 0, "Shooter and target must be out of the mission area to cause or receive damage.");
return;
}
My suggestion is easier.
Re: mission area
Strange. You're missing the line %player.outArea = ""; but that should have no effect on the message playing.
---------- Find in Files ----------
> Searching for the string 'function Player::enterMissionArea'...
C:\Dynamix\Tribes\base\scripts\dm.cs(70,1): function Player::enterMissionArea(%player)
C:\Dynamix\Tribes\base\scripts\player.cs(299,1): function Player::enterMissionArea(%this)
C:\Dynamix\Tribes\base\scripts\Training_Towers.cs(385,1): function Player::enterMissionArea(%this)
> 3 occurrence(s) have been found.
Re: mission area
Sorry, I searched in base 1.40 and deleted the sub-directories, assuming everything else would be the same. I was wrong.
I'd modify all of them just to be on the safe side, or delete all but one to ensure the others don't overwrite the custom one.
However, I doubt this is what is going wrong for you, either... I'm betting the function isn't being called regardless of where it's stored.
Something is fishy with your mission area detection... That's my guess.
Are there any syntax errors in the console?
game.cs is executed when the server starts, but objectives.cs is executed every time a mission starts, so I could see how changes made to game.cs might get overlooked, if the mission ever changed. Likewise, if you modified objectives.cs, and your first mission doesn't execute that file, then I could see how it might get overlooked.---------- Find in Files ----------
> Searching for the string 'function player::enterMissionArea'...
C:\Dynamix\trorbs\base\scripts\dm.cs(67,1): function Player::enterMissionArea(%player)
C:\Dynamix\trorbs\base\scripts\game.cs(871,1): function Player::enterMissionArea(%player)
C:\Dynamix\trorbs\base\scripts\objectives.cs(367,1): function Player::enterMissionArea(%this)
C:\Dynamix\trorbs\base\scripts\Training_Towers.cs(385,1): function Player::enterMissionArea(%this)
> 4 occurrence(s) have been found.
I'd modify all of them just to be on the safe side, or delete all but one to ensure the others don't overwrite the custom one.
However, I doubt this is what is going wrong for you, either... I'm betting the function isn't being called regardless of where it's stored.
Something is fishy with your mission area detection... That's my guess.
Are there any syntax errors in the console?
Re: mission area
Oh... That makes so much sense.
I highly suggest using Crimson Editor's "Find in Files" feature, by the way.
I highly suggest using Crimson Editor's "Find in Files" feature, by the way.