About
Commands/Actions

Understanding how commands and actions work in Nexus Donate

Overview

Commands and actions are the core functionality of Nexus Donate. When a player makes a donation and purchases a package, the system executes predefined commands or actions on your game server to deliver the purchased items or benefits.

How Commands/Actions Work

  1. Player Purchase: A player completes a donation and selects a package
  2. Payment Processing: The payment is processed through your chosen payment gateway
  3. Action Execution: Nexus Donate sends the configured commands to your game server
  4. Delivery: The server executes the commands and delivers the purchased items

Command Variables

Nexus Donate supports various variables that can be used in commands to personalize the delivery:

Code
%player% - The player's Steam ID or username
%player_name% - The player's display name
%package_name% - The name of the purchased package
%package_price% - The price paid for the package
%transaction_id% - Unique transaction identifier
%server_ip% - The server's IP address
%server_port% - The server's port number

Example Usage

Code
give %player% weapon_ak47 1
say %player_name% has purchased %package_name%!
addmoney %player% %package_price%

Creating User Choices

You can create packages that allow users to choose from multiple options:

Setting Up Choices

  1. In your admin panel, go to Package Manager
  2. Create a new package or edit an existing one
  3. Enable "User Choice" option
  4. Add multiple choice options with different commands
  5. Set the choice display text and command for each option

Choice Example

For a "Weapon Package" you might offer:

  • AK-47: give %player% weapon_ak47 1
  • M4A1: give %player% weapon_m4a1 1
  • AWP: give %player% weapon_awp 1

Action Types by Game

Different games support different types of actions:

Garry's Mod

  • Console Commands
  • Custom LUA Scripts
  • Group Management
  • DarkRP Integration
  • Pointshop Integration
  • Chat Messages

Minecraft

  • Console Commands
  • Plugin Commands

Rust

  • Custom Commands
  • Item Giving
  • Blueprint Unlocking

Best Practices

  • Test Commands: Always test commands on a test server first
  • Use Variables: Utilize variables to make commands dynamic
  • Error Handling: Consider what happens if a command fails
  • Security: Be careful with commands that could affect server stability
  • Documentation: Keep track of what each command does
Important: Always test your commands thoroughly before making packages available to players. Incorrect commands can cause server issues or fail to deliver purchased items.