NPC Skip the login Dialog HELP -
Stoyanov - 08.01.2015
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?
Re: NPC Skip the login Dialog HELP -
HeLiOn_PrImE - 08.01.2015
You made a dialog under OnNPCModeInit?
Ok you didn't. I don't think the problem is from the dialogs...
Re: NPC Skip the login Dialog HELP -
Stoyanov - 08.01.2015
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);
Re: NPC Skip the login Dialog HELP -
HeLiOn_PrImE - 08.01.2015
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...
Re: NPC Skip the login Dialog HELP -
Stoyanov - 09.01.2015
i've read the topic, but i already tried with
Code:
if(IsPlayerNPC(playerid)) {
return 1;
}
Any other ideas?
Re: NPC Skip the login Dialog HELP -
cyberlord - 09.01.2015
okay i am not sure ware is you problem i have same incoming messages but everything works so ?
Re: NPC Skip the login Dialog HELP -
KayJ - 09.01.2015
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
Re: NPC Skip the login Dialog HELP -
Stoyanov - 09.01.2015
Quote:
Originally Posted by cyberlord
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
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
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.
Re: NPC Skip the login Dialog HELP -
Clad - 09.01.2015
OnPlayerConnect spawn the NPC after that return 1.
And remove it from onplayerRequestClass
Re: NPC Skip the login Dialog HELP -
Stoyanov - 09.01.2015
Quote:
Originally Posted by Clad
OnPlayerConnect spawn the NPC after that return 1.
And remove it from onplayerRequestClass
|
Still doesn't spawn.