GetPlayerDistanceFromPlayer
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Using ".." is invalid and you can't check if something is equal to more than 1 value. ".." is used in switch for integers only. Also you keep calling GetPlayerDistanceFromPlayer function. Store what distance returned to a local variable and then check if for example "distance >= 10.1 && distance <= 20.0".
Thanks, I changed it to:
Код:
new distance;
under OnPlayerGiveDamage and
Код:
	case 25:
	{
		if (PlayerData[playerid][pBeanBag]) damage = 0;
		else
		{
		        distance = GetPlayerDistanceFromPlayer(playerid, damagedid); //line 15970
			if (distance <= 10)
			{
				if (bodypart == 9) damage = 85;
				else damage = 70;
			}
			if (distance >= 10.1 && distance <= 20.0)
			{
				if (bodypart == 9) damage = 65;
				else damage = 45;
			}
			if (distance == 20.1 && distance <= 30.0)
			{
				if (bodypart == 9) damage = 45;
				else damage = 30;
				}
			if (distance >= 30.1)
			{
				if (bodypart == 9) damage = 35;
				else damage = 25;
			}
		}	
	}
Looks good, but I get this warning:
Код:
(15970) : warning 213: tag mismatch
Reply


Messages In This Thread
GetPlayerDistanceFromPlayer - by GoldenLion - 11.06.2016, 14:57
Re: GetPlayerDistanceFromPlayer - by Konstantinos - 11.06.2016, 15:02
Re: GetPlayerDistanceFromPlayer - by GoldenLion - 11.06.2016, 15:48
Re: GetPlayerDistanceFromPlayer - by Konstantinos - 11.06.2016, 15:49
Re: GetPlayerDistanceFromPlayer - by Sjn - 11.06.2016, 15:50
Re: GetPlayerDistanceFromPlayer - by GoldenLion - 11.06.2016, 15:51

Forum Jump:


Users browsing this thread: 1 Guest(s)