Walking NPC Script don't work
#1

Hey,

I recorded a npc, that walks around the streets, and it don't work.. Can someone tell me what i did wrong?

NPCscript:
Код:
#define RECORDING "Walk"
#define RECORDING_TYPE 2

#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
Filterscript:
Код:
#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Walking NPC ");
	print("--------------------------------------\n");
	return 1;
}

main()
{
	print("\n----------------------------------");
	print(" Walking NPC");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	ConnectNPC("WalkingNPC","Walk");
}

public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid))
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname));
    if(!strcmp(npcname, "WalkingNPC", true))
    {
      if(IsPlayerNPC(playerid)) return 1;
 	  	SetSpawnInfo( playerid, 0, 108, 1958.33, 1343.12, 15.36, 269.15, 31, 1000, 0, 0, 0, 0 );
  	  SetPlayerColor(playerid,0xFFFF00AA);
  	  return 1;
    }
}
	return 1;
}
Reply
#2

did you put the npcrecorded file in the correct map?
Reply
#3

Yep, the .rec file in npcmodes\recordings, and that NPCscript in npcmodes.
Reply
#4

Connecting npc.
Put at top
Код:
#define FILTERSCRIPT
And at your registration script or smth like that
at OnPlayerConnect
Код:
IsPlayerNPC(playerid)
{
 //put there some codes like putting player logged in to not force kicking 
 //like : IsPlayerLogged[playerid] = 1; etc.. 
return 1;
}
Reply
#5

i figured it out, thanks anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)