Updated Commands.

This commit is contained in:
Drajiel 2016-08-11 20:02:01 -04:00
parent 0c435d91c9
commit 09705bec4e
15 changed files with 302 additions and 59 deletions

View file

@ -1,13 +1,35 @@
require("global");
properties = {
permissions = 0,
parameters = "sss",
description = "<stop> <walk> <run> speed",
description =
[[
Set movement speed for player. Enter no value to reset to default.
!speed <run> |
!speed <stop> <walk> <run> |
]]
}
function onTrigger(player, argc, stop, walk, run)
if argc == 1 then
s = 0;
w = (tonumber(stop) / 2);
r = tonumber(stop);
player:ChangeSpeed(s, w, r);
player:SendMessage(MESSAGE_TYPE_SYSTEM_ERROR, "[speed]", string.format("Speed set to 0/%u/%u", w,r));
elseif argc == 3 then
stop = tonumber(stop) or 0;
walk = tonumber(walk) or 2;
run = tonumber(run) or 5;
player:ChangeSpeed(stop, walk, run);
player:SendMessage(MESSAGE_TYPE_SYSTEM_ERROR, "[speed]", string.format("Speed set to %u/%u/%u", stop, walk, run));
else
player:ChangeSpeed(0.0, 2.0, 5.0);
end
end;