[HELP]NPC
#1

ZZ,
One problem, i made NPC on foot (just staying,no moving) and when i want to compile mj FS, got 2 errors and 2 warnings

fs:
Код:
#define FILTERSCRIPT

#include <a_samp>
#include <a_npc>


#define RECORDING "ammu"
#define RECORDING_TYPE 2

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

public OnFilterScriptInit()
{
	ConnectNPC("uAmmu","ammu");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}
errors and warnings:
Код:
C:\Users\Mate\Desktop\Server\pawno\npc.pwn(11) : warning 235: public function lacks forward declaration (symbol "OnRecordingPlaybackEnd")
C:\Users\Mate\Desktop\Server\pawno\npc.pwn(11) : error 017: undefined symbol "StartRecordingPlayback"
C:\Users\Mate\Desktop\Server\pawno\npc.pwn(17) : warning 235: public function lacks forward declaration (symbol "OnNPCSpawn")
C:\Users\Mate\Desktop\Server\pawno\npc.pwn(17) : error 017: undefined symbol "StartRecordingPlayback"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

It should be,
#define RECORDING_TYPE 1
If I am not mistaken,
and for the error's, make sure the FS is compiling in a updated version of Pawno.
Reply
#3

You dont use a_samp and a_npc in the same script. It should be two different scripts. This one goes in your "npcmodes" folder:
pawn Код:
#include <a_npc>


#define RECORDING "ammu"
#define RECORDING_TYPE 2

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 then you use a normal FS to connect the NPC or connect it via your GM.
Reply
#4

Quote:
Originally Posted by Fj0rtizFredde
Посмотреть сообщение
You dont use a_samp and a_npc in the same script. It should be two different scripts. This one goes in your "npcmodes" folder:
pawn Код:
#include <a_npc>


#define RECORDING "ammu"
#define RECORDING_TYPE 2

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 then you use a normal FS to connect the NPC or connect it via your GM.
thanks now there isn't any problems but one Question: can I use npc in interior?
Reply
#5

Sure you can. Use OnPlayerConnect and check if the player is a NPC then just use SetPlayerPos and SetPlayerInterior.
Reply
#6

please I'm noob and I can't put it in my GM and I don't now howw to make him in interior, could you please make me that? I will send you my mod, please?
Reply
#7

Go to weedarr.wikidot.com
Goto, the interiors section,
Find the one you want and do the following.
Under,
pawn Код:
public OnPlayerConnect()
Put
pawn Код:
SetPlayerPos(playerid, X, Y, Z);//X, Y, Z is the cord's found on the website.
SetPlayerInterior(playerid, InteriorID);//Interior ID found on website.
Make sure you define, to only do that, if it's a NPC.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)