31.07.2015, 21:09
Something such as this should work:
Though for death reasons, death reason 49 will detect if the player has killed the player with their vehicle, you can use this and Z positions to determine if they car parked or not.
pawn Код:
#include <a_samp>
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid == INVALID_PLAYER_ID || issuerid == playerid) return true;
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && GetPlayerState(issuerid) == PLAYER_STATE_DRIVER)
{
new Float: x, Float: y, Float: z, Float: vx, Float: vy, Float: vz;
GetPlayerPos(playerid, x, y, z);
GetVehiclePos(GetPlayerVehicleID(issuerid), vx, vy, vz);
if(vz - z <= 0)
{
// the player may be car parking
}
}
return 1;
}