SA-MP Forums Archive
NPC Issue. - 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 Issue. (/showthread.php?tid=182149)



NPC Issue. - CrucixTM - 09.10.2010

I recorded an NPC that stands still, recording named "GateGuard".

I moved that file to npcmodes\recordings

Made a pawno script in npcmodes directory with only the following:

pawn Code:
#define RECORDING "GateGuard" //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 I added this in my gamemode:

pawn Code:
public OnGameModeInit()
{
    // General
   
    blabla
   
   
    // NPCs
   
    ConnectNPC("Sergeant_Wyatt","GateGuard");
And I put

pawn Code:
if(IsPlayerNPC(playerid)) return 1;
under OnPlayerConnect, OnPlayerRequestClass, OnPlayerRequestSpawn, OnPlayerSpawn.

Still, my NPC does not show up. The server log says:



And the server appears empty.

Any help please? I followed this tutorial: https://sampforum.blast.hk/showthread.php?tid=95034 - I don't wanna bump that, however.


Re: NPC Issue. - mmrk - 09.10.2010

If bot joins he takes one slot
Example:
If you have 100 slots server and you add one bot then your slots would be 0/99


Re: NPC Issue. - CrucixTM - 09.10.2010

Quote:
Originally Posted by mmrk
View Post
If bot joins he takes one slot
Example:
If you have 100 slots server and you add one bot then your slots would be 0/99
Well, my server is set to 3 slots. That would make it 2. But it stays at 3. In other words, the bot can't connect, or what?

Here's my server.cfg if that helps:

Code:
echo Executing Server Config...
lanmode 1
rcon_password -Edited out-
maxplayers 3
port 7777
hostname Test
gamemode0 CSRP 1
filterscripts
plugins streamer
announce 0
query 1
weburl smouch.net/lol



Re: NPC Issue. - CrucixTM - 09.10.2010

I fixed it never mind. :P

I forgot
Code:
maxnpc 20
In server.cfg.