set g_sandbox 0 "allow players to spawn and edit objects around the map"
set g_sandbox_info 1 "print non-critical information to the server"
-set g_sandbox_editor_maxobjects 100 "maximum number of objects a player can have at a time"
+set g_sandbox_editor_maxobjects 1000 "maximum number of objects that may exist at a time"
set g_sandbox_editor_free 0 "when enabled, players can edit any object on the map, not just the objects they've spawned"
set g_sandbox_editor_distance_spawn 200 "distance at which objects spawn in front of the player"
set g_sandbox_editor_distance_edit 350 "distance at which players can edit or remove objects they are looking at"
+float object_count;
.string object_clipboard;
.entity object_attach;
-.float object_count;
.string material;
.float touch_timer;
setorigin(e, trace_endpos);
e.angles_y = self.v_angle_y;
- self.object_count += 1; // TODO: Adapt this to crypto_idfp based players!
-
+ object_count += 1;
return e;
}
void sandbox_RemoveObject(entity e)
{
- self.object_count -= 1; // TODO: Adapt this to crypto_idfp based players!
-
if(e.material)
{
strunzone(e.material);
}
remove(e);
e = world;
+
+ object_count -= 1;
}
string sandbox_Storage_Save(entity e)
// ---------------- COMMAND: SPAWN OBJECT ----------------
case "spawn_object":
- if(self.object_count >= autocvar_g_sandbox_editor_maxobjects)
+ if(object_count >= autocvar_g_sandbox_editor_maxobjects)
{
- print_to(self, strcat("WARNING: Cannot spawn any more objects. Each player may have up to ^3", ftos(autocvar_g_sandbox_editor_maxobjects), " ^7objects at a time"));
+ print_to(self, strcat("WARNING: Cannot spawn any more objects. Up to ^3", ftos(autocvar_g_sandbox_editor_maxobjects), " ^7objects may exist at a time"));
return TRUE;
}
if(cmd_argc < 3)
print_to(self, "WARNING: No object in clipboard. You must copy an object before you can paste it");
return TRUE;
}
- if(self.object_count >= autocvar_g_sandbox_editor_maxobjects)
+ if(object_count >= autocvar_g_sandbox_editor_maxobjects)
{
- print_to(self, strcat("WARNING: Cannot spawn any more objects. Each player may have up to ^3", ftos(autocvar_g_sandbox_editor_maxobjects), " ^7objects at a time"));
+ print_to(self, strcat("WARNING: Cannot spawn any more objects. Up to ^3", ftos(autocvar_g_sandbox_editor_maxobjects), " ^7objects may exist at a time"));
return TRUE;
}