Error 17 (Please help)
#1

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.
    }
Reply
#2

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

Thanks, where do i put this?
Reply
#4

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;
}
Reply
#5

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?
Reply
#6

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.
Reply
#7

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?
Reply
#8

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.
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)