26.07.2010, 11:23
how to spawn random one car etc : id 562 i want to this car spawn is difrent location i do this
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 } }; SetPlayerPos( playerid, RandCoords[ Rand ][ 0 ], RandCoords[ Rand ][ 1 ], RandCoords[ Rand ][ 2 ] ); SetPlayerFacingAngle( playerid, RandCoords[ Rand ][ 3 ] ); return 1; } |
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; } |