[HELP] NPC's distance
So I succedded in createing a few NPCs and saving them all in one map together now my new problem is like this...
When a player touches an NPC, he then get an a menu, the menu has a few options that aren't really relative. Now this is where it gets a little difficult. When a player is too far from the NPC he can't use the menu. I tried creating Arrays but i'm not so good at it... The NPCs is created in a stock that will contain the NPCs origin from a file now i want to add the NPCs origin to an array now if there are more than one it will of course push the array and then when i just need to get the array i'll check for its origin within the array... If i'm missunderstood please tell me I'll try to be more specific and well written. |
Re: [HELP] NPC's distance
Sorry, I don't understand your problems. Are you saying you don't want player to use menu if he too far from your npc?
|
Re: [HELP] NPC's distance
Quote:
|
Re: [HELP] NPC's distance
Well, you can use find_ent_by_class with a while loop to find them, then store their origins.
Btw, what's the method you use to check whether the player is close enough? |
Re: [HELP] NPC's distance
Quote:
I succedded in creating 3 Arrays Example: PHP Code:
I am using get_distance_f |
Re: [HELP] NPC's distance
Quote:
PHP Code:
Quote:
|
Re: [HELP] NPC's distance
Quote:
This is my stock: PHP Code:
|
Re: [HELP] NPC's distance
Quote:
Use this with a while loop when the npcs think so you don't have to store their origins. This will become more useful if you want to make moving npcs. Quote:
|
Re: [HELP] NPC's distance
Quote:
I'll redo it and send it back :) |
| All times are GMT -4. The time now is 15:25. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.