SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 10/10/2009, 02:09 PM   #1
Nomis3
Little Clucker
 
Join Date: Jun 2008
Posts: 3
Reputation: 0
Default NPC doesn't move:S

Hello,

I have a problem, my NPC doesn't move, It just stand in the server
i have tryed a cople of thinks,

1. I tryed my own,
2. i tryed 1 from the server
3. i downloaded 1 and tryed that,

but it won't move:S

If i kick the npc's and use the command /rcon reloadfs bots, they comeback and they move, but in the wrong car:S,

my own that i used the first time is this one, i followd the tut, only it still doesn't work
they all stands on the right place just how the tut sad
Code:
#define RECORDING "nomis01" //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
Code:
#pragma tabsize 0
#include <a_samp>

new plane; //Global variable!

public OnFilterScriptInit()
{
  ConnectNPC("driver","nrg");
  plane = CreateVehicle(519, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
  return 1;
}
public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
    if(!strcmp(npcname, "driver", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, plane, 0); //Putting the NPC into the vehicle we created for it.
    }
    return 1;
  }
  //Other stuff for normal players goes here!
  return 1;
}
Thanks for helping, Sorry for my bad English

Nomis
Nomis3 is offline  
Old 10/10/2009, 02:11 PM   #2
gemadon
Big Clucker
 
Join Date: Oct 2008
Posts: 119
Reputation: 0
Default Re: NPC doesn't move:S

How long is the recording?

Try recording in parts, and when one recording is over, play next record . .

This happened to me before when my recording file was way too big .
gemadon is offline  
Old 10/10/2009, 04:18 PM   #3
V1ceC1ty
Banned
 
Join Date: Oct 2008
Location: West Australia
Posts: 1,896
Reputation: 273
Default Re: NPC doesn't move:S

the file size has nothing to do with it.

make sure all .rec files are in /npcmodes/recordings/
V1ceC1ty is offline  
Old 10/10/2009, 07:18 PM   #4
RoamPT
High-roller
 
RoamPT's Avatar
 
Join Date: Nov 2007
Location: Toronto, Canada
Posts: 1,110
Reputation: 26
Default Re: NPC doesn't move:S

Quote:
Originally Posted by Nomis3

Code:
#define RECORDING "nomis01" //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
Code:
#pragma tabsize 0
#include <a_samp>

new plane; //Global variable!

public OnFilterScriptInit()
{
  ConnectNPC("driver","nrg");
  plane = CreateVehicle(519, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
  return 1;
}
public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
    if(!strcmp(npcname, "driver", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, plane, 0); //Putting the NPC into the vehicle we created for it.
    }
    return 1;
  }
  //Other stuff for normal players goes here!
  return 1;
}
Thanks for helping, Sorry for my bad English

Nomis
You have on #define RECORDING "nomis01" and in ConnectNPC("driver","nrg");

The name on #define RECORDING has to be the same on ConnectNPC.

E.g.
#define RECORDING "mynpc" //This is the filename of your recording without the extension.

ConnectNPC("MyFirstNPC","mynpc");

Where you have nrg you should replace for nomis01, if nomis01 is your .rec

Can you understand?
__________________
RoamPT is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't see each other move ihatetn931 Help Archive 5 12/03/2010 10:57 AM
move object Brian_Furios Help Archive 1 11/03/2010 07:59 PM
Bot not move whitedragon Help Archive 7 23/01/2010 01:11 PM
/move [x] [y] [z] hazdog Help Archive 8 21/03/2009 11:02 AM
I like to move it move it, I like to move it move it xD Dujma Everything and Nothing 4 18/12/2008 08:49 AM


All times are GMT. The time now is 12:53 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.