Jochem's Advanced NPC Creator -
Jochemd - 24.08.2011
Jochem's Advanced NPC Creator
Hello,
I've made my second Filterscript;
Advanced NPC Creator
What does it do and is special about it?
The normal npc_record script included in the server package only allows you to record the npc, and nothing more. My script also creates the script which should be put in "server_root/npcmodes" and it also creates the "OnPlayerSpawn script if you recorded in a vehicle!
Examples?
Of course. Let's say I recorded NPC 'incar.rec'. There will be three files in scriptfiles;
- incar.rec
- incar.pwn
- incar.txt
incar.rec is the file you recorded, this file should be moved to 'server_root/npcmodes/recordings'.
incar.pwn is the file which controls the recording. It should be moved to 'server_root/npcmodes'. It contains this, when you named the file 'incar'.
pawn Код:
#define RECORDING "incar"
#define RECORDING_TYPE 1
#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
incar.txt contains script to connect and eventually put the NPC in a vehicle, in case it's recorded in a vehicle.
pawn Код:
// Put the script down here in your gamemode. You might have to merge functions. Also, don't forget to replace 'npc_name_here' with the name of the NPC ingame.
new npc_name_here_vehicle;
public OnGameModeInit()
{
npc_name_here_vehicle = CreateVehicle(558,0.0,0.0,0.0,0.0,-1,-1,-1);
ConnectNPC("npc_name_here",incar);
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(!strcmp(name,"npc_name_here",false))
{
PutPlayerInVehicle(playerid,npc_name_here_vehicle,0);
}
return 1;
}
return 1;
}
Don't forget to replace the 'npc_name_here' things!
Код:
Download
v1.0 (24/08/2011): Pastebin
Credits:
- Dracoblue; DCMD
- KC; For learning me how to use a NPC about a year ago with
this tutorial
- Myself: Making the script. DO NOT RELEASE THIS WITHOUT MY PERMISSION.
I'd really like to hear your answers - what can be improved?
Jochem
Re: Jochem's Advanced NPC Creator -
TheArcher - 24.08.2011
Looks pretty nice and easy to use.
Re: Jochem's Advanced NPC Creator -
Jochemd - 24.08.2011
It doesn't only look like.
Re: Jochem's Advanced NPC Creator -
iMonk3y - 24.08.2011
Great work! Though there's already Record 'n' Play FS which allows you to record 'n' play your NPC directly in game.
Re: Jochem's Advanced NPC Creator -
Jochemd - 24.08.2011
Oh, I couldn't find anything.
Re : Jochem's Advanced NPC Creator -
Naruto_Emilio - 24.08.2011
There is already a samp npc creator and have car recording so this is unusefull try to make it dynamic or add some cool functions as NPCGUARDPLAYER(playerid, npcid)
Re: Re : Jochem's Advanced NPC Creator -
Jochemd - 24.08.2011
Quote:
Originally Posted by Naruto_Emilio
There is already a samp npc creator and have car recording so this is unusefull try to make it dynamic or add some cool functions as NPCGUARDPLAYER(playerid, npcid)
|
Read first post?
Re: Jochem's Advanced NPC Creator -
misho1 - 10.11.2011
Deleted*
Re: Jochem's Advanced NPC Creator -
misho1 - 10.11.2011
Deleted*
Re: Jochem's Advanced NPC Creator -
Salvator_Salieri - 26.11.2014
Does this work in 0.3z? Making an npc according to KC's tutorial doesnt seem to work for me in 0.3z i mean i got everything in place and all needed scripts compiled without errors and the npc enters the server and "doesnt leave" it but i dont see the npc going on the route i recorded, and since you kinda used his method in general thats why i ask whether your version works in 0.3z or not.
Re: Jochem's Advanced NPC Creator -
Jochemd - 03.12.2014
Dunno. I scripted this ages ago