misticos
Execute commands when player enters a zone

Supported Games
GameServerKingsGameServerKings
depends on
works with

TL;DR

Create a configuration for a zone with zc create [Zone ID] and edit the file created. For possible values and explanations refer to the Explanations section under Data-Files.

Permissions

  • zonecommand.command - Allows using the commands.

Commands

  • zc create [Zone ID] - Create a datafile with Zone ID specified.

Configuration

Default Configuration

{
  "Commands": [
    "zone",
    "zonecommand",
    "zc"
  ]
}

Data-Files

ZoneCommand and ZoneCommandMeta

Zone Command Meta contains per-zone information on when players have entered it last time. You should delete it every wipe.

Zone Command contains your actual configuration values. File names of these files may and should be changed for your own convenience.

Default Data-File

{
  "Zone ID": "",
  "Actions": [
    {
      "Frequency": "Always",
      "Time Frequency": null,
      "Use Game Time": false,
      "Run On": "Enter",
      "Commands": [
        {
          "Command": "",
          "Arguments": [],
          "Clientside": false,
          "Chat Command": false
        }
      ]
    }
  ]
}

Explanations

Zone ID - Your zone ID.

Actions - List of actions to perform whenever necessary.

Frequency - How often it should be ran. One of Once, Always and PerPlayer.

Time Frequency - Minimum time to pass between actions performed in C# format, such as d.hh:mm:ss.

Use Game Time - Whether to use in-game time for Time Frequency.

Run On - When to run the action. One of Enter and Exit.

Commands - List of commands to be executed.

Command - The actual command, such as oxide.grant.

Arguments - List of arguments, such as "user", 7656119.. and "permission_name" .

Clientside - Whether to run this command on the client side.

Chat Command - Whether this command is a chat one. Removes the need for chat.say and /. Only usable with Clientside.

Placeholders (Player ID and such)

If you want to use placeholders, you should install Placeholder API and use its placeholders, such as {player.id}.

Localization

English

{
  "No Permission": "You do not have enough permissions",
  "Command: Syntax": "Syntax:\ncreate [Zone ID] - Create a datafile",
  "Command: Create: Done": "Created a datafile: /oxide/data/ZoneCommand/{filename}.json (You can rename it)"
}

Credits

  • deer_SWAG - The author of first major versions of the plugin.

MIT License


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.