SA-MP Forums Archive
Minigun damage - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Minigun damage (/showthread.php?tid=362476)



Minigun damage - Dan. - 24.07.2012

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?


Re: Minigun damage - RedJohn - 24.07.2012

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.


Re: Minigun damage - Dan. - 25.07.2012

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?


Re: Minigun damage - Alexis1999 - 25.07.2012

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;




Re: Minigun damage - Dan. - 26.07.2012

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?


Re: Minigun damage - Alexis1999 - 26.07.2012

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;




Re: Minigun damage - Dan. - 26.07.2012

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.


Re: Minigun damage - Alexis1999 - 26.07.2012

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;




Re: Minigun damage - Dan. - 26.07.2012

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.


Re: Minigun damage - Dan. - 26.07.2012

BUMP. Is this possible somehow?