How can i make npc that stand at the spawnpoint
#1

i tryed to make a record of stand at the spawnpoint but when i type after i finish /stoprecord
the record doesn't save in my records folder...
what can i do?
Reply
#2

did you search in the scriptfiles map ? it should be in there.
If you found it there just copy and paste it to the records map
Reply
#3

Yes , i found it in the scriptsfiles but i have more problem the npc allways teleport and spawn after afew seconds and it's doesn't stop
Reply
#4

I tryed now the npcidle and there to i have the same problem the npc allways teleport and back
Reply
#5

Hmmm..... ...

can you show me what you got under your onplayerspawn ?
Reply
#6

Код:
	if(IsPlayerNPC(playerid))
	{
	  new npcname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, npcname, sizeof(npcname));
		RequestNPCLoad(playerid,npcname);
		return 1;
	}

And this the requestnpcload public:


Код:
public RequestNPCLoad(playerid,npcname[])
{
	if(IsPlayerNPC(playerid))
	{
	  if(!strcmp(npcname, "Zak", true))
	  {
//	  SetSpawnInfo(playerid,255,125,2448.1091,-1963.3397,13.5469,171.5765, 0, 0, 0, 0, 0, 0 );
    SetPlayerSkin(playerid, 127);
    SetPlayerTeam(playerid, 0);
		SetPlayerPos(playerid, 2448.1091,-1963.3397,13.5469);
		SetPlayerFacingAngle(playerid, 171.5765);
	  
		  return 1;
		}
	}
 	return 1;
}
Reply
#7

You need to do it like this in your gamemode;
above ongamemodeinit;
#include <a_npc> (if you didnt do that already)

then under ongamemodeinit;
Код:
ConnectNPC("Zak","blabla*");
* = with blabla i mean the name of the npc script you made (so not the record)
Then under OnplayerSpawn make;
Код:
  if(IsPlayerNPC(playerid))
  {
  
  new npcname[MAX_PLAYER_NAME];
 	if(!strcmp(npcname, "Zak", true))
  {

    GetPlayerName(playerid, npcname, sizeof(npcname)); 
    if(!strcmp(npcname, "Zak", true))
    {
 		
    	SetPlayerSkin(playerid, 127);
    	SetPlayerTeam(playerid, 0);
		SetPlayerFacingAngle(playerid, 171.5765);			
	}
  }

  return 1;//end of onplayerspawn
  }
If you recorded an npc then you dont need setplayerpos because the recording will do that automaticly

If its still not working then ill need to see the npc script you made
Reply
#8

Still i have the same problem ....
Reply
#9

Then show us the npc script
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)