NPC Spawning in blueberry
#1

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
Reply
#2

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

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

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.
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)