SA-MP Forums Archive
NPC Spawning in blueberry - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: NPC Spawning in blueberry (/showthread.php?tid=309472)



NPC Spawning in blueberry - Kyle - 07.01.2012

I made my NPC and it is suppost to spawn in a coach but it spawns in blueberry:

Код:
ConnectNPC("[BOT]Simpson","bot_bus");

BusBotVehicle = AddStaticVehicle(437,-2274.0593,2320.3589,4.9544,359.6692,79,7); // coach


OnPlayerSpawn

	if(!strcmp(UserInfo[playerid][Name],"[BOT]Simpson",true))
	{
 		SetPlayerSkin(playerid,255);
   		SetPlayerColor(playerid, COLOR_WHITE);

		UserInfo[playerid][Team] = TEAM_CIVIL_DRIVER;

		UserInfo[playerid][Spawned] = 1;
  		PutPlayerInVehicle(playerid,BusBotVehicle,0);
  		return 1;
 	}
Here is the npc pwn code: http://pastebin.com/6kcnBbbw

Thanks


Re: NPC Spawning in blueberry - TheArcher - 07.01.2012

Post where ConnectNPC and BusBotVehicle are placed + the example is going to confuse.


Re: NPC Spawning in blueberry - FireCat - 07.01.2012

Where are you assigning his name to UserInfo[playerid][Name]?


Re: NPC Spawning in blueberry - Kyle - 07.01.2012

Quote:
Originally Posted by TheArcher
Посмотреть сообщение
Post where ConnectNPC and BusBotVehicle are placed + the example is going to confuse.
ConnectNPC and BusBotVehicle under ongamemodeinit

Quote:
Originally Posted by FireCat
Посмотреть сообщение
Where are you assigning his name to UserInfo[playerid][Name]?
This variable is fine, I checked. The if statement on strcmp spawn gets entered too.


Re: NPC Spawning in blueberry - Stigg - 07.01.2012

Try:
pawn Код:
#define RECORDING "bus"       //This is the filename of your recording without the extension.
#define RECORDING_TYPE 1      //1 for in vehicle and 2 for on foot.

#include <a_npc>
main(){}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);

#if RECORDING_TYPE == 1
  public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
  public OnNPCExitVehicle() StopRecordingPlayback();
#else
  public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif