SA-MP Forums Archive
NPC On Foot Problem - 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: NPC On Foot Problem (/showthread.php?tid=101764)



NPC On Foot Problem - RoamPT - 11.10.2009

This is the only thing i added for NPC on foot.

This is mine "mini" script that make connection with the security.rec file
pawn Код:
#define RECORDING "security" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 2 //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
And this on:
pawn Код:
public OnGameModeInit()

  ConnectNPC("Jim_Caziel","security");
  return 1;
}
The NPC On Foot connects but doesn't show up IG.


Re: NPC On Foot Problem - Beaver07 - 12.10.2009

this is my onfoot bot he spawns just fine

Код:
#include <a_npc>

//------------------------------------------

main(){}

//------------------------------------------

NextPlayback()
{
  StartRecordingPlayback(PLAYER_RECORDING_TYPE_ONFOOT,"Tollbooth5");
}

//------------------------------------------

public OnRecordingPlaybackEnd()
{
  NextPlayback();
}

//------------------------------------------

public OnNPCSpawn()
{
  NextPlayback();
}

//------------------------------------------

public OnNPCExitVehicle()
{
  StopRecordingPlayback();
}



Re: NPC On Foot Problem - RoamPT - 12.10.2009

Can you show me all your NPC On Foot Stuff?


Re: NPC On Foot Problem - [XST]O_x - 12.10.2009

If that's on foot,Isn't it supposed to be
pawn Код:
#if RECORDING_TYPE == 2
?


Re: NPC On Foot Problem - RoamPT - 12.10.2009

Quote:
Originally Posted by ►ϻozilla Fir3foж◄
If that's on foot,Isn't it supposed to be
pawn Код:
#if RECORDING_TYPE == 2
?
Dunno, i think it is just needed on here:
pawn Код:
#define RECORDING_TYPE 2 //1 for in vehicle and 2 for on foot.



Re: NPC On Foot Problem - [XST]O_x - 12.10.2009

Quote:
Originally Posted by RoamPT
Quote:
Originally Posted by ►ϻozilla Fir3foж◄
If that's on foot,Isn't it supposed to be
pawn Код:
#if RECORDING_TYPE == 2
?
Dunno, i think it is just needed on here:
pawn Код:
#define RECORDING_TYPE 2 //1 for in vehicle and 2 for on foot.
Try?
And why you have OnNPCEnterVehicle If you want it to be On foot? O_o


Re: NPC On Foot Problem - RoamPT - 12.10.2009

God i am doing as explained on the tutorial, but that doesn't work. Beaver07 show me yours, to see what am i doing wrong.


Re: NPC On Foot Problem - jesse237 - 12.10.2009

the bot in the turtorial is in a vehicle recorded so it needs the vehicle, if it's on foot it doesn't need the vehicle.
also the problem could be your bot gets stopped by a Adminscript! (it needs to login which a bot can't do)
Check at the turtorial how to solve this (at bottom of turtorial)

Also i have the problem that is spawns but it doesn't move (It's on foot!!)


Re: NPC On Foot Problem - krille120 - 12.10.2009

<try make a new .record file that fixed my last problem :P:S


Re: NPC On Foot Problem - Beaver07 - 12.10.2009

Ok This is my NPC Mode Tollbooth it's just a guy that stands there

Код:
#include <a_npc>

//------------------------------------------

main(){}

//------------------------------------------

NextPlayback()
{
  StartRecordingPlayback(PLAYER_RECORDING_TYPE_ONFOOT,"Tollbooth1");
}

//------------------------------------------

public OnRecordingPlaybackEnd()
{
  NextPlayback();
}

//------------------------------------------

public OnNPCSpawn()
{
  NextPlayback();
}

//------------------------------------------

public OnNPCExitVehicle()
{
  StopRecordingPlayback();
}
it's simple as. If the npc is to walk you make a recording of it walking
just make sure that you are calling the recording when it spawns ^^
that's all i use for my bot to spawn and position it's self at the right spot