SA-MP Forums Archive
Npc error 017 - 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 error 017 (/showthread.php?tid=155044)



Npc error 017 - panatha - 16.06.2010

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;
}



Re: Npc error 017 - Antonio [G-RP] - 16.06.2010

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


Re: Npc error 017 - (SF)Noobanatior - 16.06.2010

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


Re: Npc error 017 - panatha - 16.06.2010

still get the same error


Re: Npc error 017 - panatha - 16.06.2010

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



Re: Npc error 017 - Antonio [G-RP] - 16.06.2010

remove new MyFirstNPCVehicle under OnFilterscriptInit


Re: Npc error 017 - panatha - 16.06.2010

i tried that too ..nothing


Re: Npc error 017 - panatha - 16.06.2010

some1 reply please i really need to fix that


Re: Npc error 017 - dcmd_crash - 16.06.2010

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;
}



Re: Npc error 017 - panatha - 17.06.2010

still same error