Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int GetPlayerTarget(int radius)
- {
- static int iX;
- static int iY;
- struct vehicle_info *vinfo = SF->getGame()->vehicleInfoGet(VEHICLE_SELF, VEHICLE_ALIVE);
- for (int i = 0; i < SAMP_MAX_VEHICLES; i++)
- {
- if (SF->getSAMP()->getVehicles()->iIsListed[i] != 1)
- continue;
- D3DXVECTOR3 vecPos;
- vecPos.x = vinfo->detachable_car->position[0];
- vecPos.y = vinfo->detachable_car->position[1];
- vecPos.z = vinfo->detachable_car->position[2];
- D3DXVECTOR3 screenPos;
- CalcScreenCoors(&vecPos, &screenPos);
- if (screenPos.z < 1.f)
- continue;
- iX = GetSystemMetrics(SM_CXSCREEN) * 0.5299999714f;
- iY = GetSystemMetrics(SM_CYSCREEN) * 0.4f;
- if ((screenPos.x > iX + (radius)) || (screenPos.y > iY + (radius)) || (screenPos.x < iX - (radius)) || (screenPos.y < iY - (radius)))
- continue;
- return i;
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement