need help with NPC creating
#3

Quote:

#define RECORDING "mynpc" //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


..in NPCModes
and in filterscripts this one:

#include <a_samp>
#include <a_npc>

new MyFirstNPCVehicle; //Global variable!
public OnFilterScriptInit()
{
ConnectNPC("MyFirstNPC","mynpc");
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
MyFirstNPCVehicle = AddStaticVehicle(520,-2038.8418,145.7136,33.9382, 0, 0, 0);
return 1;
}

public OnFilterScriptExit()
{
return 1;
}



main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}



public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
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, "MyFirstNPC", 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;
}

the coordinates of the car dont matter
did you record it urself?
else try this
Quote:

#define RECORDING "mynpc" //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


..in NPCModes
and in filterscripts this one:

#include <a_samp>
#include <a_npc>

new MyFirstNPCVehicle; //Global variable!
public OnFilterScriptInit()
{
ConnectNPC("MyFirstNPC","mynpc");
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
MyFirstNPCVehicle = AddStaticVehicle(520,-2038.8418,145.7136,33.9382, 0, 0, 0);
return 1;
}

public OnFilterScriptExit()
{
return 1;
}



main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}



public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnPlayerSpawn(playerid)
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "MyFirstNPC", true))
{
SetSpawnInfo( playerid, team, skin, x, y, z, angle, weap1, ammo1, weap2, ammo2, weap3, ammo3 );
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0);
return 1;
}
return 1;
}
//Other stuff for normal players goes here!
return 1;
}

Reply


Messages In This Thread
need help with NPC creating - by the_zande - 09.07.2010, 19:16
Re: need help with NPC creating - by the_zande - 09.07.2010, 23:31
Re: need help with NPC creating - by selten98 - 09.07.2010, 23:44

Forum Jump:


Users browsing this thread: 1 Guest(s)