NPC Skip the login Dialog HELP
#1

It doesn't work. I tried with:
Code:
if(IsPlayerNPC(playerid)) return 1;
Under OnPlayerConnect and OnPlayerRequestClass. Still doesn't show the NPC. Any ideas?
Reply
#2

You made a dialog under OnNPCModeInit?
Ok you didn't. I don't think the problem is from the dialogs...
Reply
#3

In the GameMode. Not in the NPCs.

GAMEMODE:

Code:
public OnPlayerRequestClass(playerid, classid)
{
    if(IsPlayerNPC(playerid)) return 1;
	SetupPlayerForClassSelection(playerid, classid);
	return 1;
}

OnPlayerConnect: if(IsPlayerNPC(playerid)) return 1;

public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
  	{
    	new npcname[MAX_PLAYER_NAME];
    	GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
    if(!strcmp(npcname, "PoliceAndChatBotByte", true)) //Checking if the NPC's name is MyFirstNPC
    {
        SetPlayerColor(playerid,YELLOW);
      	PutPlayerInVehicle(playerid, PoliceAndChatBotByteVehicle, 0); //Putting the NPC into the vehicle we created for it.
      	return 1;
    }
    if(!strcmp(npcname, "WorldBus", true))
    {
        SetPlayerColor(playerid,YELLOW);
      	PutPlayerInVehicle(playerid, WorldBusVehicle, 0);
      	return 1;
    }
    return 1;
  }
.....

OnGameModeInit:
ConnectNPC("PoliceAndChatBotByte","sfpdpolice");
PoliceAndChatBotByteVehicle = CreateVehicle(597, 0.0, 0.0, 5.0, 0.0, 0, 1, 5000);
ConnectNPC("WorldBus","busdriver");
WorldBusVehicle = CreateVehicle(431, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
Reply
#4

ok from what I see, there has been a topic about this issue:
https://sampforum.blast.hk/showthread.php?tid=100186&page=2

Your problem clearly relates to this, but unfortunately, I don't have much experience with NPC's yet.
I do think they have limitations regarding the functions they trigger. I hope it helps...
Reply
#5

i've read the topic, but i already tried with
Code:
if(IsPlayerNPC(playerid)) {
    return 1;
    }
Any other ideas?
Reply
#6

okay i am not sure ware is you problem i have same incoming messages but everything works so ?
Reply
#7

Make sure you have maxnpc in server.cfg and be sure you have maxnpc more than 0
example
Code:
maxnpc 0 
to
maxnpc 1
1 is depend on how many bots are there
Reply
#8

Quote:
Originally Posted by cyberlord
View Post
okay i am not sure ware is you problem i have same incoming messages but everything works so ?
It doesn't spawn thats my problem.

Quote:
Originally Posted by DRIFT_HUNTER
View Post
It doesn't say NPC has joined at all. Check your serfer.cfg for maxnpc
maxnpc is set to 2: maxnpc 2
Quote:
Originally Posted by SturtIndia
View Post
Make sure you have maxnpc in server.cfg and be sure you have maxnpc more than 0
example
Code:
maxnpc 0 
to
maxnpc 1
1 is depend on how many bots are there
I have 2 bots.
Reply
#9

OnPlayerConnect spawn the NPC after that return 1.
And remove it from onplayerRequestClass
Reply
#10

Quote:
Originally Posted by Clad
View Post
OnPlayerConnect spawn the NPC after that return 1.
And remove it from onplayerRequestClass
Still doesn't spawn.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)