Skip to content

Instantly share code, notes, and snippets.

@andreblue
Created October 4, 2015 03:12
Show Gist options
  • Save andreblue/ccc2b3801a457bf428dd to your computer and use it in GitHub Desktop.
Save andreblue/ccc2b3801a457bf428dd to your computer and use it in GitHub Desktop.
A simple set of commands for use with maestro admin mod to do some common darkrp commands
maestro.command("rp_addmoney", {"player:target", "number"}, function(caller, targets, num)
if #targets == 0 then
return true, "Query matched no players."
end
for i = 1, #targets do
local ply = targets[i]
ply:addMoney(num)
end
return false, "added $"..num.." to %1's wallet"
end, [[Gives a player money.]])
maestro.command("rp_setmoney", {"player:target", "number"}, function(caller, targets, num)
if #targets == 0 then
return true, "Query matched no players."
end
for i = 1, #targets do
local ply = targets[i]
ply:addMoney(-ply:getDarkRPVar("money"))
ply:addMoney(num)
end
return false, "set %1's wallet to $"..num
end, [[Sets a player's wallet amount.]])
maestro.command("rp_arrest", {"player:target", "number:optional"}, function(caller, targets, num)
if #targets == 0 then
return true, "Query matched no players."
end
if num == nil then
num = GAMEMODE.Config.jailtimer
end
for i = 1, #targets do
local ply = targets[i]
if !ply:isArrested() then
ply:arrest(num, caller)
end
end
return false, " arrested %1"
end, [[Arrests the player.]])
maestro.command("rp_unarrest", {"player:target"}, function(caller, targets)
if #targets == 0 then
return true, "Query matched no players."
end
for i = 1, #targets do
local ply = targets[i]
if ply:isArrested() then
ply:unArrest(caller)
end
end
return false, " released %1 from jail"
end, [[Releases the player.]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment