SA-MP Forums Archive
Interact With NPCs. - 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: Interact With NPCs. (/showthread.php?tid=182858)



Interact With NPCs. - CaptainOwen - 12.10.2010

I was lately thinking about creating a script where you can simply approach and NPC and do some sort of command like "/talknpc" and a dialog would show up. On the top of the dialog, it would show you the NPC's response and below you'd have two or three options of what to respond with, for example:

*You approach an NPC*
"/talknpc"
NPC: Whats up, new around here? Whats your name.

Option 1: Yeah, i'm new... Names Owen.
Option 2: Meh, sorta'... Who are you?
Option 3: None of your business, pal.

Any ideas, guides etc?


Re: Interact With NPCs. - Lenny the Cup - 12.10.2010

You don't have to connect anything to the NPC, just make the command and check if they're close enough to the NPC


Re: Interact With NPCs. - CaptainOwen - 12.10.2010

The problem is, I don't know how to do that. :P I've been scripting for a week or so now.


Re: Interact With NPCs. - Lenny the Cup - 12.10.2010

What exactly don't you know how to do?


Re: Interact With NPCs. - CrucixTM - 13.10.2010

I'm doing this in my gamemode.

Get the position of the NPC, IsPlayerInRangeOfPoint to that, if he is, show a dialog.

What's the issue.


Re: Interact With NPCs. - CaptainOwen - 13.10.2010

Alright, i'll try it.