2016-06-17 05:05:31 +01:00
|
|
|
require("global");
|
|
|
|
|
|
|
|
properties = {
|
|
|
|
permissions = 0,
|
|
|
|
parameters = "ssss",
|
2016-08-11 20:02:01 -04:00
|
|
|
description =
|
|
|
|
[[
|
|
|
|
Change the weather visual to <id> and optional <transition> for player.
|
|
|
|
!weather <id> |
|
|
|
|
!weather <id> <transition> |
|
|
|
|
]],
|
2016-06-17 05:05:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function onTrigger(player, argc, weather, updateTime, zonewide)
|
|
|
|
-- todo: change weather
|
|
|
|
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
|
|
|
local sender = "[weather] ";
|
|
|
|
local message = "unable to change weather";
|
|
|
|
|
|
|
|
if player then
|
|
|
|
weather = tonumber(weather) or 0;
|
|
|
|
updateTime = tonumber(updateTime) or 0;
|
|
|
|
zonewide = tonumber(zonewide) or 0;
|
2016-08-11 20:02:01 -04:00
|
|
|
message = string.format("changed weather to %u ", weather);
|
|
|
|
|
2016-06-17 05:05:31 +01:00
|
|
|
if zonewide ~= 0 then
|
|
|
|
message = string.format(message.."for zone %u", player:GetZoneID());
|
|
|
|
else
|
2017-03-07 08:32:57 -05:00
|
|
|
message = message..player:GetName();
|
2016-06-17 05:05:31 +01:00
|
|
|
end;
|
2016-08-11 20:02:01 -04:00
|
|
|
|
2016-06-17 05:05:31 +01:00
|
|
|
-- weatherid, updateTime
|
|
|
|
player:GetZone():ChangeWeather(weather, updateTime, player, zonewide ~= 0);
|
|
|
|
player:SendMessage(messageID, sender, message);
|
|
|
|
end;
|
|
|
|
print(sender..message);
|
|
|
|
end;
|