[SOLVED] make npcs show in class selection
#1

how can i make it to where my npc bots show up in the player class selection?
here is my code:

Код:
new Barronr1;
new Barronr2;
new Banditr1;
new Banditr2;
new Goblinr1;
new Goblinr2;
new Raiderr1;
new Raiderr2;
new Tankr1;
new Tankr2;
public OnFilterScriptInit(){
	ConnectNPC("Barrond1","Barron1");
	ConnectNPC("Barrond2","Barron2");
	ConnectNPC("Banditd1","Bandit1");
	ConnectNPC("Banditd2","Bandit2");
	ConnectNPC("Goblind1","Goblin1");
	ConnectNPC("Goblind2","Goblin2");
	ConnectNPC("Raiderd1","Raider1");
	ConnectNPC("Raiderd2","Raider2");
	ConnectNPC("Tankd1","Tank1");
	ConnectNPC("Tankd2","Tank2");
	Barronr1 = CreateVehicle(464,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
	Barronr2 = CreateVehicle(464,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
	Banditr1 = CreateVehicle(564,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
	Banditr2 = CreateVehicle(564,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
	Goblinr1 = CreateVehicle(501,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
	Goblinr2 = CreateVehicle(501,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
	Raiderr1 = CreateVehicle(465,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
	Raiderr2 = CreateVehicle(465,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
	Tankr1 = CreateVehicle(564,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
	Tankr2 = CreateVehicle(564,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
	LinkVehicleToInterior(Barronr1, 10);
	LinkVehicleToInterior(Barronr2, 10);
	LinkVehicleToInterior(Banditr1, 10);
	LinkVehicleToInterior(Banditr2, 10);
	LinkVehicleToInterior(Goblinr1, 10);
	LinkVehicleToInterior(Goblinr2, 10);
	LinkVehicleToInterior(Raiderr1, 10);
	LinkVehicleToInterior(Raiderr2, 10);
	LinkVehicleToInterior(Tankr1, 10);
	LinkVehicleToInterior(Tankr2, 10);
	}
	public OnPlayerSpawn(playerid)
	{
	if(IsPlayerNPC(playerid))
  {
	new npcname[MAX_PLAYER_NAME];
 	GetPlayerName(playerid, npcname, sizeof(npcname));

	if(!strcmp(npcname,"Barrond1",true)) {
 	PutPlayerInVehicle(playerid, Barronr1, 0);
 	LinkVehicleToInterior(Barronr1, 10);
 	SetPlayerColor(playerid,0xFF000050);
  SetPlayerSkin(playerid,287);
  return 1;
  }

 	if(!strcmp(npcname,"Barrond2",true)) {
 	PutPlayerInVehicle(playerid, Barronr2, 0);
	LinkVehicleToInterior(Barronr2, 10);
	SetPlayerColor(playerid,0xFF000050);
  SetPlayerSkin(playerid,287);
  return 1;
  }

 	if(!strcmp(npcname,"Banditd1",true)) {
 	PutPlayerInVehicle(playerid, Banditr1, 0);
 	SetPlayerColor(playerid,0xFF000050);
 	LinkVehicleToInterior(Banditr1, 10);
	SetPlayerColor(playerid,0xFF000050);
  SetPlayerSkin(playerid,287);
 	return 1;
  }

 	if(!strcmp(npcname,"Banditd2",true)) {
 	PutPlayerInVehicle(playerid, Banditr2, 0);
 	LinkVehicleToInterior(Banditr2, 10);
	SetPlayerColor(playerid,0xFF000050);
  SetPlayerSkin(playerid,287);
 	return 1;
  }

 	if(!strcmp(npcname,"Goblind1",true)) {
 	PutPlayerInVehicle(playerid, Goblinr1, 0);
 	LinkVehicleToInterior(Goblinr1, 10);
	SetPlayerColor(playerid,0xFF000050);
  SetPlayerSkin(playerid,287);
  return 1;
  }

 	if(!strcmp(npcname,"Goblind2",true)) {
 	PutPlayerInVehicle(playerid, Goblinr2, 0);
	LinkVehicleToInterior(Goblinr2, 10);
	SetPlayerColor(playerid,0xFF000050);
  SetPlayerSkin(playerid,287);
  return 1;
  }

 	if(!strcmp(npcname,"Raiderd1",true)) {
 	PutPlayerInVehicle(playerid, Raiderr1, 0);
 	LinkVehicleToInterior(Raiderr1, 10);
	SetPlayerColor(playerid,0xFF000050);
  SetPlayerSkin(playerid,287);
  return 1;
  }

 	if(!strcmp(npcname,"Raiderd2",true)) {
 	PutPlayerInVehicle(playerid, Raiderr2, 0);
	LinkVehicleToInterior(Raiderr2, 10);
	SetPlayerColor(playerid,0xFF000050);
  SetPlayerSkin(playerid,287);
  return 1;
  }

	if(!strcmp(npcname,"Tankd1",true)) {
 	PutPlayerInVehicle(playerid, Tankr1, 0);
 	LinkVehicleToInterior(Tankr1, 10);
 	SetPlayerColor(playerid,0xFF000050);
  SetPlayerSkin(playerid,287);
 	return 1;
  }

 	if(!strcmp(npcname,"Tankd2",true)) {
 	PutPlayerInVehicle(playerid, Tankr2, 0);
	LinkVehicleToInterior(Tankr1, 10);
	SetPlayerColor(playerid,0xFF000050);
  SetPlayerSkin(playerid,287);
 	return 1;
  }
  return 1;
  }
	return 1;
	}
Reply
#2

[Detail] i wanna show npc in the on player class selection because it would look cool if it did to see all the npc flying rc barrons around in this room of mine.
Reply
#3

[Detail] i wanna do this so that my npc rc barrons will startup early so that when select the skin you want you will see the npcs fly there rc barrons while you select a player. it would look cool tho flying in this one room.
Reply
#4

Quote:

Posted on: Today at 07:16:44 am

Posted on: Today at 07:19:46 am

a total of 3 minutes and 2 seconds to turn a double post into a tripple post... nice

Your going to have to wait for a reply instead of multiple posting, during this time see if you can find the answer yourself.

Reply
#5

this doesnt help me at all jese its not like it affects u all i did was double post for some extra details about my issue
Reply
#6

You could just edit your post?
Reply
#7

to late now
Reply
#8

Your not gonna get any help at all with your current attitude.
Reply
#9

Dont triple-post or anything over double-post again please. Its really anoying. BTW
I am not sure, but i think the problem is because after OnPlayerSpawn, change every LinkVehicleToInterior(YOUR_NPC_NAME, 10); to SetPlayerInterior(YOUR_NPC_NAME, 10);
It should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)