[HELP]Add NPC
#1

I have done all these steps
http://forum.sa-mp.com/showthread.ph...light=npc+bots

Make a vehicle path but with errors

/imageshack/img151/1...0114190355.jpg


I use Raven roleplay.

this is my code

mini script

pawn Код:
#define RECORDING "cop1" //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
gamemode

pawn Код:
new MyFirstNPCVehicle; //Global variable!
public OnGameModeInit()
{
  print("roleplay");
  ConnectNPC("COP","cop1");
  MyFirstNPCVehicle = AddStaticVehicle(599,1527.5483,-1633.9626,13.5767,177.5422,0,1);
  return 1;
}
pawn Код:
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, "COP", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
    }
    return 1;
  }
  //Other stuff for normal players goes here!
  return 1;
}

Sorry my bad English
Reply
#2

Did u make the maxnpc 0 line in server.cfg look like this:
Код:
maxnpc 1
Reply
#3

maxnpc 1

still error.
Reply
#4

Help me !
Reply
#5

can you help me ?
Reply
#6

It seems like it's stuck in the tutorial. Simply bypass the tutorial.
Reply
#7

Quote:
Originally Posted by Skylar Paul
Посмотреть сообщение
It seems like it's stuck in the tutorial. Simply bypass the tutorial.
What you on about ? He's asking for help with the tutorial. Try and help rather than hinder.
Reply
#8

Quote:
Originally Posted by Stigg
Посмотреть сообщение
What you on about ? He's asking for help with the tutorial. Try and help rather than hinder.
Face-fucking-Palm;

Quote:

I have done all these steps
http://forum.sa-mp.com/showthread.ph...light=npc+bots

Make a vehicle path but with errors

/imageshack/img151/1...0114190355.jpg
Look at the screenshot, he's sitting in the tutorial (the bot, i'm assuming as the name is "Taxi")
Reply
#9

Quote:
Originally Posted by Skylar Paul
Посмотреть сообщение
Face-fucking-Palm;



Look at the screenshot, he's sitting in the tutorial (the bot, i'm assuming as the name is "Taxi")
OFF Topic:

There's no need to swear. He followed a tutorial, it did'nt work, so he asked for help. Simple as it get's.

ON Topic:

I suggest you retrace your steps with the tutorial and start again. Dont forget to set the players interior too.
Reply
#10

Quote:
Originally Posted by Stigg
Посмотреть сообщение
ON Topic:

Dont forget to set the players interior too.
how ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)