NPC help
#4

look you need to do like this

open pawno and paste this :
Quote:

#include <a_samp>
#include <a_npc>
#define RECORDING "mynpc" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 1
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

then compile that and give it name "mynpc1"
then go to your gamemode
and find public OnFilterScriptInit()
type above public OnFilterScriptInit()
Quote:

new MyFirstNPCVehicle;

then type in public OnFilterScriptInit()
Quote:

MyFirstNPCVehicle = CreateVehicle(545, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);

Quote:

ConnectNPC("James_Keyworth","mynpc1");

then find OnPlayerSpawn
and add this:
Quote:

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, "James_Keyworth", 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;
}

it gonna work
Reply


Messages In This Thread
NPC help - by Jack_Rocker - 04.04.2011, 13:49
Re: NPC help - by Amel_PAtomAXx - 04.04.2011, 13:51
Re: NPC help - by Jack_Rocker - 04.04.2011, 14:40
Re: NPC help - by Amel_PAtomAXx - 04.04.2011, 14:56

Forum Jump:


Users browsing this thread: 2 Guest(s)