Npc Help
#1

Ok, so i am trying to add a Vehicle NPC, and when i try to compile... I get this error:

C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(160) : warning 204: symbol is assigned a value that is never used: "MyFirstNPCVehicle"


This is what my thing looks like:
public OnGameModeInit()
{
new MyFirstNPCVehicle; //Global variable!
print("Server");
ConnectNPC("Dave","Taxi");
MyFirstNPCVehicle = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
return 1;
}


I was following this guide:
https://sampforum.blast.hk/showthread.php?tid=95034
Reply
#2

First: It's a warning not an error so you can run your server...
Second:
pawn Код:
new MyFirstNPCVehicle
-> It's a global variable so you have to move it to your top of your script and not under OnGameModeInit()

Reply
#3

if i move it up i get this error then:

C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(160) : error 017: undefined symbol "MyFirstNPCVehicle"
Reply
#4

Quote:
Originally Posted by kickflipdude
Посмотреть сообщение
if i move it up i get this error then:

C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(160) : error 017: undefined symbol "MyFirstNPCVehicle"
Huh ?? lol ...

So you have this on the top of your script ... xD Why he says that ?
pawn Код:
new MyFirstNPCVehicle;
Maybe shoose a shorter name for it...
Use NPCvehicle in stead of MyFirstNPCVehicle ...

So replace that into this:
pawn Код:
new NPCvehicle
//and change this too:
NPCvehicle = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
Reply
#5

naww still says that :/
Reply
#6

Put it under includes, not on OGGMINIT
something like this:
pawn Код:
new MyFirstNPCVehicle; //Global variable!
pawn Код:
public OnGameModeInit()
{
    print("Server");
    ConnectNPC("Dave","Taxi");
    MyFirstNPCVehicle = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
    return 1;
}
Reply
#7

Quote:
Originally Posted by kickflipdude
Посмотреть сообщение
naww still says that :/
WTF xD

Or maybe you have move the 'new NPCvehicle' wrong ?
Where did you moved to it ?

Normally you have to add that under your

pawn Код:
#include
#define
So add it under your includes and defines :S
And above the
pawn Код:
main()
{
//....
}
Reply
#8

amg i give up lol.
Reply
#9

Quote:
Originally Posted by kickflipdude
Посмотреть сообщение
amg i give up lol.
lol xD
Show maybe youre WHOLE script xD no you don't need that to do

Or maybe pm ?
Reply
#10

how do i post my script in PAWN form? Idk how
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)