SA-MP Forums Archive
npc problem - 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 problem (/showthread.php?tid=170911)



npc problem - speediekiller2 - 24.08.2010

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