SA-MP Forums Archive
Error 17 (Please help) - 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)
+--- Thread: Error 17 (Please help) (/showthread.php?tid=407389)



Error 17 (Please help) - Jamcraftadam - 13.01.2013

Hello, I was making an NPC until i got the error 17 code.
Код:
C:\Users\Adam Elliott\Desktop\Programs\SA-MP Server\filterscripts\taxi.pwn(73) : error 017: undefined symbol "MyFirstNPCVehicle"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Then heres the code line, if you need more, just reply

Код:
		PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
    }



Re: Error 17 (Please help) - Konstantinos - 13.01.2013

pawn Код:
new
    MyFirstNPCVehicle
;
as a global variable (under #define (s)).


Re: Error 17 (Please help) - Jamcraftadam - 13.01.2013

Thanks, where do i put this?


Re: Error 17 (Please help) - Konstantinos - 13.01.2013

I edited my post, but I will explain it. Global variable means outside of any callback.
pawn Код:
// includes
#include < a_samp >

// defines
#define MAX_SOMETHING 10 // An example

// Global variables
new
    MyFirstNPCVehicle
;

// Callbacks
public OnPlayerConnect(playerid) // An example
{
    return 1;
}



Re: Error 17 (Please help) - Jamcraftadam - 13.01.2013

Quote:
Originally Posted by Dwane
Посмотреть сообщение
I edited my post, but I will explain it. Global variable means outside of any callback.
pawn Код:
// includes
#include < a_samp >

// defines
#define MAX_SOMETHING 10 // An example

// Global variables
new
    MyFirstNPCVehicle
;

// Callbacks
public OnPlayerConnect(playerid) // An example
{
    return 1;
}
I have tried, But my npc wouldnt connect. Any ideas?


Re: Error 17 (Please help) - Konstantinos - 13.01.2013

Follow this tutorial: [Tutorial] Creating a new NPC by kc
It will really help you. It has also few tips about the problems at the bottom of the thread.


Re: Error 17 (Please help) - Jamcraftadam - 13.01.2013

Quote:
Originally Posted by Dwane
Посмотреть сообщение
Follow this tutorial: [Tutorial] Creating a new NPC by kc
It will really help you. It has also few tips about the problems at the bottom of the thread.
I looked around, there was a problem topic about the npc not connecting, but my server is not password protected, should i send you the code?


Re: Error 17 (Please help) - Konstantinos - 13.01.2013

No, change from your server.cfg this line
pawn Код:
maxnpc 0
to this
pawn Код:
maxnpc 1
to allow the NPCs connect. Change 1 to the number of the NPCs you have.


Re: Error 17 (Please help) - Jamcraftadam - 15.01.2013

Fixed it thanks for your help, my code was a bit tipsy