Minigun damage
#1

I want the medic class to be able to heal other players, by shooting them with miniguns. I know how to edit it, so the minigun wont harm the player, but will give player health. But the minigun will still damage vehicles, so how to disable damaging vehicles?
Reply
#2

If you are clever enough, you can download filterscript about TAZER/TASER or watch a tutorial and think a little what you can do. So if i punch somebody it will heal him instead of freezing him.
Reply
#3

I know how to make the player heal, instead of damage. But I am worried that they will abuse the medic gun (minigun) on vehicles. Because if they shoot a vehicle they will still do damage, because a vehicle isn't a player. How can I detect that vehicle is being shot at and neutralize that damage?
Reply
#4

Here you are

PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponid)
{
if( 
weaponid == 38 // Minigun
{
new 
Float:Health;
GetPlayerHealth(playeridHealth);
SetPlayerHealth(playeridHealth+30); // Heals +30 the player once he get shoot'ed.. P.S You can change the value. For Example Health+100
}
return 
1;

Reply
#5

Please read my posts. I say that I can make the player get health, instead of damaging him. But the players will start abusing the minigun and shoot vehicles, how can I make vehicles immune to minigun?
Reply
#6

Oh sorry I misunderstood :P

Here you are

PHP код:
forward OnVehicleGetDamaged(vehicleiddamagedidFloatamountweaponid);
public 
OnVehicleGetDamaged(vehicleiddamagedidFloatamountweaponid)
{
    if( 
weaponid == 38 )
    {
        new 
Float:VehicleHealth;
        
GetVehicleHealth(vehicleidVehicleHealth);
        
        
SetVehicleHealth(vehicleidVehicleHealth+0);
    }
    return 
1;

Reply
#7

Lol, this function doesen't exist in SA:MP. I also tested it and it doesen't work. Making up any public function that you want isn't possible.
Reply
#8

Hhm, It worked fine for me when I tested it.

Try this
PHP код:
forward OnVehicleGetDamaged(playeridvehicleidweaponid);
public 
OnVehicleGetDamaged(playeridvehicleidweaponid)
{
    if( 
GetPlayerWeapon(playerid) == 38 )
    {
        new 
Float:VehicleHealth;
        
GetVehicleHealth(vehicleidVehicleHealth);
        
        
SetVehicleHealth(vehicleidVehicleHealth+0);
    }
    return 
1;

Reply
#9

You just can't make up your own public functions! If that were possible.. then we wouldn't need updates at all, we could make all new 0.3e functions by ourselves? You probably tested it on a empty vehicle, vehicles that aren't running wont get damaged anyways.
Reply
#10

BUMP. Is this possible somehow?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)