NPC help
#1

how do i make a bot connect to my server when its need register/login? please help
Reply
#2

if(IsPlayerNPC(playerid)return 1; at the top onconnect
Reply
#3

I'm guessing you're using the godfather or an edit of it

in onplayerrequestclass

Код:
if(IsPlayerNPC(playerid)) return SpawnPlayer(playerid);
in onplayerspawn

Код:
if(IsPlayerNPC(playerid)) return SetPlayerSpawn(playerid);
Reply
#4

Quote:
Originally Posted by big comfy couch
I'm guessing you're using the godfather or an edit of it

in onplayerrequestclass

Код:
if(IsPlayerNPC(playerid)) return SpawnPlayer(playerid);
in onplayerspawn

Код:
if(IsPlayerNPC(playerid)) return SetPlayerSpawn(playerid);
no im using Raven's RP i edited it using help
Reply
#5

k Sry for double post,
This is the FS that i DL'ed:
Код:
//NPC Created By JustinB
//Do NOT remove The Line above This




#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

new Super; //Global variable!
public OnFilterScriptInit()
{
  print("Viper Filterscript");
  ConnectNPC("Kriminal","Kriminal");
  Super = CreateVehicle(506, 0.0, 0.0, 5.0, 0.0, 0, 1, 5000);
  return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

#endif

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

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}
and well when i start server the bot crashes:

Incoming Connection: X.XXX:XXXX
NPC_Kriminal has joined.
INFO: Kriminal has left the server. (Crashed)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)