Anti Car Parking
#3

Something such as this should work:
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;
}
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.
Reply


Messages In This Thread
Anti Car Parking - by BruLaX - 31.07.2015, 19:32
Re: Anti Car Parking - by BruLaX - 31.07.2015, 21:02
Re: Anti Car Parking - by Abagail - 31.07.2015, 21:09

Forum Jump:


Users browsing this thread: 1 Guest(s)