Fix to the "NPCs cant spawn if theres a password"
#1

Make your void "onplayerconnect" look something like this:

Код:
public OnPlayerConnect(playerid)
{
  if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
  {
  } else {
  //normal login stuff here
  }
	return 1;
}
Not tested, but should work.
Reply
#2

Quote:
Originally Posted by jameskmonger
Make your void "onplayerconnect" look something like this:

Код:
public OnPlayerConnect(playerid)
{
  if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
  {
  } else {
  //normal login stuff here
  }
	return 1;
}
Not tested, but should work.
This won't work because it only checks if he is NPC ... it won't do anything else
Код:
public OnPlayerConnect(playerid)
{
  if(IsPlayerNPC(playerid)) SpawnPlayer(playerid);  
  return 1;
}
-This will work
Reply
#3

The NPC will spawn itself. No need to use SpawnPlayer. The only reason that the NPC wont spawn if there are terms which the NPC doesnt meet

if(IsPlayerNPC(playerid)) return 1;

Before any log-in-before-spawn type terms is enough
Reply
#4

Quote:
Originally Posted by (KU)MB
The NPC will spawn itself. No need to use SpawnPlayer. The only reason that the NPC wont spawn if there are terms which the NPC doesnt meet

if(IsPlayerNPC(playerid)) return 1;

Before any log-in-before-spawn type terms is enough
On my server i have to spawn him on connect because othervise he is flying at 0,0,0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)