set g_sandbox 0 "allow players to spawn and edit objects around the map"
set g_sandbox_info 1 "print object information to the server. 1 prints info about spawned / removed objects, 2 also prints info about edited objects"
+set g_sandbox_readonly 0 "when this mode is active, players cannot modify objects or use any sandbox commands"
set g_sandbox_storage_name default "name of the selected storage to use"
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"
float autocvar_g_grab;
float autocvar_g_grab_range;
float autocvar_g_sandbox_info;
+float autocvar_g_sandbox_readonly;
string autocvar_g_sandbox_storage_name;
float autocvar_g_sandbox_storage_autosave;
float autocvar_g_sandbox_storage_autoload;
entity e;
// decide if and how this object can be grabbed
- if(autocvar_g_sandbox_editor_free < 2 && self.crypto_idfp)
- self.grab = 1;
+ if(autocvar_g_sandbox_readonly)
+ self.grab = 0; // no grabbing
+ else if(autocvar_g_sandbox_editor_free < 2 && self.crypto_idfp)
+ self.grab = 1; // owner only
else
- self.grab = 3;
+ self.grab = 3; // anyone
// Object owner is stored via player UID, but we also need the owner as an entity (if the player is available on the server).
// Therefore, scan for all players, and update the owner as long as the player is present. We must always do this,
return FALSE;
if(cmd_name == "g_sandbox")
{
+ if(autocvar_g_sandbox_readonly)
+ {
+ print_to(self, "^2SANDBOX - INFO: ^7Sandbox mode is active, but in read-only mode. Sandbox commands cannot be used");
+ return TRUE;
+ }
if(cmd_argc < 2)
{
- print_to(self, "Sandbox mode is active. For usage information, type 'sandbox help'");
+ print_to(self, "^2SANDBOX - INFO: ^7Sandbox mode is active. For usage information, type 'sandbox help'");
return TRUE;
}