Actions -
Garry's Mod
Configure actions and commands for Garry's Mod servers
Overview
Garry's Mod offers extensive customization options for donation actions. You can execute console commands, run custom LUA scripts, manage player groups, and integrate with popular addons like DarkRP and Pointshop.
Console Command
Execute server console commands when a donation is made.
Basic Console Commands
Code
// Give player a weapon
give %player% weapon_ak47 1
// Give player money (DarkRP)
addmoney %player% 10000
// Set player health
sethealth %player% 100
// Give player armor
setarmor %player% 100
Advanced Console Commands
Code
// Teleport player to spawn
teleport %player% 0 0 0
// Give player admin for 1 hour
ulx adduser %player% admin
ulx adduser %player% admin 60
// Set player model
setmodel %player% models/player/kleiner.mdl
Custom LUA
Execute custom LUA scripts for advanced functionality.
Basic LUA Examples
Code
// Give player a custom weapon with modifications
local ply = player.GetBySteamID("%player%")
if IsValid(ply) then
local wep = ply:Give("weapon_ak47")
if IsValid(wep) then
wep:SetClip1(30)
wep:SetClip2(120)
end
end
Advanced LUA Examples
Code
// Create a custom vehicle for the player
local ply = player.GetBySteamID("%player%")
if IsValid(ply) then
local vehicle = ents.Create("prop_vehicle_jeep")
vehicle:SetModel("models/buggy.mdl")
vehicle:SetPos(ply:GetPos() + Vector(0, 0, 50))
vehicle:Spawn()
ply:EnterVehicle(vehicle)
end
Add To Group
Add players to specific user groups for permissions and access.
ULX Groups
Code
// Add to VIP group
ulx adduser %player% vip
// Add to admin group
ulx adduser %player% admin
// Add to moderator group
ulx adduser %player% moderator
Custom Groups
Code
// Add to custom group
ulx adduser %player% donator
// Add with time limit (in minutes)
ulx adduser %player% premium 1440
DarkRP Actions
Integrate with DarkRP for roleplay server functionality.
DarkRP Money
Code
// Give player money
addmoney %player% 50000
// Set player money
setmoney %player% 100000
DarkRP Jobs
Code
// Set player job
setjob %player% "Gun Dealer"
// Set player job with salary
setjob %player% "VIP Citizen" 100
Pointshop Actions
Integrate with Pointshop addons for item purchases.
Pointshop 1
Code
// Give points
ps_givepoints %player% 1000
// Give specific item
ps_giveitem %player% "weapon_ak47"
Pointshop 2
Code
// Give standard points
ps2_givepoints %player% 1000
// Give premium points
ps2_givepremiumpoints %player% 100
// Give specific item
ps2_giveitem %player% "weapon_ak47"
Chat Messages
Send messages to players or the entire server.
Send Chat Message to Buyer
Code
// Send message to the buyer
say %player% Thank you for your donation!
// Send colored message
say %player% [DONATE] Thank you for supporting the server!
Send Chat Message to All Players
Code
// Announce donation to all players
say %player_name% has just donated and received %package_name%!
// Server-wide announcement
say [SERVER] %player_name% has donated $%package_price%! Thank you!
Best Practices
- Test Commands: Always test commands on a test server first
- Use Variables: Utilize %player% and other variables for dynamic actions
- Error Handling: Consider what happens if a command fails
- Performance: Avoid commands that could lag the server
- Documentation: Keep track of what each command does
Important: Be careful with commands that could affect server stability. Always test thoroughly before making packages available to players.