14.11.2016, 15:21
Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) { if(hittype == 2) { new bool: isany_incar = false; for(new i = 0; i < MAX_PLAYERS; ++i) { if(IsPlayerInVehicle(i, hitid)) { isany_incar = true; break; } } if(isany_incar != true)//You hit a vehicle with noone sitting inside. { //the vehicle's ID you've hit is hitid new Float:vHealth; GetVehicleHealth(hitid, vHealth); SetVehicleHealth(hitid, vHhealth - 50); } } return 1; }