make a command on your gamemode that includes the function;
SetPlayerToFacePlayer(playerid, targetid)
this function is in the a_angles include so make sure you include that in your gamemode to
heres an example of my command under onplayercommandtext ;
Код:
if(!strcmp(cmdtext, "/face", true))//
{ for(new i = 0; i < MAX_PLAYERS; i++)
if(i!=playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
if(GetPlayerState(i) == PLAYER_STATE_ONFOOT)
{
if(GetDistanceBetweenPlayers(playerid,i) < 5 )//modify this number to your needs
{
SetPlayerToFacePlayer(playerid, i);
}
}
}
}
return 1;
}
Now all you have to do is go to the npc script and add the /face command there somewhere
for example under OnplayerText and then it sends the command..the npc will face you
this gives you an example of how it could work