Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_PINK 0xFF66FFAA
- #define COLOR_BLUE 0x0000BBAA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_DARKRED 0x660000AA
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_BRIGHTRED 0xFF0000AA
- #define COLOR_INDIGO 0x4B00B0AA
- #define COLOR_VIOLET 0x9955DEEE
- #define COLOR_LIGHTRED 0xFF99AADD
- #define COLOR_SEAGREEN 0x00EEADDF
- #define COLOR_GRAYWHITE 0xEEEEFFC4
- #define COLOR_LIGHTNEUTRALBLUE 0xabcdef66
- #define COLOR_GREENISHGOLD 0xCCFFDD56
- #define COLOR_LIGHTBLUEGREEN 0x0FFDD349
- #define COLOR_NEUTRALBLUE 0xABCDEF01
- #define COLOR_LIGHTCYAN 0xAAFFCC33
- #define COLOR_LEMON 0xDDDD2357
- #define COLOR_MEDIUMBLUE 0x63AFF00A
- #define COLOR_NEUTRAL 0xABCDEF97
- #define COLOR_BLACK 0x00000000
- #define COLOR_NEUTRALGREEN 0x81CFAB00
- #define COLOR_DARKGREEN 0x12900BBF
- #define COLOR_LIGHTGREEN 0x24FF0AB9
- #define COLOR_DARKBLUE 0x300FFAAB
- #define COLOR_BLUEGREEN 0x46BBAA00
- #define COLOR_PINK 0xFF66FFAA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_DARKRED 0x660000AA
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_PURPLE 0x800080AA
- #define COLOR_GRAD1 0xB4B5B7FF
- #define COLOR_GRAD2 0xBFC0C2FF
- #define COLOR_RED1 0xFF0000AA
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_BROWN 0x993300AA
- #define COLOR_CYAN 0x99FFFFAA
- #define COLOR_TAN 0xFFFFCCAA
- #define COLOR_PINK 0xFF66FFAA
- #define COLOR_KHAKI 0x999900AA
- #define COLOR_LIME 0x99FF00AA
- #define COLOR_SYSTEM 0xEFEFF7AA
- #define COLOR_GRAD2 0xBFC0C2FF
- #define COLOR_GRAD4 0xD8D8D8FF
- #define COLOR_GRAD6 0xF0F0F0FF
- #define COLOR_GRAD2 0xBFC0C2FF
- #define COLOR_GRAD3 0xCBCCCEFF
- #define COLOR_GRAD5 0xE3E3E3FF
- #define COLOR_GRAD1 0xB4B5B7FF
- new ship1;
- new ship2;
- new ship3;
- new ShipEnt;
- new SailCP;
- new ShipTaken;
- new SailBoat[MAX_PLAYERS];
- new bool:Sailing[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Freight Ship FS loaded!");
- print("--------------------------------------\n");
- ShipEnt = CreatePickup(1318, 2, 2694.5012, -2606.9812, 14.8974);
- SailCP = CreatePickup(1239, 2, 3324.2947, -1330.1631, 127.9517);
- ship1 = CreateObject(9585, 2750.436523, -2607.883057, 4.398273, 0.0000, 0.0000, 0.0000);
- ship2 = CreateObject(10793, 2675.130371, -2607.985107, 33.278923, 0.0000, 0.0000, 0.0000);
- ship3 = CreateObject(10795, 2748.083008, -2607.962891, 14.616102, 0.0000, 0.0000, 0.0000);
- CreateObject(4882, 2809.622559, -2577.623535, 17.564299, 0.0000, 0.8594, 90.2408);
- CreateObject(3877, 2801.469971, -2559.517578, 14.292531, 0.0000, 0.0000, 0.0000);
- CreateObject(3877, 2795.270508, -2559.551758, 14.297391, 0.0000, 0.0000, 0.0000);
- // Ship Int
- CreateObject(3997, 3248.558594, -1358.906982, 127.851723, 0.0000, 0.0000, 0.0000);
- CreateObject(1562, 3311.579102, -1331.105835, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3311.570313, -1331.914673, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3311.673584, -1329.189087, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3311.694092, -1328.249146, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3313.317139, -1328.182983, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3313.229248, -1329.292114, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3313.287842, -1330.989868, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3313.281250, -1331.916992, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3314.684814, -1331.980225, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3315.972900, -1332.173950, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3317.707764, -1332.107422, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3319.528320, -1332.057007, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3320.955566, -1332.073364, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3314.893555, -1331.030518, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3316.354004, -1331.088501, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3317.725342, -1331.182007, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3319.549316, -1331.180420, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3321.009033, -1331.177734, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3315.000488, -1329.306763, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3316.460449, -1329.296021, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3317.730469, -1329.383057, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3319.649414, -1329.490112, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3321.179443, -1329.449341, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3314.756104, -1328.300659, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3316.447998, -1328.375610, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3317.756592, -1328.448242, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3319.605225, -1328.488037, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(1562, 3321.148682, -1328.354614, 128.506912, 0.0000, 0.0000, 90.0000);
- CreateObject(2631, 3319.391602, -1330.531982, 127.898048, 0.0000, 0.0000, 0.0000);
- CreateObject(2631, 3315.556885, -1330.391602, 127.873047, 0.0000, 0.0000, 0.0000);
- CreateObject(2631, 3312.094971, -1329.989258, 127.848045, 0.0000, 0.0000, 0.0000);
- CreateObject(2631, 3319.375977, -1331.630249, 127.876808, 0.0000, 0.0000, 0.0000);
- CreateObject(2631, 3315.484863, -1331.641602, 127.848045, 0.0000, 0.0000, 0.0000);
- CreateObject(2631, 3311.672607, -1331.650757, 127.858490, 0.0000, 0.0000, 0.0000);
- CreateObject(2631, 3319.432861, -1328.840210, 127.846703, 0.0000, 0.0000, 0.0000);
- CreateObject(2631, 3316.373779, -1328.868164, 127.855942, 0.0000, 0.0000, 0.0000);
- CreateObject(2631, 3312.442383, -1328.773438, 127.898048, 0.0000, 0.0000, 0.0000);
- CreateObject(2631, 3310.727783, -1329.756836, 127.898041, 0.0000, 0.0000, 90.0000);
- CreateObject(2514, 3307.249756, -1331.757935, 127.850929, 0.0000, 0.0000, 90.0000);
- CreateObject(2514, 3307.219727, -1330.282349, 127.840523, 0.0000, 0.0000, 90.0000);
- CreateObject(2518, 3306.332031, -1328.416382, 127.911568, 0.0000, 0.0000, 0.0000);
- CreateObject(1499, 3309.604980, -1331.111328, 127.845848, 0.0000, 0.0000, 270.0000);
- CreateObject(1499, 3309.603760, -1329.634399, 127.845848, 0.0000, 0.0000, 270.0000);
- CreateObject(1499, 3309.616943, -1328.077515, 127.845833, 0.0000, 0.0000, 270.0000);
- CreateObject(974, 3306.298340, -1331.107056, 127.680077, 0.0000, 0.0000, 0.0000);
- CreateObject(974, 3306.252197, -1332.619263, 127.604645, 0.0000, 0.0000, 0.0000);
- CreateObject(974, 3306.324219, -1331.103638, 127.630074, 0.0000, 0.0000, 90.0000);
- CreateObject(974, 3306.354248, -1329.615112, 127.604515, 0.0000, 0.0000, 0.0000);
- CreateObject(974, 3306.371582, -1327.933716, 127.504456, 0.0000, 0.0000, 0.0000);
- CreateObject(2775, 3321.854736, -1330.234131, 130.103394, 0.0000, 0.0000, 90.0000);
- CreateObject(2796, 3309.695557, -1330.364380, 129.771423, 0.0000, 0.0000, 90.0000);
- CreateObject(16773, 3317.184326, -1332.757080, 128.380035, 0.0000, 0.0000, 0.0000);
- CreateObject(16773, 3316.280273, -1327.666504, 128.076050, 0.0000, 0.0000, 0.0000);
- CreateObject(4604, 3258.958740, -1328.039551, 131.771805, 0.0000, 178.7632, 0.0000);
- CreateObject(984, 3309.449707, -1331.099243, 130.948257, 0.0000, 0.0000, 0.0000);
- CreateObject(16775, 3322.157471, -1322.333252, 128.279404, 0.0000, 0.0000, 90.0000);
- CreateObject(16775, 3322.179443, -1338.077759, 127.911369, 0.0000, 0.0000, 90.0000);
- CreateObject(1523, 3322.179443, -1329.376831, 127.820892, 0.0000, 0.0000, 270.0000);
- CreateObject(16773, 3322.116699, -1330.544067, 134.250519, 0.0000, 0.0000, 270.0000);
- CreateObject(14391, 3327.332520, -1330.362549, 128.811813, 0.0000, 0.0000, 180.0000);
- CreateObject(1649, 3328.270996, -1327.388550, 129.599838, 0.0000, 0.0000, 270.0000);
- CreateObject(16773, 3321.364258, -1327.635742, 131.850937, 0.0000, 0.0000, 0.0000);
- CreateObject(16773, 3321.179199, -1332.698975, 129.410660, 0.0000, 0.0000, 180.0000);
- CreateObject(1649, 3328.295898, -1331.687378, 129.580109, 0.0000, 0.0000, 270.0000);
- CreateObject(1649, 3328.295898, -1327.359497, 132.159622, 0.0000, 0.0000, 270.0000);
- CreateObject(1649, 3328.295898, -1331.757568, 132.904816, 0.0000, 0.0000, 270.0000);
- CreateObject(16775, 3306.316406, -1333.807129, 128.851395, 0.0000, 0.0000, 270.0000);
- CreateObject(16775, 3302.526611, -1332.725464, 128.319290, 0.0000, 0.0000, 0.0000);
- CreateObject(16775, 3301.721924, -1327.546143, 128.054474, 0.0000, 0.0000, 179.1405);
- CreateObject(1663, 3325.533691, -1329.093018, 128.311935, 0.0000, 0.0000, 90.0000);
- CreateObject(1663, 3325.717773, -1330.729126, 128.311935, 0.0000, 0.0000, 90.0000);
- return 1;
- }
- public OnFilterScriptExit()
- {
- DestroyObject(ship1);
- DestroyObject(ship3);
- DestroyObject(ship2);
- return 1;
- }
- #else
- #endif
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext, "/sail", true) == 0)
- {
- if(Sailing[playerid] == true) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You are already Sailing!");
- if(ShipTaken == 1) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Someone else is already on the ship.");
- if(!PlayerToPoint(3, playerid, 3324.2947, -1330.1631, 127.9517)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be in the ship in order to sail it.");
- Sailing[playerid] = true;
- ShipTaken = 1;
- SailBoat[playerid] = CreateVehicle(454, 2613.5906, -2607.2773, 0.2058, 266.4303, 0, 0, 15000);
- LinkVehicleToInterior(SailBoat[playerid], 10);
- PutPlayerInVehicle(playerid, SailBoat[playerid], 0);
- AttachObjectToPlayer(ship1, playerid, 0.0, 150.0, -2.0, 180.0, 180.0, 270.0);
- AttachObjectToPlayer(ship2, playerid, 0.0, 75.0, 27.0, 180.0, 180.0, 270.0);
- AttachObjectToPlayer(ship3, playerid, 0.0, 148.0, 8.0, 180.0, 180.0, 270.0);
- return 1;
- }
- if(strcmp(cmdtext, "/exitship", true) == 0) return SetPlayerPos(playerid, 2694.5012, -2606.9812, 14.8974);
- if(strcmp(cmdtext, "/pier", true) == 0) return SetPlayerPos(playerid, 2789.7537, -2527.5212, 13.6306);
- return 0;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if (newstate == PLAYER_STATE_ONFOOT)
- {
- if(Sailing[playerid] == true) // Sailing
- {
- Sailing[playerid] = false;
- ShipTaken = 0;
- DestroyObject(ship1);
- DestroyObject(ship2);
- DestroyObject(ship3);
- DestroyVehicle(SailBoat[playerid]);
- ship1 = CreateObject(9585, 2750.436523, -2607.883057, 4.398273, 0.0000, 0.0000, 0.0000);
- ship2 = CreateObject(10793, 2675.130371, -2607.985107, 33.278923, 0.0000, 0.0000, 0.0000);
- ship3 = CreateObject(10795, 2748.083008, -2607.962891, 14.616102, 0.0000, 0.0000, 0.0000);
- SetPlayerPos(playerid, 2789.7537, -2527.5212, 13.6306);
- return 1;
- }
- }
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == SailCP)
- {
- SendClientMessage(playerid, COLOR_WHITE, "--------------------");
- SendClientMessage(playerid, COLOR_YELLOW, "To start sailing type /sail");
- SendClientMessage(playerid, COLOR_YELLOW, "To stop sailing press ENTER or F");
- SendClientMessage(playerid, COLOR_YELLOW, "Type /exitship to leave the ship");
- SendClientMessage(playerid, COLOR_WHITE, "--------------------");
- }
- else if(pickupid == ShipEnt)
- {
- SetPlayerPos(playerid, 3324.2810, -1330.3419, 130.5517);
- }
- return 1;
- }
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment