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
- Player Purchase: A player completes a donation and selects a package
- Payment Processing: The payment is processed through your chosen payment gateway
- Action Execution: Nexus Donate sends the configured commands to your game server
- 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
- In your admin panel, go to Package Manager
- Create a new package or edit an existing one
- Enable "User Choice" option
- Add multiple choice options with different commands
- 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.