[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


Messages In This Thread
[HELP]Add NPC - by huyhung65ht - 04.05.2011, 12:42
Re: [HELP]Add NPC - by sciman001 - 04.05.2011, 12:46
Re: [HELP]Add NPC - by huyhung65ht - 04.05.2011, 13:06
Re: [HELP]Add NPC - by huyhung65ht - 04.05.2011, 15:08
Re: [HELP]Add NPC - by huyhung65ht - 05.05.2011, 02:15
Re: [HELP]Add NPC - by Skylar Paul - 05.05.2011, 02:27
Re: [HELP]Add NPC - by Stigg - 05.05.2011, 02:32
Re: [HELP]Add NPC - by Skylar Paul - 05.05.2011, 02:35
Re: [HELP]Add NPC - by Stigg - 05.05.2011, 02:44
Re: [HELP]Add NPC - by huyhung65ht - 05.05.2011, 03:50

Forum Jump:


Users browsing this thread: 2 Guest(s)