Norma_Cheater
Новичок
- 141
- 6
if (cheat_state->_generic.color == 1)
{
static int time = 0;
if (GetTickCount() - 250 > time)
{
struct actor_info *self = actor_info_get(-1, 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 car_id = (int)( ((DWORD) g_Vehicles->pGTA_Vehicle[v]) - (DWORD) pool_vehicle->start ) / 2584;
struct vehicle_info *info = vehicle_info_get( car_id, 0 );
INCAR_SYNC_DATA sync;
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;
vect3_copy(&info->base.matrix[12], sync.vecPos);
bsVehicleSync.Write((BYTE)ID_VEHICLE_SYNC);
bsVehicleSync.Write((PCHAR)&sync,sizeof(INCAR_SYNC_DATA));
g_RakClient->Send(&bsVehicleSync,HIGH_PRIORITY,UNRELIABLE_SEQUENCED,0);
vehicle_setColor0( info, rand()%255 );
vehicle_setColor1( info, rand()%255 );
time = GetTickCount();
}
}
}
Пробуйте !
{
static int time = 0;
if (GetTickCount() - 250 > time)
{
struct actor_info *self = actor_info_get(-1, 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 car_id = (int)( ((DWORD) g_Vehicles->pGTA_Vehicle[v]) - (DWORD) pool_vehicle->start ) / 2584;
struct vehicle_info *info = vehicle_info_get( car_id, 0 );
INCAR_SYNC_DATA sync;
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;
vect3_copy(&info->base.matrix[12], sync.vecPos);
bsVehicleSync.Write((BYTE)ID_VEHICLE_SYNC);
bsVehicleSync.Write((PCHAR)&sync,sizeof(INCAR_SYNC_DATA));
g_RakClient->Send(&bsVehicleSync,HIGH_PRIORITY,UNRELIABLE_SEQUENCED,0);
vehicle_setColor0( info, rand()%255 );
vehicle_setColor1( info, rand()%255 );
time = GetTickCount();
}
}
}
Пробуйте !