how to randowm spawn a one car
#5

Quote:
Originally Posted by Shadow™
Посмотреть сообщение
Hey, thanks for posting this topic, here's a quick fix and I hope it works as it's untested.

First, place this at the top of your script anywhere under #include <a_samp>

pawn Код:
new Float:RandCoords[4][6] = {
{1023.79,-976.95,43.14}, // 1
{1197.05,-1001.90,32.88}, // 2
{1250.04,-904.73,42.53} // 3
{1284.84,-994.44,38.5) // 4
};
Next, add this under OnGameModeInit:

pawn Код:
Public OnGameModeInit()
{
    new Rand = random( 4 ),
    AddStaticVehicle(562,RandCoords[Rand][3],RandCoords[Rand][2],RandCoords[Rand][1],0,0,0,1,1);
    return 1;
}

Quote:
Originally Posted by Shadow™
Посмотреть сообщение
Yeah... I just noticed that, sorry... I copied it from his first post, just forgot to change it... Anyway, you're right...

pawn Код:
AddStaticVehicle(562,RandCoords[Rand][0], RandCoords[Rand][1], RandCoords[Rand][2],0,0,0,1,1); // White
Too much are parameter.
Код:
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
pawn Код:
AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2);
Try:
pawn Код:
#include <a_samp>

new
    Float:RandCoords[4][4] =
{
//      0       1       2       3
//      X       Y       Z       Angle
    { 1023.79, -976.95, 43.14, 270.0 }, // 0
    { 1197.05, -1001.90, 32.88, 270.0}, // 1
    { 1250.04, -904.73, 42.53, 270.0 }, // 2
    { 1284.84, -994.44, 38.5, 270.0  }  // 3
};

public
    OnGameModeInit()
{
    new
        Rand = random(4); // 0 1 2 3
//  AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2);
    AddStaticVehicle(562, RandCoords[Rand][0], RandCoords[Rand][1], RandCoords[Rand][2], RandCoords[Rand][3], -1, -1);
    return 1;
}
Reply


Messages In This Thread
how to randowm spawn a one car - by omidi - 26.07.2010, 11:23
Re: how to randowm spawn a one car - by Shadow™ - 26.07.2010, 11:33
Re: how to randowm spawn a one car - by FUNExtreme - 26.07.2010, 12:14
Re: how to randowm spawn a one car - by Shadow™ - 26.07.2010, 12:25
Re: how to randowm spawn a one car - by smeti - 26.07.2010, 12:36
Re: how to randowm spawn a one car - by Shadow™ - 26.07.2010, 12:38
Re: how to randowm spawn a one car - by omidi - 26.07.2010, 16:27
Re: how to randowm spawn a one car - by Jefff - 26.07.2010, 17:47
Re: how to randowm spawn a one car - by omidi - 26.07.2010, 18:40

Forum Jump:


Users browsing this thread: 1 Guest(s)