How to get position near vehicle?
Can anyone explain me how can I get the position near vehicle? for example: trunk, bumpers, doors... Just around the veh... I think it's something with floatsin, floatcos but I don't understand that...
I used this to get right side of the vehicle.

pawn Код:
`stock GetXYRightOfCar(vehicleid,&Float:x,&Float:y,Float:distance){    new Float:a;    GetVehiclePos( vehicleid, x, y, a );    GetVehicleZAngle( vehicleid, a );    x += ( distance * floatsin( -a+90, degrees ));    y += ( distance * floatcos( -a+90, degrees ));}`
usage would be

GetVehiclePos
GetXYRightOfCar(vehicleid,x,y,1.0) use negative to get left side.
PHP код:
``` public GetPlayerclosetoveh(playerid) {  new Float:dis = 99999999.0;  new veh = -1;  new Float:x, Float:y, Float:z;  GetPlayerPos(playerid, x, y, z);  for(new i = 1; i < MAX_VEHICLES; i++)  {   new Float:distance = GetVehicleDistanceFromPoint(i, x, y, z);      if(distance < dis)      {          dis = distance;          veh = i;   }  }  return veh; }  ```
If it didn't work, please tell me.

Forum Jump:

Users browsing this thread: 1 Guest(s)