Need help
#2

Quote:

This callback was added in SA-MP 0.3z and will not work in earlier versions!

The driver must be in the same team thought, not anyone in the car
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(hittype == BULLET_HIT_TYPE_VEHICLE)
    {
        new driver = GetVehicleDriver(hitid);
        if(driver != INVALID_PLAYER_ID && GetPlayerTeam(playerid) == GetPlayerTeam(driver)) return 0;
    }
    return 1;
}

stock GetVehicleDriver(vehicleid)
{
    foreach(Player, i) if(IsPlayerInVehicle(i, vehicleid) && GetPlayerVehicleSeat(i) == 0) return i;

    return INVALID_PLAYER_ID;
}
Reply


Messages In This Thread
Need help - by MBilal - 19.01.2015, 22:37
Re: Need help - by xVIP3Rx - 19.01.2015, 23:00
Re: Need help - by MBilal - 19.01.2015, 23:21

Forum Jump:


Users browsing this thread: 1 Guest(s)