[Tutorial] Creating a new NPC

You dont have OnPlayerSpawn info for just usual NPCs without vehicles. -.-"
My bot just stands at spawn place, but he is not recorded driving cars.
Reply

How to add bot name like other players on tab list?
Reply

On my server the NPC does not move around, I'm using a GM BMG

Incoming connection: 127.0.0.1:60029
[npc: join] PorteiroVIP has joined the server <0:127.0.0.1>
Incoming connection: 189.6.8.98:60263
[join] Vinicius_Smith has joined the server <1:189.6.8.98>
File Name: Conce / Vinicius_Smith.ini
Vinicius_Smith logged on the server.

However when I put in grandlarc worked perfectly

please!
Reply

Ok ive done it as a fs and it complies find no errors or warnings but it isnt appearing ingame and i cant see it tring to login in.

Code:
#define FILTERSCRIPT

#include <a_samp>



#if defined FILTERSCRIPT

new MyFirstNPCVehicle; //Global variable!
public OnFilterScriptInit()
{
  print("my filterscript");
  ConnectNPC("MyFirstNPC","area51tank1");
  MyFirstNPCVehicle = CreateVehicle(432, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
  return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

#endif

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, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
    }
    return 1;
  }
  //Other stuff for normal players goes here!
  return 1;
}
Reply

Do you load filterscript?
Reply

yes the fliterscript loads fine.

edit- Ive got signs now of him connecting in the server log but he disconnects striaght away
Reply

My npc gets into the server but disconnects after a few seconds
pawn Code:
[npc:join] npcname has joined the server (0:127.0.0.1)
[npc:part] npcname has left the server (0:0)
!edit:! Never Mind Fixed it..
Reply

i can't compile it because i get this:
C:\Users\user1\Desktop\GTA SA server\filterscripts\gl_npcs.pwn(162) : error 021: symbol already defined: "OnFilterScriptInit"
C:\Users\user1\Desktop\GTA SA server\filterscripts\gl_npcs.pwn(169) : error 021: symbol already defined: "OnFilterScriptInit"
C:\Users\user1\Desktop\GTA SA server\filterscripts\gl_npcs.pwn(176) : error 021: symbol already defined: "OnPlayerSpawn"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.

The hell? how to fix?
Reply

My NPC are not saving to scriptfiles or recordings?
Reply

Wheres the Download
Reply

Npc's are allowed on my server xD But i got an problem... How can i despawn the npc ?
I want to do it whit a timer xD!
Reply

My npc just falls out of the car at random points, heres a video:
Reply

Thx it was very useful for me
Reply

Quote:
Originally Posted by stormchaser206
View Post
My npc just falls out of the car at random points, heres a video:
http://www.youtube.com/watch?v=r3I91qCOqoA
Someone please help / bump
Reply

Are you a teacher or something..?You can make this tutorial understoodable.......Nice done
Reply

I don't get it right what code should I put as a whole to make it work in the game mod?

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, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
return 1;
}
//Other stuff for normal players goes here!
return 1;
}
Reply

This tutorioal doesn't work. I think I have followed all the steps. Well actually I need help I don't get it to work. What have I done wrong?
Reply

Awesome tutorial! Rep+
Reply

Quote:
Originally Posted by IIKINGII
View Post
How can i change the skin of my bot
https://sampwiki.blast.hk/wiki/SetPlayerSkin.
Reply

my bot just standing at the spawn point please help i to spawn tutorial again put just standing at the spawn
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)