12.10.2017, 04:04
(
Последний раз редактировалось Kane; 12.10.2017 в 05:00.
)
What would be a plausible way to detect if a players hitting a vehicle with fists or melee weapons?
EDIT:
Found a way that's most convenient for what I was planning on. This was mostly for affect on the driver's door. If anyone's interested:
Use OnPlayerKeyStateChange.
GetVehicleRelativePos isn't a native function so you'll have to find that.
EDIT:
Found a way that's most convenient for what I was planning on. This was mostly for affect on the driver's door. If anyone's interested:
Use OnPlayerKeyStateChange.
PHP код:
if(RELEASED(KEY_FIRE))
{
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_FRONTSEAT, cX, cY, cZ);
GetVehicleRelativePos(vehicleid, dX, dY, dZ, -cX - 0.5, cY, cZ);
if(!IsPlayerInRangeOfPoint(playerid, 1.2, dX, dY, dZ))
return 1;
}