-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.cs
More file actions
42 lines (36 loc) · 872 Bytes
/
package.cs
File metadata and controls
42 lines (36 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package Script_BotToggleZones
{
function fxDTSBrick::onHoleSpawnPlanted(%obj)
{
%parent = parent::onHoleSpawnPlanted(%obj);
%pos = %obj.getPosition();
for(%i = 0; %i < $BTZ::NumZones; %i++)
{
%ZonePos = $BTZ::ZonePos[%i];
%ZoneScale = $BTZ::ZoneScale[%i];
if(BTZ_posInBox3D(%pos, %ZonePos, %ZoneScale))
{
$BTZ::ZoneSet[%i].add(%obj);
%obj.zoneIndex = %i;
break;
}
}
return %parent;
}
function fxDTSBrick::spawnHoleBot(%obj)
{
%parent = parent::spawnHoleBot(%obj);
//return is 0 or the new playerid
if(%parent && %obj.zoneIndex !$= "")
{
%parent.setNetFlag(6, 1);
%index = %obj.zoneIndex;
%set = $BTZ::ZoneObj[%index].occupants;
%count = %set.getCount();
for(%i = 0; %i < %count; %i++)
%parent.scopeToClient(%set.getObject(%i));
}
return %parent;
}
};
activatePackage(Script_BotToggleZones);