[HELP]Add NPC - 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: [HELP]Add NPC (
/showthread.php?tid=253040)
[HELP]Add NPC -
huyhung65ht - 04.05.2011
I have done all these steps
http://forum.sa-mp.com/showthread.ph...light=npc+bots
Make a vehicle path but with errors
/imageshack/img151/1...0114190355.jpg
I use Raven roleplay.
this is my code
mini script
pawn Код:
#define RECORDING "cop1" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 1 //1 for in vehicle and 2 for on foot.
#include <a_npc>
main(){}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#if RECORDING_TYPE == 1
public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
public OnNPCExitVehicle() StopRecordingPlayback();
#else
public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif
gamemode
pawn Код:
new MyFirstNPCVehicle; //Global variable!
public OnGameModeInit()
{
print("roleplay");
ConnectNPC("COP","cop1");
MyFirstNPCVehicle = AddStaticVehicle(599,1527.5483,-1633.9626,13.5767,177.5422,0,1);
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "COP", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
return 1;
}
//Other stuff for normal players goes here!
return 1;
}
Sorry my bad English
Re: [HELP]Add NPC -
sciman001 - 04.05.2011
Did u make the maxnpc 0 line in server.cfg look like this:
Re: [HELP]Add NPC -
huyhung65ht - 04.05.2011
maxnpc 1
still error.
Re: [HELP]Add NPC -
huyhung65ht - 04.05.2011
Help me !
Re: [HELP]Add NPC -
huyhung65ht - 05.05.2011
can you help me ?
Re: [HELP]Add NPC -
Skylar Paul - 05.05.2011
It seems like it's stuck in the tutorial. Simply bypass the tutorial.
Re: [HELP]Add NPC -
Stigg - 05.05.2011
Quote:
Originally Posted by Skylar Paul
It seems like it's stuck in the tutorial. Simply bypass the tutorial.
|
What you on about ? He's asking for help with the tutorial. Try and help rather than hinder.
Re: [HELP]Add NPC -
Skylar Paul - 05.05.2011
Quote:
Originally Posted by Stigg
What you on about ? He's asking for help with the tutorial. Try and help rather than hinder.
|
Face-fucking-Palm;
Look at the screenshot, he's sitting in the tutorial (the bot, i'm assuming as the name is "Taxi")
Re: [HELP]Add NPC -
Stigg - 05.05.2011
Quote:
Originally Posted by Skylar Paul
Face-fucking-Palm;
Look at the screenshot, he's sitting in the tutorial (the bot, i'm assuming as the name is "Taxi")
|
OFF Topic:
There's no need to swear. He followed a tutorial, it did'nt work, so he asked for help. Simple as it get's.
ON Topic:
I suggest you retrace your steps with the tutorial and start again. Dont forget to set the players interior too.
Re: [HELP]Add NPC -
huyhung65ht - 05.05.2011
Quote:
Originally Posted by Stigg
ON Topic:
Dont forget to set the players interior too.
|
how ?