Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <cpstream>
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_BLUE 0x0000BBAA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_PURPLE 0x9900FFAA
- #define COLOR_BRIGHTRED 0xFF0000AA
- forward FlightStart();
- forward FlightEnd();
- new Menu:Tickets;
- new Destination[MAX_PLAYERS];
- new LVAP;
- new LVAPout;
- new BuyT;
- new SFAP;
- new LSAP;
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Plane Ticket FS - By Yaheli");
- print("--------------------------------------\n");
- /*================*
- * Plane Tickets Sys
- *=================*/
- BuyT = CPS_AddCheckpoint(-1829.6534, 17.6364, 1061.1436, 1.5, 35);
- LVAP = CreatePickup(1318, 2, 1673.6857, 1447.8342, 10.7847);
- LVAPout = CreatePickup(1318, 2, -1830.5490, 5.7798, 1061.1436);
- SFAP = CreatePickup(1318, 2, -1421.7201, -288.6679, 14.1484);
- LSAP = CreatePickup(1318, 2, 1685.4467, -2334.0562, 13.5469);
- Tickets = CreateMenu("Plane Tickets", 1, 50.0, 180.0, 200.0, 200.0);
- SetMenuColumnHeader(Tickets, 0, "Select a Destination"); // Plane Selection Menu
- AddMenuItem(Tickets, 0, "Las Venturas - $1000");
- AddMenuItem(Tickets, 0, "San Fierro - $1000");
- AddMenuItem(Tickets, 0, "Los Santos - $1000");
- AddMenuItem(Tickets, 0, "- Exit Menu -");
- SetTimer("FlightStart", 300000, 1);
- //==========================================================================
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- #endif
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerPrivmsg(playerid, recieverid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- public OnPlayerInfoChange(playerid)
- {
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- new cp;
- cp = CPS_GetPlayerCheckpoint(playerid);
- if (cp == BuyT)
- {
- SendClientMessage(playerid, COLOR_WHITE, "In order to buy a ticket you must first pick a destination.");
- ShowMenuForPlayer(Tickets, playerid);
- TogglePlayerControllable(playerid, 0);
- }
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == LVAP)
- {
- if(IsPlayerInAnyVehicle(playerid)) return 0;
- SetPlayerInterior(playerid, 14);
- SetPlayerPos(playerid, -1827.147338, 7.207418, 1061.143554);
- SetPlayerVirtualWorld(playerid, 111);
- }
- else if(pickupid == SFAP)
- {
- if(IsPlayerInAnyVehicle(playerid)) return 0;
- SetPlayerInterior(playerid, 14);
- SetPlayerPos(playerid, -1827.147338, 7.207418, 1061.143554);
- SetPlayerVirtualWorld(playerid, 222);
- }
- else if(pickupid == LSAP)
- {
- if(IsPlayerInAnyVehicle(playerid)) return 0;
- SetPlayerInterior(playerid, 14);
- SetPlayerPos(playerid, -1827.147338, 7.207418, 1061.143554);
- SetPlayerVirtualWorld(playerid, 333);
- }
- else if(pickupid == LVAPout)
- {
- if(GetPlayerVirtualWorld(playerid) == 111)
- {
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, 1673.6857, 1447.8342, 10.7847);
- }
- else if(GetPlayerVirtualWorld(playerid) == 222)
- {
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, -1422.7201, -288.6679, 14.1484);
- }
- else if(GetPlayerVirtualWorld(playerid) == 333)
- {
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, 1686.4467, -2334.0562, 13.5469);
- }
- }
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- new Menu:current;
- current = GetPlayerMenu(playerid);
- if(current == Tickets)
- {
- TogglePlayerControllable(playerid, 1);
- switch(row)
- {
- case 0: // Los Santos
- {
- if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You don't have $1,000!");
- Destination[playerid] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "You bought a ticket to Las Venturas. You will be teleported to a plane shortly.");
- HideMenuForPlayer(Tickets, playerid);
- GivePlayerMoney(playerid, -1000);
- }
- case 1: // San Fierro
- {
- if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You don't have $1,000!");
- Destination[playerid] = 2;
- SendClientMessage(playerid, COLOR_WHITE, "You bought a ticket to San Fierro. You will be teleported to a plane shortly.");
- HideMenuForPlayer(Tickets, playerid);
- GivePlayerMoney(playerid, -1000);
- }
- case 2: // Las Venturas
- {
- if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You don't have $1,000!");
- Destination[playerid] = 3;
- SendClientMessage(playerid, COLOR_WHITE, "You bought a ticket to Los Santos. You will be teleported to a plane shortly.");
- HideMenuForPlayer(Tickets, playerid);
- GivePlayerMoney(playerid, -1000);
- }
- case 3: // Exit Menu
- {
- HideMenuForPlayer(Tickets, playerid);
- }
- }
- }
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public FlightStart()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(Destination[i] != 0)
- {
- SendClientMessage(i, COLOR_WHITE, "30 seconds until landing.");
- GameTextForPlayer(i, "~y~[] ~b~Take Off!~y~[]", 4000, 3); //actually ] is a star
- SetPlayerPos(i, 2.384830, 33.103397, 1199.849976); //and [ is nothing
- SetPlayerInterior(i, 1);
- PlaySound(i, 1097);
- SetTimer("FlightEnd", 30000, 0);
- }
- }
- }
- }
- public FlightEnd()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- switch (Destination[i])
- {
- case 0:
- {
- // ~~!!~~Leave Space Blank~~!!~~
- }
- case 1:
- {
- SetPlayerVirtualWorld(i, 111);
- SetPlayerInterior(i, 14);
- SetPlayerPos(i, -1827.147338, 7.207418, 1061.143554);
- GameTextForPlayer(i, "~w~Welcome to ~y~Las venturas", 4000, 3);
- Destination[i] = 0;
- PlaySound(i, 1063);
- }
- case 2:
- {
- SetPlayerVirtualWorld(i, 222);
- SetPlayerInterior(i, 14);
- SetPlayerPos(i, -1827.147338, 7.207418, 1061.143554);
- GameTextForPlayer(i, "~w~Welcome to ~r~San Fierro", 4000, 3);
- Destination[i] = 0;
- PlaySound(i, 1063);
- }
- case 3:
- {
- SetPlayerVirtualWorld(i, 333);
- SetPlayerInterior(i, 14);
- SetPlayerPos(i, -1827.147338, 7.207418, 1061.143554);
- GameTextForPlayer(i, "~w~Welcome to ~g~Los Santos", 4000, 3);
- Destination[i] = 0;
- PlaySound(i, 1063);
- }
- }
- }
- }
- stock PlaySound ( playerid, sound )
- {
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- PlayerPlaySound(playerid, sound, X, Y, Z);
- return sound;
- }
Advertisement
Add Comment
Please, Sign In to add comment