how to randowm spawn a one car
#1

how to spawn random one car etc : id 562 i want to this car spawn is difrent location i do this

Quote:

public OnPlayerSpawn( playerid )
{
new
Rand = random( 4 ),
Float:RandCoords[ 4 ][ 4 ] =
{
{ 1023.79,-976.95,43.14 },
{ 1197.05,-1001.90,32.88},
{ 1250.04,-904.73,42.53 },
{ 1284.84,-994.44,38.5 }
};

SetPlayerPos( playerid, RandCoords[ Rand ][ 0 ], RandCoords[ Rand ][ 1 ], RandCoords[ Rand ][ 2 ] );
SetPlayerFacingAngle( playerid, RandCoords[ Rand ][ 3 ] );
return 1;
}

but its work only for player not a veh

then i do this and its not change


Quote:

public OnPlayerSpawn(playerid)
{
new
Rand = random( 4 ),
Float:RandCoords[ 4 ][ 4 ] =
{
{ 1023.79,-976.95,43.14 },
{ 1197.05,-1001.90,32.88},
{ 1250.04,-904.73,42.53 },
{ 1284.84,-994.44,38.5 }
};
AddStaticVehicleEx(562,RandCoords[ Rand ][ 0 ], RandCoords[ Rand ][ 1 ], RandCoords[ Rand ][ 2 ] ,1,6,6,600000);



return 1;

}

or this

public OnVehicleSpawn(vehicleid)
{
new
Rand = random( 4 ),
Float:RandCoords[ 4 ][ 4 ] =
{
{ 1023.79,-976.95,43.14 },
{ 1197.05,-1001.90,32.88},
{ 1250.04,-904.73,42.53 },
{ 1284.84,-994.44,38.5 }
};
SetVehiclePos( 562, RandCoords[ Rand ][ 3 ], RandCoords[ Rand ][ 2], RandCoords[ Rand ][ 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)