08.05.2015, 13:50
Quote:
Well, it wont be easy but I thought of something quick.
Perhaps you could use OnPlayerUpdate, or any other timer you want to do per 250-300 ms, however let's move on. You check if the player is in range of the NPC, he is? Determine between the player's facing angle and the NPC's. if NPC Angle+180 = PlayerAngle. Then the player is facing the NPC. This wont work only if the player is FACING the NPC though. |
onplayerenterarea will do the rest with a few if statements.
The fact of me wanting to check many things keeps me wondering how to do it in a most efficient way.
and not end up to something like this for example;
pawn Код:
if(isnpcinvehicle
if(npc is cop && player is cop
else if(
else if(
else if(
else if(
else if(
else if(
else
{
if(npc is civilian
else if(
else if(
else if(
else if(
else if(
else if(
else
{
if(npc is gangmember
if(!isplayerinvehicle)
bla bla bla