Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- #include <a_samp>
- new airportbusVehicle;
- new flightlvVehicle;
- new flightlsVehicle;
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" NPCs(2 Flights and a Airport Bus) loaded!");
- print("--------------------------------------\n");
- ConnectNPC("[NPC]Flight to LS","Flight2");
- ConnectNPC("[NPC]Airport Shuttle","airportbus");
- ConnectNPC("[NPC]Flight to LV","flight1");
- airportbusVehicle = CreateVehicle(431, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
- flightlvVehicle = CreateVehicle(519, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
- flightlsVehicle = CreateVehicle(519, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" NPCs by Daniel Schumacher 98");
- print("----------------------------------\n");
- }
- #endif
- 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, "Airportbus", true)) //Checking if the NPC's name is MyFirstNPC
- {
- PutPlayerInVehicle(playerid, airportbusVehicle, 0); //Putting the NPC into the vehicle we created for it.
- return 1;
- }
- if(!strcmp(npcname, "flight1", true))
- {
- PutPlayerInVehicle(playerid, flightlvVehicle, 0);
- return 1;
- }
- if(!strcmp(npcname, "Flight2", true))
- {
- PutPlayerInVehicle(playerid, flightlsVehicle, 0);
- return 1;
- }
- return 1;
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment