SA-MP Forums Archive
need help with npc - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: need help with npc (/showthread.php?tid=119324)



need help with npc - rs2fun111 - 07.01.2010

look that picture . can someone say what is wrong of this code?



my filterscript is like that:

pawn Код:
#include <a_samp>
#include <a_npc>
#define RECORDING "shamal"
#define RECORDING_TYPE 1

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
*/

new shamal;
public OnFilterScriptInit()
{
  AddPlayerClass(193,2113.274658, -2420.321044, 14.466621,31.3545,0,0,0,0,0,0);
  print("Shamal Started");
  ConnectNPC("Shamal_Pilot","shamal");
  shamal = CreateVehicle(519, 2113.274658, -2420.321044, 14.466621, 0.0, 3, 3, 5000);
  return 1;
}
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));
    if(!strcmp(npcname, "Shamal_Pilot", true))
    {
    PutPlayerInVehicle(playerid, shamal, 0);
    }
    return 1;
  }
  return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
  SetPlayerCameraPos(playerid, 413.848114, 2532.846191, 19.148437);
  SetPlayerCameraLookAt(playerid, 415.967041, 2530.902587, 19.176570);
  SetPlayerPos(playerid, 415.967041, 2530.902587, 19.176570);
  SetPlayerInterior(playerid, 0);
  SetPlayerFacingAngle(playerid, 51.239612);
  return 1;
}



Re: need help with npc - rs2fun111 - 08.01.2010




Re: need help with npc - V1ceC1ty - 08.01.2010

Make sure the .rec files are in the recordings folder and you dont need AddPlayerClass in there either, try change it to SetSpawnInfo and see if that works.


Re: need help with npc - Mechscape - 08.01.2010

I got that same problem. In trailer and shamal.


Re: need help with npc - rs2fun111 - 08.01.2010

.rec files are in right place .


Re: need help with npc - V1ceC1ty - 08.01.2010

Then try adding SetPawnInfo above PutPlayerInVehicle and take out AddPlayerClass.


Re: need help with npc - rs2fun111 - 08.01.2010

my own recorded npcs wont work but if i used the grove street npcs then the moved :O !


Re: need help with npc - bluray - 08.01.2010

see if this helps
http://forum.sa-mp.com/index.php?topic=119947.0
soz its all i know. lol


Re: need help with npc - rs2fun111 - 08.01.2010

already tryd that version