Stopping npcs
#10

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
Good idea!


One way you could possibly do this is to:

1. Use the file functions and write as the file header the NPC's name.
2. Connect the NPC
3. Go to OnPlayerRequestSpawn
4.
pawn Код:
if(IsPlayerNPC(playerid)) { "STEP5" }
5. Check inside the little code whether there is a file created with his name.
6. If this has been set out correctly and he has a file create a basic array "new g_NpcID[MAX_PLAYERS];"
7. g_NpcID[MAX_PLAYERS] = playerid;
8. Get the NPC ID:
pawn Код:
new
    playerid
;
for(new i; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerNPC(i))
{
    GetPlayerPos(g_NpcID[i], X, Y, Z);
    for(new all; all < MAX_PLAYERS; all++)
    {
       if(IsPlayerInRangeOfPoint(all, nX, nY, Z)) //Basic calculation said before
       {
       }
    }
}
something like this.

HOWEVER. Hooking the file creation method to ConnectNPC would be the best idea i guess lol
I don't really understand this for some reason.
Reply


Messages In This Thread
Stopping npcs - by Luis- - 09.11.2011, 23:37
Re: Stopping npcs - by Luis- - 10.11.2011, 07:36
Re: Stopping npcs - by MP2 - 10.11.2011, 07:39
Re: Stopping npcs - by Lorenc_ - 10.11.2011, 07:42
Re: Stopping npcs - by Luis- - 10.11.2011, 09:39
Re: Stopping npcs - by SiJ - 10.11.2011, 09:44
Re: Stopping npcs - by Lorenc_ - 10.11.2011, 09:46
Re: Stopping npcs - by Luis- - 11.11.2011, 17:56
Re: Stopping npcs - by Lorenc_ - 11.11.2011, 23:41
Re: Stopping npcs - by Luis- - 12.11.2011, 23:51

Forum Jump:


Users browsing this thread: 3 Guest(s)