CarDestroy
Код
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;
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;
vect3_copy(&info->base.matrix[12], sync.vecPos);
bsVehicleSync.Write((BYTE)ID_VEHICLE_SYNC);
bsVehicleSync.Write((PCHAR)&sync,sizeof(INCAR_SYNC_DATA));
g_SAMP->pRakClientInterface->Send(&bsVehicleSync,HIGH_PRIORITY,UNRELIABLE_SEQUENCED,0);
info->hitpoints = 0.0f;
time = GetTickCount();
Colorise
Код
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;
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;
vect3_copy(&info->base.matrix[12], sync.vecPos);
bsVehicleSync.Write((BYTE)ID_VEHICLE_SYNC);
bsVehicleSync.Write((PCHAR)&sync,sizeof(INCAR_SYNC_DATA));
g_SAMP->pRakClientInterface->Send(&bsVehicleSync,HIGH_PRIORITY,UNRELIABLE_SEQUENCED,0);
vehicle_setColor0( info, rand()%255 );
vehicle_setColor1( info, rand()%255 );
time = GetTickCount();
CarFucker
Код
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]== NULL ) 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 *vinfo = vehicle_info_get( car_id, 0 );
int iSAMPVehicleID = getSAMPVehicleIDFromGTAVehicle(vinfo);
if(iSAMPVehicleID == g_Players->pLocalPlayer->sCurrentVehicleID) continue;
float fPos[3];
vect3_copy(&vinfo->base.matrix[4 * 3], fPos);
fPos[0] += -50 + rand()%100;
fPos[1] += -50 + rand()%100;
fPos[2] += 20.0f;
SendFakeDriverSyncData(iSAMPVehicleID, fPos, vinfo->hitpoints, vinfo->speed);
cheat_vehicle_teleport( vinfo, fPos, gta_interior_id_get() );