04.07.2014, 14:49
(
Последний раз редактировалось [MM]18240[FMB]; 04.07.2014 в 21:39.
)
i'll have to test this out. Looks nice.
-EDIT-
This code needs heavy modified. When you shoot the car, the first bullet makes it have -900 HP and the second one repairs it to 1000 HP.. Also doesn't work with Knives, Grenades, and Fists.
-edit-
I found the problem, your math was backwards.
-EDIT-
This code needs heavy modified. When you shoot the car, the first bullet makes it have -900 HP and the second one repairs it to 1000 HP.. Also doesn't work with Knives, Grenades, and Fists.
-edit-
I found the problem, your math was backwards.
Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) { if(hittype == 2) // verify if the player shoot an vehicle { new bool: isany_incar = false; // we use a boolean (true/false variable) to check if is anyone in car, and set this to false by default for(new i = 0; i < MAX_PLAYERS; i++) // we go through a loop for all players { if(IsPlayerInVehicle(i, hitid)) // we verify if any player is in the shooted vehicle { isany_incar = true; // if a player is in vehicle , then we set our variable to false break; // we break the loop , cause thats mean that a player have been found } } if(isany_incar != true) // we check if the verify from below was false, is noone in the car { new Float: vHealth; // creating a float variable for getting vehicle health GetVehicleHealth(hitid, vHealth); // getting the hitid vehicle SetVehicleHealth(hitid, vHealth-40); // removing 100 from the vehicle health, its not necesary to be 100, you can make a system based on weapon cause unfortunately there is no damage paramater in this callback } } return 1; }