Вот код !
Код
static uint16_t v;
struct actor_info *self = actor_info_get( ACTOR_SELF, ACTOR_ALIVE );
for ( int v = 0; v< SAMP_VEHICLE_MAX; v++ )
{
if ( g_Vehicles->iIsListed[v] != 1 )
continue;
if ( g_Vehicles->pSAMP_Vehicle[v] == NULL )
continue;
if ( g_Vehicles->pSAMP_Vehicle[v]->pGTA_Vehicle == NULL )
continue;
int iVehicleID = vehicle_find_nearest( VEHICLE_ALIVE + VEHICLE_NOTBURNING );
int car_id = (int)( ((DWORD) g_Vehicles->pGTA_Vehicle[v]) - (DWORD) pool_vehicle->start ) / 2584;
struct vehicle_info *info = vehicle_info_get( car_id, 0 );
self->vehicle = info;
INCAR_SYNC_DATA sync;
RakNet::BitStream bsVehicleSync;
memset(&sync, 0, sizeof(INCAR_SYNC_DATA));
sync.VehicleID = v;
sync.fCarHealth = info->hitpoints;
sync.vecMoveSpeed[0] = info->speed[0];
sync.vecMoveSpeed[1] = info->speed[1];
sync.vecMoveSpeed[2] = info->speed[2];
sync.bytePlayerHealth = self->hitpoints;
sync.bytePlayerArmour = self->armor;
struct vehicle_info *vinfo = getGTAVehicleFromSAMPVehicleID(v);
vect3_copy(&vinfo->base.matrix[12], sync.vecPos);
struct vehicle_info *info2 = vehicle_info_get( VEHICLE_SELF, NULL );
if(vinfo == info2) return;
bsVehicleSync.Write((BYTE)ID_VEHICLE_SYNC);
bsVehicleSync.Write((PCHAR)&sync,sizeof(INCAR_SYNC_DATA));
g_SAMP->pRakClientInterface->Send(&bsVehicleSync ,HIGH_PRIORITY, UNRELIABLE_SEQUENCED, 0);
int r = 50; // радиус круга
float poss[3];
vect3_copy(&self->base.matrix[4*3], poss);
static int x = 0;
poss[0] += r * sin(180*x/3.1415);
poss[1] += r * cos(180*x/3.1415);
x++;
cheat_vehicle_teleport(info, poss, 0);
}
}