SA-MP Forums Archive
How to check if the suspect is in the players facing angle? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to check if the suspect is in the players facing angle? (/showthread.php?tid=143339)



How to check if the suspect is in the players facing angle? - Nakash - 22.04.2010

pawn Код:
new suspect;
                        for (suspect=0;suspect<MAX_PLAYERS;suspect++)
                        {
                            if(IsPlayerFacingPlayer(playerid, suspect, 7.0))
                            {
                                 SendClientMessage(playerid,COLOR_WHITE,"He is standing infront of you");
                            }
                         }
It won't say He is standing infront of you.
Can you help please?


Re: How to check if the suspect is in the players facing angle? - Nakash - 22.04.2010

Please?


Re: How to check if the suspect is in the players facing angle? - GTAguillaume - 22.04.2010

Where did you put that?


Re: How to check if the suspect is in the players facing angle? - Onyx09 - 22.04.2010

something like this

Код:
new float:Angle, float:X,float:Y,float:X;

GetPlayerFacingAngle(playerid,Angle); or 
GetPlayerPos(playerid, X, Y, Z); and then later to set the other player facing angle 
SetPlayerFacingAngle(playerid, Angle);
SetPlayerFacingAngle(Targetid, X,Y,Z); thats just an example something like that might work



Re: How to check if the suspect is in the players facing angle? - Nakash - 22.04.2010

Quote:
Originally Posted by GTAguillaume
Where did you put that?
I made a command,
pawn Код:
if (strcmp(cmd, "/checkplayer", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
                        new suspect;
                        for (suspect=0;suspect<MAX_PLAYERS;suspect++)
                        {
                            if(IsPlayerFacingPlayer(playerid, suspect, 7.0))
                            {
                                 SendClientMessage(playerid,COLOR_WHITE,"He is standing infront of you");
                            }
                         }
      }
      return 1;
    }
I just want to check the player that is standing infront of you, thank you for trying to help


Re: How to check if the suspect is in the players facing angle? - Nakash - 23.04.2010

Quote:
Originally Posted by Kartowka
Quote:
Originally Posted by GTAguillaume
Where did you put that?
I made a command,
pawn Код:
if (strcmp(cmd, "/checkplayer", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
                        new suspect;
                        for (suspect=0;suspect<MAX_PLAYERS;suspect++)
                        {
                            if(IsPlayerFacingPlayer(playerid, suspect, 7.0))
                            {
                                 SendClientMessage(playerid,COLOR_WHITE,"He is standing infront of you");
                            }
                         }
      }
      return 1;
    }
I just want to check the player that is standing infront of you, thank you for trying to help
12 hours have been passed [I guess? ]