Pick People in the range of a player
#1

In the Function:
Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
	if((newkeys & KEY_FOOT_FIRE) == (KEY_FOOT_FIRE))
	{
	  if(GetPlayerWeapon(playerid) == 17)
	  {
		  new Float:x, Float:y, Float:z, Float:a;
			GetPlayerPos(playerid, x, y, z);
			GetPlayerFacingAngle(playerid, a);
			x += (15 * floatsin(-a, degrees));
			y += (15 * floatcos(-a, degrees));

			GetPlayerPos(playerid, X, Y, Z);

			if(IsPlayerInRangeOfPoint(15, playerid, x, y, z) )
			{
				SendClientMessage(playerid,0x000000,"Testmsg");
				ApplyAnimation(playerid,"PED","Drown",4.1,0,1,1,1,1);
				lookatx = -1000;
				lookaty = -1000;
				lookatz = -1000;
				return 1;
			}
		}
	}
	return 0;
}
, just the Player, who trigger the
Код:
OnPlayerKeyStateChange
get the Testmessage..

So i want to pick every player in a defined range to the acting player....

But the script doesn`t ...

[Probably its because var "playerid" is all the Func defined as the triggerer of OnPlayerKeyStateChange, so "if people are close to me,show me the message, if not,do not".

I just want to show the message to the people in range...

Probably someone can explain my mistake to me, fix the issue or something like that?

Would be nice and you will get "Done very well" from me ,
Trooper
Reply
#2

pawn Код:
for(new i; i<MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
            if(IsPlayerInRangeOfPoint(15, i, x, y, z) )
            {
                SendClientMessage(playerid,0x000000,"Testmsg");
                ApplyAnimation(playerid,"PED","Drown",4.1,0,1,1,1,1);
                lookatx = -1000;
                lookaty = -1000;
                lookatz = -1000;
                return 1;
            }
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)