SA-MP Forums Archive
NPC not drive! he only stands! - 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 not drive! he only stands! (/showthread.php?tid=105080)



NPC not drive! he only stands! - breakpaper - 27.10.2009

my NPC bot not drive in the server!
this is the PWN code:
pawn Code:
#define FILTERSCRIPT

#include <a_samp>
#include <a_npc>

//npc Vehicle
new npctaxi;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Taxi Bot filterscript for Breakpaper");
    print("--------------------------------------\n");
   
    ConnectNPC("[BOT]taxi","Taxibot");
  npctaxi = CreateVehicle(420, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else
#endif


public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    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, "[BOT]taxi", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, npctaxi, 0); //Putting the NPC into the vehicle we created for it.
    }
    return 1;
  }
    return 1;
}



Re: NPC not connect in server - breakpaper - 27.10.2009

Now i fixed the connection
but he don't drive now in a car


Re: NPC not connect in server - MadeMan - 27.10.2009

Can you show your npc script?


Re: NPC not connect in server - breakpaper - 27.10.2009

this one?
it is called 'Taxibot':
pawn Code:
#define RECORDING "taxiairport" //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



Re: NPC not connect in server - MadeMan - 27.10.2009

Are you sure you have "taxiairport" file in ...\npcmodes\recordings folder ?


Re: NPC not connect in server - breakpaper - 27.10.2009

yeah,
i am sure, i have copied it from scriptfiles


Re: NPC not connect in server - MadeMan - 27.10.2009

Don't know then. The recording file may be bugged and recording again may fix it, but I'm not sure.


Re: NPC not connect in server - breakpaper - 27.10.2009

i gonna try it!


Re: NPC not drive! he only stands! - thuron - 27.10.2009

try this:

change

Code:
npctaxi = CreateVehicle(420, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
to

Code:
npctaxi = CreateVehicle(420,0,0,0,0,0,0,0);



Re: NPC not drive! he only stands! - Sfinx_17 - 28.10.2009

so your problem is the NPC bot is not connected in your server then use this maybe will help you

Code:
public OnGameModeInit()
{
  print("my gamemode");
  ConnectNPC("MyFirstNPC","mynpc");
  return 1;
}



Re: NPC not drive! he only stands! - breakpaper - 28.10.2009

Quote:
Originally Posted by Sfinx_17
so your problem is the NPC bot is not connected in your server then use this maybe will help you

Код:
public OnGameModeInit()
{
  print("my gamemode");
  ConnectNPC("MyFirstNPC","mynpc");
  return 1;
}
he already connect
but he only stands at the spawn point!
i don't get out of it!
if u will help me with that he drives, than thanks


Re: NPC not drive! he only stands! - breakpaper - 28.10.2009

BUMP
need help!


Re: NPC not drive! he only stands! - Sfinx_17 - 28.10.2009

check again the tutorial maybe you miss a code just go to your pawno and check again if you have all the codes and check the tuto while you check your pawno


Re: NPC not drive! he only stands! - Synkro93 - 28.10.2009

pawn Код:
PutPlayerInVehicle(playerid, npctaxi, 0); //Putting the NPC into the vehicle we created for it.
    }
    return 1;
  }
    return 1;
}
That should be:

pawn Код:
PutPlayerInVehicle(playerid, npctaxi, 0); //Putting the NPC into the vehicle we created for it.
      return 1;
    }
  }
    return 1;
}



Re: NPC not drive! he only stands! - DreeM1 - 28.10.2009

nice ))