how to random spawn
#1

Hi guys how i can create random object spawned in different locations (like the mission for the FD object fire spawned in locations...)
Reply
#2

pawn Код:
new Float:RandomFire[][] =
{
    {Float:X, Float:Y, Float:Z},//you need to replace X,Y n Z to your coordinates.
    {Float:X, Float:Y, Float:Z},
    {Float:X, Float:Y, Float:Z}
};

//use:
new fire = random(sizeof(RandomFire));
CreateObject(objectid,RandomFire[fire][0], RandomFire[fire][1], RandomFire[fire][2],0,0,0);
Reply
#3

Something like that. Not sure
pawn Код:
// Variables
new Float:RandomObjectSpawn[][4] =
{
    // Positions, (X, Y, Z and Facing Angle)
    {-2796.9854, 1224.8180, 20.5429, 192.0335},
    {-2454.2170, 503.8759, 30.0790, 267.2932},
    {-2669.7322, -6.0874, 6.1328, 89.8853}
};

// OnGameModeInit()
public OnGameModeInit()
{
    CreateObject(2587, RandomObjectSpawn[rand][0], RandomObjectSpawn[rand][1],RandomObjectSpawn[rand][2], 0.0, 0.0, 96.0);
    return 1;
}
Edit: Pharrel was faster
Reply
#4

how i can add a timer and select the object/explosion i want?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)