How to spawn a vehicle in a random position?
#5

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
you can do it like this
pawn Код:
//some random positions..u can keep adding more
new Float:RandomSpawn[][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}
};
//now under ongamemodeinit
new rand = Random(sizeof(RandomSpawn));
CreateVehicle(510/*i m adding a hydra, change it*/, RandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2], RandomSpawn[rand][3], 0, 1, 60);
I place the new rand... on the top of my gamemode.

I create a vehicle by using your line in one of the GUI dialogs and I get these errors for new rand...

Код:
error 012: invalid function call, not a valid address
error 008: must be a constant expression; assumed zero
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)