Random explosion -
zone - 13.08.2009
I'm looking for a way to add random explosions in my server, is there a way to add a script or something like that ?
So basicly if i put in a command it activates explosions on the whole map (and a lot of explosions)..
Is something like that possible ?
Re: Random explosion -
dice7 - 13.08.2009
Yes, but you will need a lot of coordinates for those explosions
Or you could do something like this
pawn Код:
for(new a = 0; a < 100000; a++) CreateExplosion(random(2000+2000+1)+(-2000), random(2000+2000+1)+(-2000), random(100-0+1)+0, 100.0);
Re: Random explosion -
zone - 13.08.2009
Oh, but I've seen servers where like Objects random appear, can't i change that to be explosions ?
Re: Random explosion -
Questionable Noob - 13.08.2009
me and zone are planning to do something like thoes randomley appearing ramps on a stunt server, exept its a roleplay server, the ramps are explosions, and its for and appocoliptic doomsday command! cant spell
Re: Random explosion -
dice7 - 13.08.2009
Like I said, you will need a lot of coordinates if you want object being created randomly across the map. The object creation can be made random, the positions can not. Atleast can not to the degree of being perfect
Re: Random explosion -
Questionable Noob - 13.08.2009
WHAT IS THE CODE TO MAKE THEM RANDOM, WE CAN EASYALLY GET THE CORDS, did u read my name

i just need to know how to make them randomley appear
EDIT: and wee need them to start when we do /doomsday and to stop appearing when we do /saveusformdoomsdy
Re: Random explosion -
dice7 - 13.08.2009
YOU COULD CHECK MY EXAMPLE A FEW POSTS UP AND THEN CHECK THE WIKI
Re: Random explosion -
Questionable Noob - 13.08.2009
umm, could you just give us a link to create random explosions, or objects and we will change objects to explosions.
Re: Random explosion -
Questionable Noob - 13.08.2009
if i want to make random explosions, how do i make /explosionstart lead to timed explosions at diffrent times and diffrent locations, and have it stop if i do /explodeend
Re: Random explosion -
Weirdosport - 14.08.2009
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);
}