npc help needed right now please???? - 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 needed right now please???? (
/showthread.php?tid=170909)
npc help -
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
|
Re: npc help needed right now please???? -
boelie - 24.08.2010
what does the error says? please show
Re: npc help needed right now please???? -
speediekiller2 - 24.08.2010
warning 203: symbol is never used: "MyFirstNPCVehicle"
Re: npc help needed right now please???? -
Adil - 24.08.2010
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.
Re: npc help needed right now please???? -
boelie - 24.08.2010
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
Re: npc help needed right now please???? -
speediekiller2 - 24.08.2010
and why he doen't load the npc??
Re: npc help needed right now please???? -
pmk1 - 24.08.2010
speedie, what adil says is that you didnt use MyFirstNPCVehicle, not that the script doesnt load the npc..
Re: npc help needed right now please???? -
speediekiller2 - 24.08.2010
ok ok but why he doesn't load the npc did you know that
![Huh?](images/smilies/confused.gif)
?
Re: npc help needed right now please???? -
boelie - 24.08.2010
did you try what i told you ?
Re: npc help needed right now please???? -
speediekiller2 - 24.08.2010
yes sure