08.01.2015, 20:13
It doesn't work. I tried with:
Under OnPlayerConnect and OnPlayerRequestClass. Still doesn't show the NPC. Any ideas?
Code:
if(IsPlayerNPC(playerid)) return 1;
if(IsPlayerNPC(playerid)) return 1;
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);
if(IsPlayerNPC(playerid)) {
return 1;
}
maxnpc 0 to maxnpc 1
|
okay i am not sure ware is you problem i have same incoming messages but everything works so ?
|
|
It doesn't say NPC has joined at all. Check your serfer.cfg for maxnpc
|