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)
+--- Thread: NPC (
/showthread.php?tid=408243)
NPC -
ikbenremco - 17.01.2013
I am tryng to create a NPC using
https://sampforum.blast.hk/showthread.php?tid=110195
but when I add the
PHP код:
public OnFilterScriptInit()
{
ConnectNPC("MyFirstNPC","mynpc");
return 1;
}
part it says :
PHP код:
"C:\Users\Remco\Desktop\SAMP Server\filterscripts\Bus2.pwn(15) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
C:\Users\Remco\Desktop\SAMP Server\filterscripts\Bus2.pwn(17) : error 017: undefined symbol "ConnectNPC""
Whole script :
PHP код:
#define RECORDING "Bus" //Dit is de bestandsnaam van je opgenomen bestand, zonder extensie!
#define RECORDING_TYPE 1 //1 Voor in een voertuig en 2 voor te voet.
#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
public OnFilterScriptInit()
{
ConnectNPC("MyFirstNPC","mynpc");
return 1;
}
Re: NPC -
SuperViper - 17.01.2013
pawn Код:
public OnGameModeInit()
{
ConnectNPC("MyFirstNPC","mynpc");
return 1;
}
That's supposed to go in your gamemode.
Re: NPC -
ikbenremco - 17.01.2013
PHP код:
public OnFilterScriptInit()
{
ConnectNPC("MyFirstNPC","mynpc");
return 1;
}
I got OnFilterScriptInit
Re: NPC -
Babul - 17.01.2013
the #include <a_npc> is wrong. your script is NOT a filterscript nor a gamemode, its a NPC script - that one which gets called by the ConnectNPC() callback (from within a filter/gamemode script).
it in fact requires 2 scripts to run a NPC: 1 (filter)script, and the npc "type" itself. a busdriver, a plane etc.
read that tutorial again, iam sure you missed something tricky there.