#define RECORDING "nomis01" //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
#pragma tabsize 0 #include <a_samp> new plane; //Global variable! public OnFilterScriptInit() { ConnectNPC("driver","nrg"); plane = CreateVehicle(519, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000); return 1; } public OnPlayerSpawn(playerid) { 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, "driver", true)) //Checking if the NPC's name is MyFirstNPC { PutPlayerInVehicle(playerid, plane, 0); //Putting the NPC into the vehicle we created for it. } return 1; } //Other stuff for normal players goes here! return 1; }
Originally Posted by Nomis3
Code:
#define RECORDING "nomis01" //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 Code:
#pragma tabsize 0 #include <a_samp> new plane; //Global variable! public OnFilterScriptInit() { ConnectNPC("driver","nrg"); plane = CreateVehicle(519, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000); return 1; } public OnPlayerSpawn(playerid) { 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, "driver", true)) //Checking if the NPC's name is MyFirstNPC { PutPlayerInVehicle(playerid, plane, 0); //Putting the NPC into the vehicle we created for it. } return 1; } //Other stuff for normal players goes here! return 1; } Nomis |