SA-MP Forums Archive
Problem with NPC script. Having some errors. - 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: Problem with NPC script. Having some errors. (/showthread.php?tid=118399)



Problem with NPC script. Having some errors. - wiilweer - 03.01.2010

Today I tried to add some NPC-s.

If I add that code with filterscript, bot wont join.

Код:
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
Seperately this code gets no errors but if i use it in my GM then those errors are coming up:

Errors
Код:
C:\Users\Kodu\Desktop\sa-mp\gamemodes\beta01.pwn(23) : warning 235: public function lacks forward declaration (symbol "OnRecordingPlaybackEnd")
C:\Users\Kodu\Desktop\sa-mp\gamemodes\beta01.pwn(23) : error 017: undefined symbol "StartRecordingPlayback"
C:\Users\Kodu\Desktop\sa-mp\gamemodes\beta01.pwn(26) : warning 235: public function lacks forward declaration (symbol "OnNPCEnterVehicle")
C:\Users\Kodu\Desktop\sa-mp\gamemodes\beta01.pwn(26) : error 017: undefined symbol "StartRecordingPlayback"
C:\Users\Kodu\Desktop\sa-mp\gamemodes\beta01.pwn(27) : warning 235: public function lacks forward declaration (symbol "OnNPCExitVehicle")
C:\Users\Kodu\Desktop\sa-mp\gamemodes\beta01.pwn(27) : error 017: undefined symbol "StopRecordingPlayback"



Re: Problem with NPC script. Having some errors. - Correlli - 03.01.2010

Quote:
Originally Posted by wiilweer
Seperately this code gets no errors but if i use it in my GM then those errors are coming up:
These functions/callbacks can only be used in the NPC scripts.


Re: Problem with NPC script. Having some errors. - wiilweer - 03.01.2010

SO I create totally new pawn file and put these call backs/functions there?And why does not my NPC join ?


Re: Problem with NPC script. Having some errors. - Correlli - 03.01.2010

Read this topic and you'll know all the basic things about NPCs.


Re: Problem with NPC script. Having some errors. - wiilweer - 03.01.2010

Now i read twice and i got it working. Now they are just standing at spawnpoints :S. NPC-s are ONFOOT. I think it something up to this:

Код:
SetGameModeText("TestServer");
	ConnectNPC("Aljosha", "npc");
	ConnectNPC("Nikolai", "kondiv");
	AddPlayerClass(1, 1726.2003,-1642.1716,20.2251,171.9491, 0, 0, 0, 0, 0, 0);