Npc error 017
#1

Can yopu help me on that please i get 1error : error 017: undefined symbol "MyFirstNPCVehicle"
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <a_npc>
#if defined FILTERSCRIPT

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

public OnFilterScriptExit()
{
	return 1;
}

#endif

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

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, "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
#2

Put
Код:
new MyFirstNPCVehicle;
under the defines.
Reply
#3

Quote:
Originally Posted by panatha
Can yopu help me on that please i get 1error : error 017: undefined symbol "MyFirstNPCVehicle"
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <a_npc>
#if defined FILTERSCRIPT

new MyFirstNPCVehicle; //<-----------------------ADD THIS HERE

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

public OnFilterScriptExit()
{
	return 1;
}

#endif

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

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, "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;
}
there ya go try that
*edit
Reply
#4

still get the same error
Reply
#5

Quote:
Originally Posted by (SF)Noobanatior
Quote:
Originally Posted by panatha
Can yopu help me on that please i get 1error : error 017: undefined symbol "MyFirstNPCVehicle"
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <a_npc>
#if defined FILTERSCRIPT

new MyFirstNPCVehicle; //<-----------------------ADD THIS HERE

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

public OnFilterScriptExit()
{
	return 1;
}

#endif

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

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, "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;
}
there ya go try that
*edit
i did that man but it isnt working..if i try out that npc at gamemode it works perfectly but i want it on a filterscript
Reply
#6

remove new MyFirstNPCVehicle under OnFilterscriptInit
Reply
#7

i tried that too ..nothing
Reply
#8

some1 reply please i really need to fix that
Reply
#9

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <a_npc>
#if defined FILTERSCRIPT

new MyFirstNPCVehicle; // Now it's a global variable.

public OnFilterScriptInit()
{
  print("my filterscript");
  ConnectNPC("MyFirstNPC","mynpc");
  MyFirstNPCVehicle = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
  return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#endif

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

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, "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
#10

still same error
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)