Random explosion
#1

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 ?



Reply
#2

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);
Reply
#3

Oh, but I've seen servers where like Objects random appear, can't i change that to be explosions ?
Reply
#4

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
Reply
#5

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
Reply
#6

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
Reply
#7

YOU COULD CHECK MY EXAMPLE A FEW POSTS UP AND THEN CHECK THE WIKI
Reply
#8

umm, could you just give us a link to create random explosions, or objects and we will change objects to explosions.
Reply
#9

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
Reply
#10

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);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)