03.10.2015, 00:19
Tengo esta duda, por ejemplo digamos que quiero detectar si un jugador esta en la parte de atras(cabina) de la sadler, o en algun otro lugar del vehiculo que no sea dentro de el, se puede hacer?
Claro que si, puedes usar: https://sampwiki.blast.hk/wiki/GetVehicleModelInfo.
|
GetPosBehindVehicle(vehicleid, &Float:x, &Float:y, &Float:z, Float:offset=0.5)
{
new Float:vehicleSize[3], Float:vehiclePos[3];
GetVehiclePos(vehicleid, vehiclePos[0], vehiclePos[1], vehiclePos[2]);
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, vehicleSize[0], vehicleSize[1], vehicleSize[2]);
GetXYBehindVehicle(vehicleid, vehiclePos[0], vehiclePos[1], (vehicleSize[1]/2)+offset);
x = vehiclePos[0];
y = vehiclePos[1];
z = vehiclePos[2];
return 1;
}
GetXYBehindVehicle(vehicleid, &Float:q, &Float:w, Float:distance)
{
new Float:a;
GetVehiclePos(vehicleid, q, w, a);
GetVehicleZAngle(vehicleid, a);
q += (distance * -floatsin(-a, degrees));
w += (distance * -floatcos(-a, degrees));
return 1;
}
new Float:x, Float:y, Float:z;
GetPosBehindVehicle(vehicleid, x, y, z);