NPCs & 0.3x
#1

I'm working on a project and I can't seem to get the damn NPCs to connect.

Server.cfg:
Quote:

echo Executing Server Config...
lanmode 0
rcon_password ***
maxplayers 50
port 7777
hostname ***
gamemode0 ***
filterscripts vspawner
announce 1
plugins sscanf streamer
query 1
chatlogging 0
weburl www.sa-mp.com
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 5
logtimeformat [%H:%M:%S]

Mini script:
pawn Код:
#define RECORDING "npc1" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 1 //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
npc1.pwn is in scriptfiles/npcmodes, npc1.rec is in scriptfiles/npcmodes/recordings

GameModeInit:
pawn Код:
public OnGameModeInit ( )
{
    SetGameModeText ( "***" );
    ConnectNPC ( "npc1", "npc1" );
    ConnectNPC ( "at400_ls", "at400_ls" ); // Tried testing with this - still no luck!
   
    AddPlayerClass ( 0, 0.0, 10.0, 0.0, 0.0, 4, 1, 24, 50000, 30, 50000 );
   
    NPCHelicopter = CreateVehicle ( 503, -316.2008, 1053.3335, 20.3403, 0.0, 6, 3, 5000 );
    return true;
}
What am I doing wrong?
Reply
#2

.cfg maxnpc <<< chek this

samp-npc < same version like server

npc1.pwn is in scriptfiles/npcmodes

You need .amx not pwn

And in you OnplayerConnect(playerid)

if(IsPlayerNPC(playerid))return 1; // so if you have login screan npc bypass it

//ongamemodeinit
ConnectNPC("NPC_NAME","npcmodesAmxWithoutExtension ");// name of player , name of npcmodes .amx file

//simple exemple of npc amx file in npcmode
pawn Код:
#include <a_npc>



main() {}



NextPlayBack()
{
    StartRecordingPlayback(PLAYER_RECORDING_TYPE_ONFOOT,"nameofrec");//name of .rec in npcmodes/recordings
}
public OnRecordingPlaybackEnd()
{
    NextPlayBack();
}
public OnNPCSpawn()
{
    NextPlayBack();
}
public OnNPCExitVehicle()
{
    StopRecordingPlayback();
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)