12.03.2014, 18:21
How can I make if player is far away from shooter he will receive lower amount of damage? And if he is closer he will receive bigger amount of damage? (if is even possible)
OnPlayerTakeDamage
OnPlayerGiveDamage
SetPlayerTeam
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == HIT_TYPE_PLAYER)
{
new
Float:X, Float:Y, Float:Z;
GetPlayerPos(hitid, X, Y, Z);
if(GetPlayerDistanceFromPoint(playerid, X, Y, Z) < 4.0)
{
//More damage?
}
else
{
//If more than 3m.
}
}
return 1;
}