npc help needed right now please????
#1

My pawno says this is wrong how do I fix this?

Quote:

#include <a_samp>

new MyFirstNPCVehicle;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
ConnectNPC("Drifter","drifter");
MyFirstNPCVehicle = CreateVehicle(411, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
return 1;
}

public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Kijken of de gespawnde speler een NPC is
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //De naam aanvragen
if(!strcmp(npcname, "MyFirstNPCVehicle", true)) //Kijken of de naam klopt
{
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //NPC in zijn voertuig stoppen
}
return 1;
}
return 1;
}
#endif

Reply
#2

what does the error says? please show
Reply
#3

warning 203: symbol is never used: "MyFirstNPCVehicle"
Reply
#4

That's not wrong, it's just a warning that you're not using the Variable 'MyFirstNPCVehicle'. Basically what it's trying to say is, that there is no use of assigning 'MyFirstNPCVehicle' to CreateVehicle when you're not using it.
Reply
#5

replace if(!strcmp(npcname, "MyFirstNPCVehicle", true))
with if(!strcmp(npcname, ("Drifter", true))

then

MyFirstNPCVehicle = AddStaticVehicle(487, 0.0, 0.0, 5.0, 0.0, 4, 6);

Note: ofcourse you can change vehicle id 487 into something else you like

[edit] do not use createvehicle for npc
Reply
#6

and why he doen't load the npc??
Reply
#7

speedie, what adil says is that you didnt use MyFirstNPCVehicle, not that the script doesnt load the npc..
Reply
#8

ok ok but why he doesn't load the npc did you know that?
Reply
#9

did you try what i told you ?
Reply
#10

yes sure
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)