[FilterScript] Jochem's Advanced NPC Creator
#1

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
Reply
#2

Looks pretty nice and easy to use.
Reply
#3

It doesn't only look like.
Reply
#4

Great work! Though there's already Record 'n' Play FS which allows you to record 'n' play your NPC directly in game.
Reply
#5

Oh, I couldn't find anything.
Reply
#6

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)
Reply
#7

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?
Reply
#8

Deleted*
Reply
#9

Deleted*
Reply
#10

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.
Reply
#11

Dunno. I scripted this ages ago
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)