pawn Код:
#include <a_samp>
#define TYPE 7
#define RADIUS 15.0
enum Explosions
{
Float: X,
Float: Y,
Float: Z
}
new Coords[][Explosions] =
{
{234.234234, 234234.234234, 234234.234234},
{234.234234, 234234.234234, 234234.234234},
{234.234234, 234234.234234, 234234.234234},
{234.234234, 234234.234234, 234234.234234},
{234.234234, 234234.234234, 234234.234234},
{234.234234, 234234.234234, 234234.234234},
{234.234234, 234234.234234, 234234.234234} //the last one doesn't require a commar
};
new Previous, Current;
stock RandomExplosion()
{
Current = random(sizeof(Coords));
if(Current != Previous)
{
CreateExplosion(Coords[Current][X], Coords[Current][Y], Coords[Current][Z], TYPE, RADIUS);
Previous = Current;
}
else
{
RandomExplosion();
}
}
You'll want to change TYPE and RADIUS to suit you. Also, change the co-ordinates.. To set off an explosion just use RandomExplosion();
I set it up so the explosion wont be in the same place twice. If you don't mind it being in the same place numerous times in a row use this:
pawn Код:
#include <a_samp>
#define TYPE 7
#define RADIUS 15.0
enum Explosions
{
Float: X,
Float: Y,
Float: Z
}
new Coords[][Explosions] =
{
{234.234234, 234234.234234, 234234.234234},
{234.234234, 234234.234234, 234234.234234},
{234.234234, 234234.234234, 234234.234234},
{234.234234, 234234.234234, 234234.234234},
{234.234234, 234234.234234, 234234.234234},
{234.234234, 234234.234234, 234234.234234},
{234.234234, 234234.234234, 234234.234234} //the last one doesn't require a commar
};
new Current;
stock RandomExplosion()
{
Current = random(sizeof(Coords));
CreateExplosion(Coords[Current][X], Coords[Current][Y], Coords[Current][Z], TYPE, RADIUS);
}