-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.cs
52 lines (39 loc) · 881 Bytes
/
commands.cs
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
43
44
45
46
47
48
49
50
51
52
function serverCmdBTZ(%client, %operator, %arg1, %arg2, %arg3, %arg4, %arg5)
{
if(!%client.isAdmin)
return;
if(%operator $= "")
{
%client.chatMessage("\c6invalid operator");
%client.chatMessage("\c6ops: save, load, deleteAll, debug, Place (p) arg: >1 is size, Delete (d)");
return;
}
switch$(%operator)
{
case "save":
BTZ_save();
case "load":
BTZ_load();
case "deleteAll":
BTZ_deleteAll();
case "debug":
BTZ_ToggleDebug();
default:
%noOperator = true;
}
if(!%noOperator)
return;
//selection box operations
%box = %client.NDSelectionBox.outerBox;
if(!isObject(%box))
return;
%position = %box.getPosition();
%scale = %box.getScale();
switch$(%operator)
{
case "Place" or "P":
BTZ_addZone(%position, %scale, %arg1);
case "Delete" or "D":
BTZ_DeleteZone(%position, vectorSub(%scale, "0.05 0.05 0.05"));
}
}