NPC problem
#1

Please help with what there can be a problem. I have made FS npc for the server on a sample from gl_npcs.pwn. But when I load a server with it FS the train which LV goes only. Other two boats (train LS and SF) stand on the spawn. What there can be a problem? I use the modifed Godfather gamemode. I am below shown my FS:


Код:
#include <a_samp>
public OnFilterScriptInit()
{
	ConnectNPC("LSTrain","train_ls");
	ConnectNPC("SFTrain","train_sf");
	ConnectNPC("LVTrain","train_lv");
	return 1;
}


public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid)) 
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname));
    if(!strcmp(npcname, "LSTrain", true)) 
    {
      PutPlayerInVehicle(playerid,429,0);
      SetPlayerColor(playerid,0xFFFFFFFF);
      return 1;
    }
    if(!strcmp(npcname, "SFTrain", true))
    {
      PutPlayerInVehicle(playerid,425,0);
      SetPlayerColor(playerid,0xFFFFFFFF);
      return 1;
    }
    if(!strcmp(npcname, "LVTrain", true))
    {
      PutPlayerInVehicle(playerid,421,0);
	  SetPlayerColor(playerid,0xFFFFFFFF);
      return 1;
    }
    return 1;
  }
  //Other stuff for normal players goes here!
  return 1;
}
Reply
#2

you need to tell the script that they are already logged in
Reply
#3

Quote:
Originally Posted by √№ceC№ty
you need to tell the script that they are already logged in
i made this.
Код:
 
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid)) 
  {
    gPlayerLogged[playerid] = 1;
    return 1;
  }
//other code
But it is not solve my problem.
Reply
#4

Код:
new Logged[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
	if(!IsPlayerNPC(playerid)) return 1;
     {
     Logged[playerid] = 1;
     }
     return 1;
}
This may change according to your system login

Right?
Reply
#5

OnPlayerSpawn?
Unless in OnPlayerSpawn I should speak script that a NPC are already logged in and here again to put NPC in the vehicle??

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)