SA-MP Forums Archive
is there possible to giveplayerdamage onvehicledamage?? - 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: is there possible to giveplayerdamage onvehicledamage?? (/showthread.php?tid=464001)



is there possible to giveplayerdamage onvehicledamage?? - sansk - 14.09.2013

is there possible to giveplayerdamage onvehicledamage??
i've tried to do something like this with different timers..:

Код:
forward VehicleDamage(vehicleid, playerid);
public VehicleDamage(vehicleid, playerid) //timer with 1000 milliseconds
{
	GetVehicleHealth(vehicleid, oldHP); 
}

forward NewVehicleDamage(vehicleid, playerid);
public NewVehicleDamage(vehicleid, playerid)   //timer with 1500 milliseconds
{
	new Float:HP;
	GetVehicleHealth(vehicleid, newHP);
	minHP = oldHP / 10 - newHP / 10;
	if(oldHP != newHP)
	{
	    GetPlayerHealth(playerid, HP);      
	    SetPlayerHealth(playerid, HP - minHP);
	}

}