|
|
It is currently Tue May 21, 2024 7:05 am
|
View unanswered posts | View active topics
|
|
|
|
|
Users browsing this forum: No registered users and 1 guest |
|
|
|
|
|
|
|
|
|
Author |
Message |
TE-Shugo
Joined: Mon Sep 05, 2005 12:21 am Posts: 70 Location: YaY ArEa, CaLiForNia
|
Posted: Tue Jan 03, 2006 2:04 am Post subject:
|
|
|
I have no idea if this will work but you can try
Code: | function TowerSwitch::onCollision(%this, %object) { if(getObjectType(%object) != "Player") return;
if(Player::isDead(%object)) return;
%playerTeam = GameBase::getTeam(%object); %oldTeam = GameBase::getTeam(%this); if(%oldTeam == %playerTeam) return;
%client = Player::getClient(%object); %Team = Client::getTeam(%client); if(GameBase::getMapName(%this) == "Switch <!>") { messageAll(0,Client::getName(%client) @ " got the <!> Switch!!"); messageAllExcept(Client::getTeam(%client), "Your team lost the <!> Switch!"); %playerTeam.Switch1 = true; } if(GameBase::getMapName(%this) == "Switch |WAR|") { messageAll(0,Client::getName(%client) @ " got the |WAR| Switch!!"); messageAllExcept(Client::getTeam(%client), "Your team lost the |WAR| Switch!"); %playerTeam.Switch2 = true; } if(GameBase::getMapName(%this) == "Switch TE") { messageAll(0,Client::getName(%client) @ " got the TE Switch!!"); messageAllExcept(Client::getTeam(%client), "Your team lost the TE Switch!"); %playerTeam.Switch4 = true; } if(%playerTeam.Switch1 && %playerTeam.Switch2 && %playerTeam.Switch3) { ObjectiveMission::setObjectiveHeading(); if(%playerTeam.Switch1 == "false" || %playerTeam.Switch2 == "false" || %playerTeam.Switch3 == "false") { return; } schedule("ObjectiveMission::missionComplete();", 10);//if ya want 10min type 10*60 where it just says 10 } } |
|
|
|
|
|
|
|
|
|
|
|
|
|
Author |
Message |
TE-Noxwizard
Joined: Tue Jun 07, 2005 5:59 pm Posts: 942 Location: Texas
|
Posted: Tue Jan 03, 2006 2:41 pm Post subject:
|
|
|
If you're going to overwrite the existing function, you're going to need the original code plus yours.
My guess would be:
Code: | //fixed so cham can't claim for enemy team.. -Plasmatic function TowerSwitch::onCollision(%this, %object) { if($debug) event::collision(%this,%object);
%playerClient = Player::getClient(%object); if(getObjectType(%object) != "Player" || %playerClient.isSpy || Player::isDead(%object)) return;
%playerTeam = GameBase::getTeam(%object); %oldTeam = GameBase::getTeam(%this); if(%oldTeam == %playerTeam) return;
%this.trainingObjectiveComplete = true; %touchClientName = Client::getName(%playerClient); %group = GetGroup(%this); Group::iterateRecursive(%group, GameBase::setTeam, %playerTeam);
%dropPoints = nameToID(%group @ "/DropPoints"); %oldDropSet = nameToID("MissionCleanup/TeamDrops" @ %oldTeam); %newDropSet = nameToID("MissionCleanup/TeamDrops" @ %playerTeam);
$deltaTeamScore[%oldTeam] -= %this.deltaTeamScore; $deltaTeamScore[%playerTeam] += %this.deltaTeamScore; $teamScore[%oldTeam] -= %this.scoreValue; $teamScore[%playerTeam] += %this.scoreValue;
if(%dropPoints != -1) { for(%i = 0; (%dropPoint = Group::getObject(%dropPoints, %i)) != -1; %i++) { if(%oldDropSet != -1) removeFromSet(%oldDropSet, %dropPoint); addToSet(%newDropSet, %dropPoint); } }
if(%oldTeam == -1) { MessageAllExcept(%playerClient, 0, %touchClientName @ " claimed " @ %this.objectiveName @ " for the " @ getTeamName(%playerTeam) @ " team!"); Client::sendMessage(%playerClient, 0, "You claimed " @ %this.objectiveName @ " for the " @ getTeamName(%playerTeam) @ " team!"); } else { if(%this.objectiveLine) { MessageAllExcept(%playerClient, 0, %touchClientName @ " captured " @ %this.objectiveName @ " from the " @ getTeamName(%oldTeam) @ " team!"); Client::sendMessage(%playerClient, 0, "You captured " @ %this.objectiveName @ " from the " @ getTeamName(%oldTeam) @ " team!"); %this.numSwitchTeams++; schedule("TowerSwitch::timeLimitCheckPoints(" @ %this @ "," @ %playerClient @ "," @ %this.numSwitchTeams @ ");",60); } } if(%this.objectiveLine) { TeamMessages(1, %playerTeam, "Your team has taken an objective.~wCapturedTower.wav"); TeamMessages(0, %playerTeam, "The " @ getTeamName(%playerTeam) @ " has taken an objective."); if(%oldTeam != -1) TeamMessages(1, %oldTeam, "The " @ getTeamName(%playerTeam) @ " team has taken your objective.~wLostTower.wav"); ObjectiveMission::ObjectiveChanged(%this); }
// Start Shugo Code
%client = Player::getClient(%object); %Team = Client::getTeam(%client); if(GameBase::getMapName(%this) == "Switch <!>") { messageAll(0,Client::getName(%client) @ " got the <!> Switch!!"); messageAllExcept(Client::getTeam(%client), "Your team lost the <!> Switch!"); %playerTeam.Switch1 = true; } if(GameBase::getMapName(%this) == "Switch |WAR|") { messageAll(0,Client::getName(%client) @ " got the |WAR| Switch!!"); messageAllExcept(Client::getTeam(%client), "Your team lost the |WAR| Switch!"); %playerTeam.Switch2 = true; } if(GameBase::getMapName(%this) == "Switch TE") { messageAll(0,Client::getName(%client) @ " got the TE Switch!!"); messageAllExcept(Client::getTeam(%client), "Your team lost the TE Switch!"); %playerTeam.Switch4 = true; } if(%playerTeam.Switch1 && %playerTeam.Switch2 && %playerTeam.Switch3) { ObjectiveMission::setObjectiveHeading(); if(%playerTeam.Switch1 == "false" || %playerTeam.Switch2 == "false" || %playerTeam.Switch3 == "false") { return; } schedule("ObjectiveMission::missionComplete();", 10);//if ya want 10min type 10*60 where it just says 10 }
// End Shugo Code
ObjectiveMission::checkScoreLimit(); } |
Just a guess though.
|
|
|
|
|
|
|
|
|
|
|
|
|
Author |
Message |
TE-Shugo
Joined: Mon Sep 05, 2005 12:21 am Posts: 70 Location: YaY ArEa, CaLiForNia
|
Posted: Tue Jan 03, 2006 3:52 pm Post subject:
|
|
|
try
Code: | //fixed so cham can't claim for enemy team.. -Plasmatic function TowerSwitch::onCollision(%this, %object) { if($debug) event::collision(%this,%object);
%playerClient = Player::getClient(%object); if(getObjectType(%object) != "Player" || %playerClient.isSpy || Player::isDead(%object)) return;
%playerTeam = GameBase::getTeam(%object); %oldTeam = GameBase::getTeam(%this); if(%oldTeam == %playerTeam) return;
%this.trainingObjectiveComplete = true; %touchClientName = Client::getName(%playerClient); %group = GetGroup(%this); Group::iterateRecursive(%group, GameBase::setTeam, %playerTeam);
%dropPoints = nameToID(%group @ "/DropPoints"); %oldDropSet = nameToID("MissionCleanup/TeamDrops" @ %oldTeam); %newDropSet = nameToID("MissionCleanup/TeamDrops" @ %playerTeam);
$deltaTeamScore[%oldTeam] -= %this.deltaTeamScore; $deltaTeamScore[%playerTeam] += %this.deltaTeamScore; $teamScore[%oldTeam] -= %this.scoreValue; $teamScore[%playerTeam] += %this.scoreValue;
if(%dropPoints != -1) { for(%i = 0; (%dropPoint = Group::getObject(%dropPoints, %i)) != -1; %i++) { if(%oldDropSet != -1) removeFromSet(%oldDropSet, %dropPoint); addToSet(%newDropSet, %dropPoint); } }
if(%oldTeam == -1) { MessageAllExcept(%playerClient, 0, %touchClientName @ " claimed " @ %this.objectiveName @ " for the " @ getTeamName(%playerTeam) @ " team!"); Client::sendMessage(%playerClient, 0, "You claimed " @ %this.objectiveName @ " for the " @ getTeamName(%playerTeam) @ " team!"); } else { if(%this.objectiveLine) { MessageAllExcept(%playerClient, 0, %touchClientName @ " captured " @ %this.objectiveName @ " from the " @ getTeamName(%oldTeam) @ " team!"); Client::sendMessage(%playerClient, 0, "You captured " @ %this.objectiveName @ " from the " @ getTeamName(%oldTeam) @ " team!"); %this.numSwitchTeams++; schedule("TowerSwitch::timeLimitCheckPoints(" @ %this @ "," @ %playerClient @ "," @ %this.numSwitchTeams @ ");",60); } } if(%this.objectiveLine) { TeamMessages(1, %playerTeam, "Your team has taken an objective.~wCapturedTower.wav"); TeamMessages(0, %playerTeam, "The " @ getTeamName(%playerTeam) @ " has taken an objective."); if(%oldTeam != -1) TeamMessages(1, %oldTeam, "The " @ getTeamName(%playerTeam) @ " team has taken your objective.~wLostTower.wav"); ObjectiveMission::ObjectiveChanged(%this); }
// Start Shugo Code
%client = Player::getClient(%object); %Team = Client::getTeam(%client); if(GameBase::getMapName(%this) == "Switch <!>") { messageAll(0,Client::getName(%client) @ " got the <!> Switch!!"); messageAllExcept(Client::getTeam(%client), "Your team lost the <!> Switch!"); %playerTeam.Switch1 = true; } if(GameBase::getMapName(%this) == "Switch |WAR|") { messageAll(0,Client::getName(%client) @ " got the |WAR| Switch!!"); messageAllExcept(Client::getTeam(%client), "Your team lost the |WAR| Switch!"); %playerTeam.Switch2 = true; } if(GameBase::getMapName(%this) == "Switch TE") { messageAll(0,Client::getName(%client) @ " got the TE Switch!!"); messageAllExcept(Client::getTeam(%client), "Your team lost the TE Switch!"); %playerTeam.Switch4 = true; } if(%playerTeam.Switch1 && %playerTeam.Switch2 && %playerTeam.Switch3) { //ObjectiveMission::setObjectiveHeading(); if(%playerTeam.Switch1 == "false" || %playerTeam.Switch2 == "false" || %playerTeam.Switch3 == "false") { return; } schedule("ObjectiveMission::missionComplete();", 10);//if ya want 10min type 10*60 where it just says 10 }
// End Shugo Code
ObjectiveMission::checkScoreLimit(); } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum
|
|
|
|
|
|
| |