2019-06-19 01:10:15 -04:00
|
|
|
require("global");
|
|
|
|
|
|
|
|
properties = {
|
|
|
|
permissions = 0,
|
|
|
|
parameters = "d",
|
|
|
|
description = "Spawns a actor",
|
|
|
|
}
|
|
|
|
|
|
|
|
function onTrigger(player, argc, actorClassId, width, height)
|
|
|
|
|
2022-02-08 17:35:29 -05:00
|
|
|
if (actorClassId == nil) then
|
|
|
|
player:SendMessage(0x20, "", "No actor class id provided.");
|
|
|
|
return;
|
|
|
|
end
|
2019-06-19 01:10:15 -04:00
|
|
|
|
|
|
|
local pos = player:GetPos();
|
2022-01-28 02:29:45 -05:00
|
|
|
local x = pos[1];
|
|
|
|
local y = pos[2];
|
|
|
|
local z = pos[3];
|
|
|
|
local rot = pos[4];
|
|
|
|
local zone = pos[5];
|
2019-06-19 01:10:15 -04:00
|
|
|
|
|
|
|
actorClassId = tonumber(actorClassId);
|
|
|
|
|
2022-02-05 18:00:09 -05:00
|
|
|
if (actorClassId ~= nil) then
|
2019-06-19 01:10:15 -04:00
|
|
|
local w = tonumber(width) or 0;
|
|
|
|
local h = tonumber(height) or 0;
|
|
|
|
printf("%f %f %f", x, y, z);
|
|
|
|
--local x, y, z = player.GetPos();
|
|
|
|
for i = 0, w do
|
|
|
|
for j = 0, h do
|
2022-02-08 17:35:29 -05:00
|
|
|
actor = player.CurrentArea:SpawnActor(actorClassId, "test", x + (i - (w / 2) * 3), y, z + (j - (h / 2) * 3), rot);
|
2019-06-19 01:10:15 -04:00
|
|
|
actor.SetAppearance(1001149)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if (actor == nil) then
|
|
|
|
player:SendMessage(0x20, "", "This actor class id cannot be spawned.");
|
|
|
|
end
|
|
|
|
|
|
|
|
end;
|