Special
Actions

Advanced actions and custom commands for special scenarios

Overview

Special actions are advanced commands and configurations that go beyond basic item giving and command execution. These actions provide more complex functionality for specific scenarios and advanced server management.

Delayed Actions

Execute actions with a delay to create more dynamic experiences:

Basic Delayed Actions

Delayed Action Example
// Give initial items immediately
give %player% weapon_ak47 1
give %player% ammo_rifle 100

// Give bonus items after 30 seconds
delay 30 give %player% weapon_awp 1
delay 30 give %player% ammo_sniper 50

// Give final reward after 60 seconds
delay 60 give %player% weapon_deagle 1
delay 60 give %player% ammo_pistol 50

Progressive Rewards

Progressive Reward System
// Immediate reward
give %player% weapon_pistol 1
give %player% ammo_pistol 50

// 1 minute later
delay 60 give %player% weapon_rifle 1
delay 60 give %player% ammo_rifle 100

// 5 minutes later
delay 300 give %player% weapon_awp 1
delay 300 give %player% ammo_sniper 50

// 10 minutes later
delay 600 give %player% weapon_knife 1
delay 600 give %player% armor_kevlar 1

Conditional Actions

Execute actions based on specific conditions:

Player Level Conditions

Level-Based Actions
// Check player level and give appropriate items
if %player_level% >= 50 then
    give %player% weapon_awp 1
    give %player% ammo_sniper 100
else
    give %player% weapon_ak47 1
    give %player% ammo_rifle 100
endif

Time-Based Conditions

Time-Based Actions
// Different rewards based on time of day
if %current_hour% >= 18 then
    give %player% weapon_awp 1
    give %player% ammo_sniper 100
    message %player% "Evening bonus: Sniper rifle!"
else
    give %player% weapon_ak47 1
    give %player% ammo_rifle 100
    message %player% "Standard reward: Assault rifle!"
endif

Multi-Server Actions

Execute actions across multiple servers:

Cross-Server Rewards

Multi-Server Actions
// Give items on multiple servers
server "survival" give %player% weapon_ak47 1
server "creative" give %player% weapon_awp 1
server "pvp" give %player% weapon_deagle 1

// Give currency on all servers
server "all" give %player% currency 10000

// Give permissions across servers
server "all" give %player% permission "vip.access"

Custom Plugin Actions

Integrate with custom server plugins:

Economy Plugin Integration

Economy Plugin Actions
// Give money through economy plugin
eco give %player% 10000

// Give bank account balance
bank give %player% 5000

// Give shop credits
shop give %player% credits 1000

// Give auction house credits
auction give %player% credits 500

Rank Plugin Integration

Rank Plugin Actions
// Set player rank
rank set %player% vip

// Give rank permissions
rank give %player% permission "vip.access"
rank give %player% permission "vip.weapons"

// Set rank expiration
rank set %player% vip 30d

// Give rank with custom prefix
rank set %player% vip "&6[VIP] &f"

Advanced Command Sequences

Execute complex sequences of commands:

Package Delivery Sequence

Delivery Sequence
// Notify player of incoming package
message %player% "Package delivery incoming in 10 seconds..."

// Wait and give items
delay 10 give %player% weapon_ak47 1
delay 10 give %player% ammo_rifle 100
delay 10 give %player% armor_kevlar 1

// Notify completion
delay 10 message %player% "Package delivered successfully!"

// Give bonus for patience
delay 15 give %player% weapon_deagle 1
delay 15 message %player% "Bonus reward for your patience!"

Error Handling Actions

Handle errors and provide fallbacks:

Fallback Actions

Error Handling
// Try to give premium weapon
try
    give %player% weapon_awp 1
catch
    // Fallback to standard weapon
    give %player% weapon_ak47 1
    message %player% "Premium weapon unavailable, giving standard weapon instead"
endtry

Performance Optimization

Optimize actions for better performance:

Batch Actions

Batch Processing
// Batch multiple items in one command
give %player% weapon_ak47 1,ammo_rifle 100,armor_kevlar 1,weapon_deagle 1

// Batch permissions
permission give %player% vip.access,vip.weapons,vip.armor

// Batch currency
currency give %player% money 10000,credits 1000,points 500

Monitoring and Logging

Monitor and log special actions:

Action Logging

Logging Actions
// Log action execution
log "Special action executed for player %player%: VIP package"

// Log with details
log "Player %player% received VIP package: weapon_awp, ammo_sniper, armor_kevlar"

// Log to specific file
logfile "donations.log" "VIP package given to %player% at %timestamp%"

Best Practices

  • Test Thoroughly: Always test special actions on a staging server
  • Document Actions: Keep documentation of complex action sequences
  • Monitor Performance: Watch for performance impacts of complex actions
  • Error Handling: Include proper error handling and fallbacks
  • Logging: Implement comprehensive logging for troubleshooting
Tip: Special actions can significantly enhance the player experience but should be used judiciously to avoid server performance issues.