local groupName = 'PSP';
--{x, y, z, 'trawa'},
local fireCoords = {
{-2817.48975,337.68900,4.50193,'Obok Remizy !'},
{-1631.48450,-2233.72510,31.47656,'Domku Le?nego Las SF!'},
{-2819.75391,-1630.67822,141.47678,'G?ra Chillad obok domku przy drodze ma?y lasek'},
{-1935.32434,-81.22784,25.71094,'Przejazd kolejowy Doherty SF!'},
{314.26550,-1769.42053,4.60265,'Domu Pla?a LS!'},
{-2426.08447,1532.98340,26.04688,'Na statku SF! Bay'},
{-2553.37646,629.54456,29.63732,'Pojazdu konkretnie Ambulansu Santa Flora Szpital SF'},
{-2659.78809,1419.04797,26.23772,'Dachu Klubu Battery Point SF (obok komendy SAPD)'},
{2198.07642,2479.71118,10.82031,'Stacji Benzynowej! The Emerald Isle LV!'},
{-2416.26660,-638.93677,144.39293,'Drzewa! Spawn SF (Missionary Hill)'},
{-2529.19824,-703.60870,139.32031,'Transformatora ! (Mssionary Hill stacja radiowa tam gdzie spawn sf)'},
{-2064.68628,-194.86028,35.32031,'Zieleni Osiedle Doherty SF'},
{-1588.09253,1206.16553,21.21069,'S?upa Energetycznego Esplanade East SF (obok szpitala, naprzeciwko salonu)'},
{1188.79199,-2034.27881,69.00781,'?awki Park LS (dzielnica Vedant Bluffs)'},
{-1710.19177,-994.38525,73.84789,'Lasu SF obok autostrady (obok MH)'},
{-2075.54858,167.10406,42.36030,'Drzewa, Obok domu! Osiedle sf (Doherty)'},
{-2086.65356,164.14047,40.83402,'Dachu, budynku mieszkalnego!, Osiedle sf Doherty)'},
};
addEvent('attemptDestroyFire', true);
addEvent('attemptRandomFire', true);
local function createMyFire(x, y, z)
local colshape = ColShape.Sphere(x, y, z, 2)
triggerClientEvent('attemptCreateFire', root, colshape);
return colshape;
end
local function createRandomFire()
local posID = math.random(1, #fireCoords);
for i=1,8 do
createMyFire(fireCoords[posID][1] + i, fireCoords[posID][2] + i, fireCoords[posID][3]);
createMyFire(fireCoords[posID][1] - i, fireCoords[posID][2] + i, fireCoords[posID][3]);
createMyFire(fireCoords[posID][1] + i, fireCoords[posID][2] - i, fireCoords[posID][3]);
createMyFire(fireCoords[posID][1] - i, fireCoords[posID][2] - i, fireCoords[posID][3]);
end
outputChatBox('Po?ar : '..fireCoords[posID][4])
end
addEventHandler('onColShapeHit', root, function(hitElement)
if (not hitElement.type == 'ped') and (not hitElement.dimension == source.dimension) then return end
local group = ACLGroup.get(groupName);
if not isObjectInACLGroup('user.'..hitElement.account.name, group) then
hitElement:setOnFire(true);
end
end);
addEventHandler('attemptDestroyFire', root, function(colshape)
local group = ACLGroup.get(groupName);
if not isObjectInACLGroup('user.'..source.account.name, group) then return end
if isElement(colshape) then
destroyElement(colshape);
end
local cols = #getElementsByType('colshape', resourceRoot);
if cols == 0 then
Timer(function() createRandomFire() end, 900000, 1);
end
end);
addEventHandler('attemptRandomFire', root, function()
createRandomFire();
end);
addCommandHandler('testfire', function(player)
local posVec = player.position;
local colshape = createMyFire(posVec.x, posVec.y, posVec.z);
--Timer(function() colshape:destroy(); player:outputChat('Zgaszono ogie?') end, 15000, 1);
end);