Multiple fires on house area - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Multiple fires on house area (
/showthread.php?tid=550895)
Multiple fireobjects itself creating on restricted area -
MacT - 15.12.2014
Hey SA-MP Forums!
I basically think how make its possible too create multiple fires objects on house area or saved zone on arrays. Like Gasstatsion.
1. I started think its possible, if I use fire object with createdynamicobjectex like looping timer withmake new object near old one. Like in real life.
pawn Код:
stock RandPosInArea( Float: minx, Float: miny, Float: maxx, Float: maxy, &fDestX, &fDestY )
{
new
iMin, iMax,
Float:mul = floatpower(10.0, 4)
;
iMin = floatround(minx * mul);
iMax = floatround(maxx * mul);
fDestX = float(random(iMax - iMin) + iMin) / mul;
iMin = floatround(miny * mul);
iMax = floatround(maxy * mul);
fDestY = float(random(iMax - iMin) + iMin) / mul;
}
3. Timer with function what checks DistanceBetweenObects and if 0 when make new object else takes old object ppos and make new to near.
Regards,
MacT!