IsPlayerInRangeOfPoint works even if player isnt in the range of point, why? -
Bob Bubba - 22.10.2012
Hello
I have made my cmd: /armour
The point is, when you step on armour PickUp and tipe /armour, you get 100 amour.
But I have made if player is in range of point, but it doesnt work, I dont know why.
Here are the codes:
Код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
{
IsPlayerInRangeOfPoint(playerid,2, -2167.3972,3306.8318,95.5800);
SendClientMessage(playerid, COLOR_ORANGE, "Armour PickUP");
SetPlayerArmour(playerid,100);
}
It doesnt work that way so I tried:
Код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
{
IsPlayerInRangeOfPoint(playerid,2, -2167.3972,3306.8318,95.5800); return SendClientMessage(playerid, COLOR_ORANGE, "You have to be at armour PickUp");
SendClientMessage(playerid, COLOR_ORANGE, "Armour PickUP");
SetPlayerArmour(playerid,100);
return 1;
}
But it doesnt work again. I dont know why, please help.
Compiling this scritps works, everything is fine but when I tipe /armour anywhere ingame I get armour 100.
Thank you.
Re : IsPlayerInRangeOfPoint works even if player isnt in the range of point, why? -
yusei - 22.10.2012
Use if(PlayerToPoint(2, playerid, -2167.3972,3306.8318,95.5800))
PHP код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(2, playerid, -2167.3972,3306.8318,95.5800))
{
SendClientMessage(playerid, COLOR_ORANGE, "Armour PickUP");
SetPlayerArmour(playerid,100);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "You have to be at armour PickUp");
return 1;
}
}
Re: IsPlayerInRangeOfPoint works even if player isnt in the range of point, why? -
tyler12 - 22.10.2012
pawn Код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,2, -2167.3972,3306.8318,95.5800))
{
SendClientMessage(playerid, COLOR_ORANGE, "Armour PickUP");
SetPlayerArmour(playerid,100);
}
return 1;
}
Re: IsPlayerInRangeOfPoint works even if player isnt in the range of point, why? -
RenSoprano - 22.10.2012
Код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,2, -2167.3972,3306.8318,95.5800))
{
SendClientMessage(playerid, COLOR_ORANGE, "Armour PickUP");
SetPlayerArmour(playerid,100);
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "You have to be at armour PickUp");
}
return 1;
}
Try this
Re: IsPlayerInRangeOfPoint works even if player isnt in the range of point, why? -
Bob Bubba - 22.10.2012
Thank you Yusei, it works.
Cheers