How would this 'decision tree' look like in pawn ?
#3

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
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.
Well we dont have to worry about the way of 'how to check if a player is in range' I just used a 'well known' streamer and attached an area per npc.
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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)