19.01.2015, 23:00
Quote:
This callback was added in SA-MP 0.3z and will not work in earlier versions! |
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;
}