10.03.2015, 16:13
(
Последний раз редактировалось MBilal; 10.03.2015 в 20:29.
)
Код:
new Float:VehPos[2][MAX_VEHICLES][3]; new bool:AntiTPVeh[MAX_VEHICLES]; stock Float:GetDistanceBetweenPoints(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2) // By Gabriel "Larcius" Cordes { return floatadd(floatadd(floatsqroot(floatpower(floatsub(x1,x2),2)),floatsqroot(floatpower(floatsub(y1,y2),2))),floatsqroot(floatpower(floatsub(z1,z2),2))); } public VehicleTphack() { for(new i; i < sizeof(VehPos[]); i++) { GetVehiclePos(i, VehPos[1][i][0], VehPos[1][i][1], VehPos[1][i][2]); if(!AntiTPVeh[i]) { if(GetDistanceBetweenPoints(VehPos[0][i][0], VehPos[0][i][1], VehPos[0][i][2], VehPos[1][i][0], VehPos[1][i][1], VehPos[1][i][2]) > 100.0) { SetVehiclePos(i, VehPos[0][i][0], VehPos[0][i][1], VehPos[0][i][2]); } } else { AntiTPVeh[i] = false; } VehPos[0][i][0] = VehPos[1][i][0]; VehPos[0][i][1] = VehPos[1][i][1]; VehPos[0][i][2] = VehPos[1][i][2]; } }