-
-
Save ottworks/7651f94cc8389217f645 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. Fixed up the code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maestro.command("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 $%2 to %1's wallet" | |
end, [[Gives a player money.]]) | |
maestro.command("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 $%2" | |
end, [[Sets a player's wallet amount.]]) | |
maestro.command("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 not ply:isArrested() then | |
ply:arrest(num, caller) | |
end | |
end | |
return false, " arrested %1" | |
end, [[Arrests the player.]]) | |
maestro.command("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