23.11.2011, 15:52
Hi guys how i can create random object spawned in different locations (like the mission for the FD object fire spawned in locations...)
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);
// 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;
}