SA-MP Forums Archive
Npc 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Npc Help (/showthread.php?tid=245160)



Npc Help - kickflipdude - 30.03.2011

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


Re: Npc Help - Michael@Belgium - 30.03.2011

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()




Re: Npc Help - kickflipdude - 30.03.2011

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"


Re: Npc Help - Michael@Belgium - 30.03.2011

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



Re: Npc Help - kickflipdude - 30.03.2011

naww still says that :/


Re: Npc Help - HyperZ - 30.03.2011

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



Re: Npc Help - Michael@Belgium - 30.03.2011

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()
{
//....
}



Re: Npc Help - kickflipdude - 30.03.2011

amg i give up lol.


Re: Npc Help - Michael@Belgium - 30.03.2011

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 ?


Re: Npc Help - kickflipdude - 30.03.2011

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