04.04.2011, 14:56
look you need to do like this
open pawno and paste this :
then compile that and give it name "mynpc1"
then go to your gamemode
and find public OnFilterScriptInit()
type above public OnFilterScriptInit()
then type in public OnFilterScriptInit()
then find OnPlayerSpawn
and add this:
it gonna work
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 go to your gamemode
and find public OnFilterScriptInit()
type above public OnFilterScriptInit()
Quote:
new MyFirstNPCVehicle; |
Quote:
MyFirstNPCVehicle = CreateVehicle(545, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000); |
Quote:
ConnectNPC("James_Keyworth","mynpc1"); |
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; } |