set g_sandbox_storage_autosave 5 "storage is automatically saved every specified number of seconds"
set g_sandbox_storage_autoload 1 "if a storage file exists for the given map, automatically load it at startup"
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_free 1 "0 = players can only copy or edit their own objects, 1 = players can copy but not edit other objects, 2 = players can copy and edit all object"
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"
set g_sandbox_object_scale_min 0.1 "minimum scale that objects can be set to"
return trace_ent; // don't check permissions, anyone can edit this object
if(!trace_ent.crypto_idfp)
return trace_ent; // the player who spawned this object did not have an UID, so anyone can edit it
- if not(trace_ent.crypto_idfp != self.crypto_idfp && !autocvar_g_sandbox_editor_free)
+ if not(trace_ent.crypto_idfp != self.crypto_idfp && autocvar_g_sandbox_editor_free < 2)
return trace_ent; // object does not belong to the player, and players can only edit their own objects on this server
return world;
}
{
case "copy":
// copies customizable properties of the selected object to the clipboard
- e = sandbox_ObjectEdit_Get(TRUE); // you can only copy objects you can edit, so this works
+ e = sandbox_ObjectEdit_Get(autocvar_g_sandbox_editor_free); // can we copy objects we can't edit?
if(e != world)
{
if(self.object_clipboard)