Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Script by: Bullet
- Map by: Bullet
- Mission Base: Bombing
- Mission Type: Checkpoint bombing
- Mission Type ID: 1
- */
- //==============================================================================
- // Includes
- //==============================================================================
- #include <a_samp>
- #include <crashdetect>
- #include <float>
- #include "..\filterscripts\MM\stuff\defines"
- #include "..\filterscripts\MM\stuff\serverkeymsg"
- //==============================================================================
- // Defines
- //==============================================================================
- #define MISSION_NAME "Morning Moon"
- #define Health 99.0
- #define OBJ_NAME "Drug Ship"
- #define CP_POS 1807.3480,-4986.7026,6.6110
- #define CP_SIZE 3.0
- #define VEHICLE_HEALTH 999.0
- #define CLASS_POSTION 3734.8755,-2448.6968,17.5937
- #define CLASS_CAMERA 3734.9092,-2446.4177,16.7819
- #define CLASS_FACING_AGNLE 358.6529
- #define TEAM_DEFEND_NAME "Da Nang Boy"
- #define TEAM_ATTACK_NAME "Detective"
- #define MAX_MAP_OBJECTS 117
- #define PLACING_TIME 7
- #define SPAWN_PROTECTION true
- //==============================================================================
- // Per mission functions
- //==============================================================================
- enum skindata
- {
- TeamID,
- SkinID,
- Float:SpawnX,
- Float:SpawnY,
- Float:SpawnZ,
- Float:SpawnAngle,
- SpawnInterior,
- VirtualWorld,
- Weapon1,
- Ammo1,
- Weapon2,
- Ammo2,
- Weapon3,
- Ammo3,
- };
- new const SkinData[][skindata] = {
- {TEAM_ATTACK,165,1977.8362,-2321.5566,13.5469,178.9659,0,0,WEAPON_SILENCED,100,WEAPON_SHOTGSPA,100,WEAPON_M4,120},
- {TEAM_DEFEND,122, 1775.9105,-4119.2178,12.5696,270.8882,0,0,WEAPON_COLT45,280,WEAPON_AK47,160,WEAPON_BAT,120},
- {TEAM_ATTACK,165,1977.8362,-2321.5566,13.5469,178.9659,0,0,WEAPON_DEAGLE,100,WEAPON_SHOTGUN,100,WEAPON_MP5,120},
- {TEAM_DEFEND,123, 1775.9105,-4119.2178,12.5696,270.8882,0,0,WEAPON_SHOTGUN,280,WEAPON_MP5,160,WEAPON_CHAINSAW,1}
- };
- new const Float:ExplosionsInfo[][3] = {
- {1850.4011,-4121.1997,5.9978},
- {1835.4907,-4125.2900,5.9978},
- {1841.0261,-4114.0918,5.9978},
- {1824.5320,-4114.0830,5.9978},
- {1817.8973,-4120.7837,5.9978},
- {1813.0046,-4128.0088,5.9978}
- };
- #if MAX_MAP_OBJECTS != 0
- new Object[MAX_MAP_OBJECTS];
- CreateMap()
- {
- Object[0] = CreateObject(10230,1822.6368400,-4118.6630900,11.2804900,0.0000000,0.0000200,0.0000000); //
- Object[1] = CreateObject(10140,1837.2597700,-4119.6962900,11.2556000,0.0000000,0.0000200,0.0000000); //
- Object[2] = CreateObject(10227,1867.4239500,-4118.9018600,16.0262000,0.0000000,0.0000200,0.0000000); //
- Object[3] = CreateObject(10226,1866.9346900,-4117.8920900,9.6922000,0.0000000,0.0000200,0.0000000); //
- Object[4] = CreateObject(10231,1821.7042200,-4120.1377000,12.6305000,0.0000000,0.0000200,0.0000000); //
- Object[5] = CreateObject(4844,1735.5454100,-4079.2934600,-6.0641000,0.0000000,-0.0000200,179.9998600); //
- Object[6] = CreateObject(4844,1727.2457300,-4055.1899400,-6.0641000,0.0000000,-0.0000200,179.9998600); //
- Object[7] = CreateObject(10229,1822.3790300,-4120.1215800,9.9056000,0.0000000,0.0000200,0.0000000); //
- Object[8] = CreateObject(4844,1733.4527600,-4105.1586900,-5.9308300,0.0000000,-0.0000200,179.9998600); //
- Object[9] = CreateObject(17026,1830.1739500,-4158.2280300,3.2714200,0.0000200,0.0000100,48.4800000); //
- Object[10] = CreateObject(17026,1867.1903100,-4158.9340800,3.2706700,0.0000200,0.0000100,48.4800000); //
- Object[11] = CreateObject(17026,1905.5865500,-4156.7109400,3.2706700,0.0000200,0.0000100,48.4800000); //
- Object[12] = CreateObject(17026,1920.5036600,-4139.0185500,3.2706700,0.0000200,0.0000000,99.8999200); //
- Object[13] = CreateObject(17026,1925.6842000,-4114.0996100,3.2706700,0.0000100,-0.0000200,147.5399800); //
- Object[14] = CreateObject(17026,1801.1843300,-4159.6225600,3.2706700,0.0000200,0.0000100,48.4800000); //
- Object[15] = CreateObject(17026,1773.2297400,-4155.7705100,3.2706700,0.0000200,0.0000100,48.4800000); //
- Object[16] = CreateObject(971,1761.5500500,-4155.9907200,22.0112400,0.0000000,0.0000200,0.0000000); //
- Object[17] = CreateObject(971,1761.5500500,-4155.9907200,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[18] = CreateObject(971,1770.3439900,-4156.0151400,22.0112400,0.0000000,0.0000200,0.0000000); //
- Object[19] = CreateObject(971,1767.3122600,-4155.9599600,14.8597000,0.0000000,0.0000200,0.0000000); //
- Object[20] = CreateObject(971,1770.2888200,-4156.0459000,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[21] = CreateObject(971,1779.0484600,-4155.9751000,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[22] = CreateObject(971,1779.0484600,-4155.9751000,21.8333700,0.0000000,0.0000200,0.0000000); //
- Object[23] = CreateObject(971,1787.7458500,-4156.0268600,21.9248700,0.0000000,0.0000200,0.0000000); //
- Object[24] = CreateObject(971,1787.8023700,-4155.9834000,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[25] = CreateObject(971,1796.5284400,-4155.9550800,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[26] = CreateObject(971,1796.5284400,-4155.9550800,21.9014000,0.0000000,0.0000200,0.0000000); //
- Object[27] = CreateObject(971,1805.2866200,-4155.9960900,21.9014000,0.0000000,0.0000200,0.0000000); //
- Object[28] = CreateObject(971,1805.3292200,-4155.9824200,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[29] = CreateObject(971,1814.0113500,-4156.0302700,21.9014000,0.0000000,0.0000200,0.0000000); //
- Object[30] = CreateObject(971,1814.0731200,-4156.0195300,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[31] = CreateObject(971,1822.7318100,-4156.0615200,21.9014000,0.0000000,0.0000200,0.0000000); //
- Object[32] = CreateObject(971,1822.7347400,-4156.0434600,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[33] = CreateObject(971,1831.4506800,-4156.0449200,21.9014000,0.0000000,0.0000200,0.0000000); //
- Object[34] = CreateObject(971,1831.4816900,-4156.0600600,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[35] = CreateObject(971,1840.2039800,-4156.0493200,21.9014000,0.0000000,0.0000200,0.0000000); //
- Object[36] = CreateObject(971,1840.2729500,-4156.0835000,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[37] = CreateObject(971,1848.9919400,-4156.0839800,21.9014000,0.0000000,0.0000200,0.0000000); //
- Object[38] = CreateObject(971,1849.1051000,-4156.1049800,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[39] = CreateObject(971,1857.7915000,-4156.0659200,21.8774800,0.0000000,0.0000200,0.0000000); //
- Object[40] = CreateObject(971,1857.8710900,-4156.1113300,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[41] = CreateObject(971,1857.7915000,-4156.0659200,14.7372000,0.0000000,0.0000200,0.0000000); //
- Object[42] = CreateObject(971,1866.5676300,-4156.0600600,21.8774800,0.0000000,0.0000200,0.0000000); //
- Object[43] = CreateObject(971,1866.5658000,-4156.0859400,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[44] = CreateObject(971,1875.2989500,-4156.0883800,21.8774800,0.0000000,0.0000200,0.0000000); //
- Object[45] = CreateObject(971,1875.2823500,-4156.0610400,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[46] = CreateObject(971,1884.0333300,-4156.1386700,21.8774800,0.0000000,0.0000200,0.0000000); //
- Object[47] = CreateObject(971,1884.0245400,-4156.1416000,28.9964000,0.0000000,0.0000200,0.0000000); //
- Object[48] = CreateObject(17026,1742.3210400,-4140.3208000,3.2706700,0.0000000,0.0000200,15.0600000); //
- Object[49] = CreateObject(17026,1729.1583300,-4118.2500000,3.2706700,-0.0000100,0.0000200,-23.8799900); //
- Object[50] = CreateObject(971,1754.0012200,-4152.9531300,22.0112400,-0.0000100,0.0000200,-39.6000000); //
- Object[51] = CreateObject(971,1747.3022500,-4147.3007800,22.0112400,-0.0000100,0.0000200,-39.6000000); //
- Object[52] = CreateObject(971,1754.0012200,-4152.9531300,29.1171200,-0.0000100,0.0000200,-39.6000000); //
- Object[53] = CreateObject(971,1747.3022500,-4147.3007800,29.1171200,-0.0000100,0.0000200,-39.6000000); //
- Object[54] = CreateObject(971,1740.4882800,-4141.7231400,22.0112400,-0.0000100,0.0000200,-39.6000000); //
- Object[55] = CreateObject(971,1740.5061000,-4141.7172900,29.1171200,-0.0000100,0.0000200,-39.6000000); //
- Object[56] = CreateObject(971,1736.8774400,-4134.4536100,22.0112400,-0.0000200,0.0000000,-85.6199300); //
- Object[57] = CreateObject(971,1736.8774400,-4134.4536100,29.1158100,-0.0000200,0.0000000,-85.6199300); //
- Object[58] = CreateObject(971,1736.1894500,-4125.6240200,22.0112400,-0.0000200,0.0000000,-85.6199300); //
- Object[59] = CreateObject(971,1736.1777300,-4125.6572300,29.1158100,-0.0000200,0.0000000,-85.6199300); //
- Object[60] = CreateObject(971,1736.1894500,-4125.6240200,14.9027500,-0.0000200,0.0000000,-85.6199300); //
- Object[61] = CreateObject(971,1735.1104700,-4117.1181600,22.0112400,-0.0000200,0.0000000,-85.6199300); //
- Object[62] = CreateObject(971,1735.0953400,-4117.0922900,29.1158100,-0.0000200,0.0000000,-85.6199300); //
- Object[63] = CreateObject(971,1734.4399400,-4108.3237300,29.1158100,-0.0000200,0.0000000,-85.6199300); //
- Object[64] = CreateObject(971,1734.4399400,-4108.3237300,22.0432400,-0.0000200,0.0000000,-85.6199300); //
- Object[65] = CreateObject(971,1734.4399400,-4108.3237300,14.9820600,-0.0000200,0.0000000,-85.6199300); //
- Object[66] = CreateObject(971,1735.1866500,-4117.0190400,14.9820600,-0.0000200,0.0000000,-85.6199300); //
- Object[67] = CreateObject(17026,1728.1269500,-4091.4331100,3.2706700,-0.0000100,0.0000200,-23.8799900); //
- Object[68] = CreateObject(971,1733.6923800,-4099.5742200,22.0432400,-0.0000200,0.0000000,-85.6199300); //
- Object[69] = CreateObject(971,1733.6923800,-4099.5742200,14.9232600,-0.0000200,0.0000000,-85.6199300); //
- Object[70] = CreateObject(971,1733.7102100,-4099.5625000,29.1158100,-0.0000200,0.0000000,-85.6199300); //
- Object[71] = CreateObject(971,1733.0371100,-4090.7973600,22.0432400,-0.0000200,0.0000000,-85.6199300); //
- Object[72] = CreateObject(971,1733.0354000,-4090.8398400,29.1158100,-0.0000200,0.0000000,-85.6199300); //
- Object[73] = CreateObject(971,1892.2763700,-4154.1152300,28.9964000,0.0000100,0.0000200,27.8399900); //
- Object[74] = CreateObject(971,1892.3581500,-4154.1743200,21.8774800,0.0000100,0.0000200,28.5599700); //
- Object[75] = CreateObject(971,1897.0782500,-4151.6328100,14.7974200,0.0000100,0.0000200,28.5599700); //
- Object[76] = CreateObject(971,1904.7579300,-4147.4716800,14.7974200,0.0000100,0.0000200,28.5599700); //
- Object[77] = CreateObject(971,1900.0942400,-4150.0092800,21.8774800,0.0000100,0.0000200,28.5599700); //
- Object[78] = CreateObject(971,1907.7996800,-4145.8408200,21.8774800,0.0000100,0.0000200,28.5599700); //
- Object[79] = CreateObject(971,1899.9751000,-4150.0595700,28.9964000,0.0000100,0.0000200,27.8399900); //
- Object[80] = CreateObject(971,1907.6899400,-4145.8691400,28.9964000,0.0000100,0.0000200,27.8399900); //
- Object[81] = CreateObject(971,1911.6561300,-4142.2563500,14.7974200,0.0000200,0.0000100,46.6800000); //
- Object[82] = CreateObject(971,1911.6213400,-4142.4277300,21.8774800,0.0000200,0.0000100,46.6199600); //
- Object[83] = CreateObject(971,1911.6320800,-4142.3989300,28.9964000,0.0000200,0.0000100,46.4999800); //
- Object[84] = CreateObject(971,1917.6436800,-4136.0151400,28.9964000,0.0000200,0.0000100,46.4999800); //
- Object[85] = CreateObject(971,1917.6344000,-4135.9975600,21.9049800,0.0000200,0.0000100,46.4999800); //
- Object[86] = CreateObject(971,1923.6732200,-4129.6577100,21.8909200,0.0000200,0.0000100,46.4999800); //
- Object[87] = CreateObject(971,1923.6995800,-4129.6313500,28.9964000,0.0000200,0.0000100,46.4999800); //
- Object[88] = CreateObject(971,1929.7309600,-4123.3183600,21.8909200,0.0000200,0.0000100,46.4999800); //
- Object[89] = CreateObject(971,1929.7177700,-4123.3413100,28.9964000,0.0000200,0.0000100,46.4999800); //
- Object[90] = CreateObject(971,1928.9777800,-4119.5966800,21.8909200,0.0000200,0.0000000,103.0199300); //
- Object[91] = CreateObject(971,1928.9777800,-4119.5966800,28.9816100,0.0000200,0.0000000,103.0199300); //
- Object[92] = CreateObject(971,1927.0223400,-4111.1337900,21.8646200,0.0000200,0.0000000,103.0199300); //
- Object[93] = CreateObject(971,1927.0223400,-4111.1337900,28.9416400,0.0000200,0.0000000,103.0199300); //
- Object[94] = CreateObject(971,1925.1020500,-4102.5942400,21.8646200,0.0000200,0.0000000,103.0199300); //
- Object[95] = CreateObject(971,1925.0845900,-4102.5957000,28.9416400,0.0000200,0.0000000,103.0199300); //
- Object[96] = CreateObject(971,1923.1137700,-4094.0776400,21.8646200,0.0000200,0.0000000,103.0199300); //
- Object[97] = CreateObject(971,1923.0925300,-4094.0415000,28.9416400,0.0000200,0.0000000,103.0199300); //
- Object[98] = CreateObject(17026,1926.4926800,-4083.1157200,3.2706700,0.0000100,-0.0000200,147.5399800); //
- Object[99] = CreateObject(971,1921.1451400,-4085.5200200,21.8646200,0.0000200,0.0000000,103.0199300); //
- Object[100] = CreateObject(971,1921.1451400,-4085.5200200,28.9844500,0.0000200,0.0000000,103.0199300); //
- Object[101] = CreateObject(971,1919.1778600,-4076.9619100,21.8646200,0.0000200,0.0000000,103.0199300); //
- Object[102] = CreateObject(971,1919.1778600,-4076.9619100,28.9631800,0.0000200,0.0000000,103.0199300); //
- Object[103] = CreateObject(971,1919.1778600,-4076.9619100,14.7393800,0.0000200,0.0000000,103.0199300); //
- Object[104] = CreateObject(971,1917.1400100,-4068.3466800,14.7393800,0.0000200,0.0000000,103.0199300); //
- Object[105] = CreateObject(971,1917.1385500,-4068.3266600,21.8202100,0.0000200,0.0000000,103.0199300); //
- Object[106] = CreateObject(971,1917.1385500,-4068.3266600,28.9608700,0.0000200,0.0000000,103.0199300); //
- Object[107] = CreateObject(17026,1744.7255900,-4137.1787100,3.2706700,0.0000000,0.0000200,15.0600000); //
- Object[108] = CreateObject(17026,1748.5588400,-4100.3823200,3.2706700,0.0000100,-0.0000200,147.5399800); //
- Object[109] = CreateObject(3864,1765.2844200,-4100.0634800,10.7350100,0.0000000,0.0000200,0.0000000); //
- Object[110] = CreateObject(971,1732.4278600,-4082.0239300,22.0432400,-0.0000200,0.0000000,-85.6199300); //
- Object[111] = CreateObject(971,1732.4278600,-4082.0239300,15.0455000,-0.0000200,0.0000000,-85.6199300); //
- Object[112] = CreateObject(971,1732.4552000,-4082.0786100,29.1158100,-0.0000200,0.0000000,-85.6199300); //
- Object[113] = CreateObject(5006,1840.7668500,-2267.9177200,-0.1110700,356.8584000,20.0000000,84.6816000); //
- Object[114] = CreateObject(5006,1836.7730700,-2304.4174800,4.6801300,356.8584000,20.0000000,-87.7583800); //
- Object[115] = CreateObject(4844,1736.4711900,-4084.2929700,-5.9257400,0.0000000,-0.0000200,179.9998600); //
- Object[116] = CreateObject(4844,1735.4587400,-4068.2731900,-6.0544300,0.0000000,-0.0000200,179.9998600); //
- AddStaticVehicleEx(476,1949.4368000,-2457.6289000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1915.5701000,-2457.0522000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1915.5084000,-2438.8694000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1949.1677000,-2439.6377000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1915.3103000,-2422.0898000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1949.3010000,-2422.4353000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1915.4602000,-2403.0129000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1949.3527000,-2402.5029000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1915.2415000,-2384.9609000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1949.9720000,-2384.3511000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1948.7296000,-2364.6409000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1914.1863000,-2362.9084000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1914.2129000,-2343.4299000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1948.7542000,-2344.1282000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1949.5358000,-2320.9905000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(476,1914.7389000,-2320.9790000,14.5977000,-179.8200000,-1,-1,15); //Rustler
- AddStaticVehicleEx(447,1874.2543000,-2328.6741000,24.6659000,-186.4200000,-1,-1,15); //Seasparrow
- AddStaticVehicleEx(447,1874.9183000,-2245.8132000,24.6659000,-186.4200000,-1,-1,15); //Seasparrow
- AddStaticVehicleEx(407,1846.3180000,-4133.6885000,6.1183000,-90.0000000,-1,-1,15); //Firetruck
- }
- #endif
- //==============================================================================
- // Basic vars
- //==============================================================================
- new bool:MissionStarted;
- new bool:ObjectiveStarted;
- new bool:MissionCancelled;
- new bool:ObjectivePlaced;
- native IsValidVehicle(vehicleid);
- enum obj
- {
- ObjectiveName[30],
- BeingPlaced,
- ObjectiveTimer,
- ProgressTimer,
- ProgressCount,
- Count
- };
- enum teamdata
- {
- Name[32],
- Members,
- Kills
- };
- enum playerdata
- {
- UserName[MAX_PLAYER_NAME],
- bool:TeamChosen,
- TeamSelection,
- PlayerClassID
- };
- new Team[2][teamdata];
- new PlayerMissionInfo[MAX_PLAYERS][playerdata];
- new ObjectiveInfo[obj];
- new MaxExplosions;
- new FlashTimer;
- //==============================================================================
- // Basic script
- //==============================================================================
- main()
- {
- print("----------------------------------");
- print(" Mission: "MISSION_NAME" started.");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- MissionStarted= true;
- format(Team[TEAM_DEFEND][Name],32,"%s",TEAM_DEFEND_NAME);
- format(Team[TEAM_ATTACK][Name],32,"%s",TEAM_ATTACK_NAME);
- format(ObjectiveInfo[ObjectiveName],sizeof(ObjectiveInfo[ObjectiveName]),"%s",OBJ_NAME);
- CallRemoteFunction("CreateBombingTD","d",PLACING_TIME*10);
- MaxExplosions= sizeof(ExplosionsInfo);
- ObjectivePlaced= false;
- ObjectiveInfo[BeingPlaced]=-1;
- #if MAX_MAP_OBJECTS != 0
- CreateMap();
- #endif
- for(new i=0; i<sizeof(SkinData); i++)
- {
- AddPlayerClassEx(SkinData[i][TeamID],SkinData[i][SkinID],SkinData[i][SpawnX],SkinData[i][SpawnY],SkinData[i][SpawnZ],SkinData[i][SpawnAngle],0,0,0,0,0,0);
- }
- for(new i=0; i<MAX_PLAYERS; i++) PlayerMissionInfo[i][TeamSelection]= NO_TEAM;
- for(new i=0; i<MAX_VEHICLES; i++) if(IsValidVehicle(i)) SetVehicleHealth(i,VEHICLE_HEALTH);
- if(CallRemoteFunction("GetCurrentMissionCJWalk","")) UsePlayerPedAnims();
- SetTimer("StartMissionFunc",3000,false);
- return 1;
- }
- FUNCTION StartMissionFunc()
- {
- CallRemoteFunction("StartMission","");
- ObjectiveStarted= true;
- return 1;
- }
- public OnGameModeExit()
- {
- #if MAX_MAP_OBJECTS != 0
- for(new i=0;i<MAX_MAP_OBJECTS;i++) DestroyObject(Object[i]);
- #endif
- for(new i=0; i<MAX_VEHICLES; i++)
- {
- DestroyVehicle(i);
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- if(PlayerMissionInfo[playerid][TeamChosen])
- {
- Team[PlayerMissionInfo[playerid][TeamSelection]][Members] --;
- PlayerMissionInfo[playerid][TeamChosen]=false;
- }
- return 1;
- }
- public OnPlayerRequestClass(playerid,classid)
- {
- SetPlayerPos(playerid,CLASS_POSTION);
- SetPlayerCameraPos(playerid,CLASS_CAMERA);
- SetPlayerCameraLookAt(playerid,CLASS_POSTION);
- SetPlayerFacingAngle(playerid,CLASS_FACING_AGNLE);
- CallRemoteFunction("ShowClassSelection","iisiii",playerid, SkinData[classid][TeamID],Team[SkinData[classid][TeamID]][Name], SkinData[classid][Weapon1], SkinData[classid][Weapon2], SkinData[classid][Weapon3]);
- if(PlayerMissionInfo[playerid][TeamChosen])
- {
- PlayerMissionInfo[playerid][TeamChosen] = false;
- Team[PlayerMissionInfo[playerid][TeamSelection]][Members]--;
- }
- PlayerMissionInfo[playerid][TeamSelection] = SkinData[classid][TeamID];
- PlayerMissionInfo[playerid][PlayerClassID]=classid;
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- new opp_team = (PlayerMissionInfo[playerid][TeamSelection] == 1)? 0:1;
- if(Team[PlayerMissionInfo[playerid][TeamSelection]][Members] > Team[opp_team][Members])
- {
- CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1, "This Team is full, choose another!",0);
- return 0;
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- new string[124];
- CallRemoteFunction("UpdateAliveState","ii",playerid,1);
- if(CallRemoteFunction("GetSpectateStatus","d",playerid)) return CallRemoteFunction("SpecOffAdmin","d",playerid);
- if(CallRemoteFunction("GetJailedStatus","d",playerid)) CallRemoteFunction("SetJailed","d",playerid);
- else
- {
- SetPlayerPos(playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][SpawnX],SkinData[PlayerMissionInfo[playerid][PlayerClassID]][SpawnY],SkinData[PlayerMissionInfo[playerid][PlayerClassID]][SpawnZ]);
- SetPlayerInterior(playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][SpawnInterior]);
- SetPlayerFacingAngle(playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][SpawnAngle]);
- SetPlayerVirtualWorld(playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][VirtualWorld]);
- if(!PlayerMissionInfo[playerid][TeamChosen])
- {
- Team[PlayerMissionInfo[playerid][TeamSelection]][Members]++;
- PlayerMissionInfo[playerid][TeamChosen] = true;
- if(PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK)
- {
- format(string,sizeof(string),"You are a %s, your mission is to destroy the %s.",Team[TEAM_ATTACK][Name],ObjectiveInfo[ObjectiveName]);
- CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1,string,2000);
- format(string,sizeof(string),"%s will try to stop you, eliminate them!.",Team[TEAM_DEFEND][Name]);
- CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1, string,4000);
- format(string,sizeof(string),"Destroy the ~y~%s~w~!",ObjectiveInfo[ObjectiveName]);
- CallRemoteFunction("ShowInfoText", "iisi", playerid, -1, string,1000);
- }
- else
- {
- format(string,sizeof(string),"You are a %s, your mission is to protect the %s from %s.",Team[TEAM_DEFEND][Name],ObjectiveInfo[ObjectiveName],Team[TEAM_ATTACK][Name]);
- CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1,string,2000);
- format(string,sizeof(string),"Protect the ~y~%s~w~!.",ObjectiveInfo[ObjectiveName]);
- CallRemoteFunction("ShowInfoText", "iisi", playerid, -1, string,1000);
- }
- }
- CallRemoteFunction("GivePlayerWeaponEx","ddd",playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][Weapon1],SkinData[PlayerMissionInfo[playerid][PlayerClassID]][Ammo1]);
- CallRemoteFunction("GivePlayerWeaponEx","ddd",playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][Weapon2],SkinData[PlayerMissionInfo[playerid][PlayerClassID]][Ammo2]);
- CallRemoteFunction("GivePlayerWeaponEx","ddd",playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][Weapon3],SkinData[PlayerMissionInfo[playerid][PlayerClassID]][Ammo3]);
- }
- SetPlayerTeam(playerid,PlayerMissionInfo[playerid][TeamSelection]);
- if(PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK) SetPlayerColor(playerid,COLOR_TEAM_ATTACK);
- else SetPlayerColor(playerid,COLOR_TEAM_DEFEND);
- SetPlayerHealth(playerid,Health);
- #if SPAWN_PROTECTION == true
- CallRemoteFunction("SetSpawnProtection","df",playerid,Health);
- #endif
- CallRemoteFunction("OnPlayerBombingData", "ii", playerid, 1);
- SetPlayerCheckpoint(playerid,CP_POS,CP_SIZE);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new string[128];
- if(killerid != INVALID_PLAYER_ID)
- {
- SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
- Team[PlayerMissionInfo[killerid][TeamSelection]][Kills]++;
- }
- if(PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK)
- {
- if(!ObjectivePlaced && ObjectiveInfo[BeingPlaced] == playerid)
- {
- ObjectiveInfo[BeingPlaced]=-1;
- format(string,sizeof(string),"~y~%s ~w~has died while ~r~~h~planting~w~ the bomb.",PlayerMissionInfo[playerid][UserName]);
- CallRemoteFunction("ShowInfoText", "iisi", -1, playerid, string, 0);
- ObjectiveInfo[Count]=0;
- KillTimer(ObjectiveInfo[ObjectiveTimer]);
- ObjectiveInfo[ProgressCount]=0;
- KillTimer(ObjectiveInfo[ProgressTimer]);
- CallRemoteFunction("UpdateBombProgressBar", "d", 0);
- }
- }
- CallRemoteFunction("UpdateAliveState","ii",playerid,0);
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(!MissionStarted || ObjectivePlaced) return 1;
- new string[128];
- if(PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK && !ObjectivePlaced)
- {
- if(ObjectiveInfo[BeingPlaced] != -1)
- {
- format(string,sizeof(string),"%s is already trying to place the bomb. Please wait!",PlayerMissionInfo[ObjectiveInfo[BeingPlaced]][UserName]);
- CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1, string, 0);
- }
- else
- {
- ObjectiveInfo[BeingPlaced]=playerid;
- format(string,sizeof(string),"~y~%s~w~ is placing the bomb..!!",PlayerMissionInfo[playerid][UserName],playerid);
- CallRemoteFunction("ShowInfoText", "iisi", -1, playerid, string, 0);
- format(string,sizeof(string),"Wait in the checkpoint for %d seconds to place the bomb.",PLACING_TIME);
- CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1, string, 0);
- ObjectiveInfo[Count]=0;
- ObjectiveInfo[ProgressCount]=0;
- CallRemoteFunction("UpdateBombProgressBar", "d", 0);
- ObjectiveInfo[ObjectiveTimer] = SetTimer("PlacingTimer",1000,true);
- ObjectiveInfo[ProgressTimer] = SetTimer("ProgressFillUP",100,true);
- }
- }
- else
- {
- if(ObjectiveInfo[BeingPlaced] != -1)
- {
- CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1, "This is bomb placing sight, protect it.", 0);
- }
- else
- {
- format(string,sizeof(string),"%s is trying to place the bomb. Stop them!",PlayerMissionInfo[ObjectiveInfo[BeingPlaced]][UserName]);
- CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1, string, 0);
- }
- }
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- if(!MissionStarted || ObjectivePlaced) return 1;
- new string[128];
- if(PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK && !ObjectivePlaced && ObjectiveInfo[BeingPlaced] == playerid)
- {
- ObjectiveInfo[BeingPlaced]=-1;
- format(string,sizeof(string),"~y~%s~w~ has left ~r~~h~planting~w~ the bomb.",PlayerMissionInfo[playerid][UserName],playerid);
- CallRemoteFunction("ShowInfoText", "iisi", -1, playerid, string, 0);
- ObjectiveInfo[Count]=0;
- KillTimer(ObjectiveInfo[ObjectiveTimer]);
- ObjectiveInfo[ProgressCount]=0;
- KillTimer(ObjectiveInfo[ProgressTimer]);
- CallRemoteFunction("UpdateBombProgressBar", "d", 0);
- }
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- SetVehicleHealth(vehicleid,VEHICLE_HEALTH);
- return 1;
- }
- FUNCTION EndTheMission()
- {
- if(!MissionStarted) return 1;
- MissionStarted= false;
- if(!MissionCancelled)
- {
- new string[256];
- new amount= 10000;
- if(!ObjectivePlaced)
- {
- amount+=Team[TEAM_DEFEND][Kills]*100;
- format(string,sizeof(string),""SERVER_KEY_MSG" %s has won the mission, by successfully defending the %s. Reward: $%d",Team[TEAM_DEFEND][Name],ObjectiveInfo[ObjectiveName],amount);
- SendClientMessageToAll(COLOR_SERVER,string);
- CallRemoteFunction("IRC_SendMessage","ss",string,IRC_SERVER_COLOR);
- format(string,sizeof(string),""SERVER_KEY_MSG" You have received $%i because your team has won the mission!",amount);
- for(new i=0,j=GetPlayerPoolSize(); i <= j; i++)
- {
- if(!PlayerMissionInfo[i][TeamChosen]) continue;
- if(PlayerMissionInfo[i][TeamSelection] == TEAM_DEFEND)
- {
- PlayerPlaySound(i,3200,0,0,0);
- SendClientMessage(i,COLOR_TEAM_DEFEND,string);
- CallRemoteFunction("GivePlayerCash","ii",i,amount);
- CallRemoteFunction("PlayerMissionStats","dd",i,0);
- }
- if(PlayerMissionInfo[i][TeamSelection] != TEAM_DEFEND)
- {
- PlayerPlaySound(i,17004,0,0,0);
- GameTextForPlayer(i,"~R~MISSION FAILED~w~!",3000,3);
- CallRemoteFunction("PlayerMissionStats","dd",i,1);
- }
- }
- }
- else
- {
- amount+=Team[TEAM_ATTACK][Kills]*100;
- format(string,sizeof(string),""SERVER_KEY_MSG" %s (%d) placed the bomb to destroy %s's %s. %s's has won the mission. Reward: 1 Token.",PlayerMissionInfo[ObjectiveInfo[BeingPlaced]][UserName],ObjectiveInfo[BeingPlaced],Team[TEAM_DEFEND][Name],ObjectiveInfo[ObjectiveName]);
- SendClientMessageToAll(COLOR_SERVER,string);
- format(string,sizeof(string),""SERVER_KEY_MSG" %s have won the mission. Reward: $%d.",Team[TEAM_ATTACK][Name],amount);
- SendClientMessageToAll(COLOR_SERVER,string);
- CallRemoteFunction("IRC_SendMessage","ss",string,IRC_SERVER_COLOR);
- CallRemoteFunction("PlayerMissionStats","dd",ObjectiveInfo[BeingPlaced],8);
- CallRemoteFunction("GivePlayerToken","dd",ObjectiveInfo[BeingPlaced],1);
- format(string,sizeof(string),""SERVER_KEY_MSG" You have received $%i because your team has won the Team-Deathmatch!",amount);
- for(new i=0,j=GetPlayerPoolSize(); i <= j; i++)
- {
- if(!PlayerMissionInfo[i][TeamChosen]) continue;
- if(PlayerMissionInfo[i][TeamSelection] == TEAM_ATTACK)
- {
- PlayerPlaySound(i,3200,0,0,0);
- SendClientMessage(i,COLOR_TEAM_ATTACK,string);
- CallRemoteFunction("GivePlayerCash","ii",i,amount);
- CallRemoteFunction("PlayerMissionStats","dd",i,0);
- }
- if(PlayerMissionInfo[i][TeamSelection] != TEAM_ATTACK)
- {
- PlayerPlaySound(i,17004,0,0,0);
- GameTextForPlayer(i,"~R~MISSION FAILED~w~!",3000,3);
- CallRemoteFunction("PlayerMissionStats","dd",i,1);
- }
- }
- }
- }
- else
- {
- PlaySoundForAll(1058);
- SendClientMessageToAll(COLOR_SERVER,""SERVER_KEY_MSG" The mission has been cancelled.");
- CallRemoteFunction("IRC_SendMessage","ss",""SERVER_KEY_MSG" The mission has been cancelled.",IRC_SERVER_COLOR);
- CallRemoteFunction("ShowInfoBox", "iisi", -1, -1,"The mission has been cancelled.",0);
- GameTextForAll("~R~MISSION CANCELLED~w~!",3000,3);
- }
- return 1;
- }
- //==============================================================================
- // Mission functions
- //==============================================================================
- FUNCTION ProgressFillUP()
- {
- ObjectiveInfo[ProgressCount]++;
- CallRemoteFunction("UpdateBombProgressBar", "d", ObjectiveInfo[ProgressCount]);
- }
- FUNCTION PlacingTimer()
- {
- if(!MissionStarted || ObjectivePlaced) return 1;
- if(ObjectiveInfo[BeingPlaced] == -1)
- {
- ObjectiveInfo[Count]=0;
- ObjectiveInfo[ProgressCount]=0;
- KillTimer(ObjectiveInfo[ObjectiveTimer]);
- KillTimer(ObjectiveInfo[ProgressTimer]);
- }
- ObjectiveInfo[Count]++;
- if(ObjectiveInfo[Count] == PLACING_TIME)
- {
- ObjectivePlaced=true;
- new string[128],id=ObjectiveInfo[BeingPlaced];
- format(string,sizeof(string),""SERVER_KEY_MSG" %s (%d) has successfully planted the bomb, 15 seconds before the bomb explodes.",PlayerMissionInfo[id][UserName],id);
- SendClientMessageToAll(COLOR_SERVER,string);
- SetTimerEx("Explosion",15000,false,"ii",0,5);
- KillTimer(ObjectiveInfo[ObjectiveTimer]);
- KillTimer(ObjectiveInfo[ProgressTimer]);
- FlashTimer= SetTimer("FlasBomb",500,true);
- CallRemoteFunction("FlashBombBar", "");
- CallRemoteFunction("UpdateBombInfo", "");
- CallRemoteFunction("KillGameModeTimer","");
- CallRemoteFunction("TD_Clock","s","_");
- DisableCheckpointForAll();
- }
- return 1;
- }
- FUNCTION FlasBomb()
- {
- CallRemoteFunction("FlashBombBar", "");
- return 1;
- }
- FUNCTION Explosion(start, until)
- {
- for(new i = start; i < until; i++)
- {
- if(i >= MaxExplosions) break;
- CreateExplosion(ExplosionsInfo[i][0], ExplosionsInfo[i][1], ExplosionsInfo[i][2] , 7, 20.0);
- }
- start += 5;
- until += 5;
- if(until > MaxExplosions)
- {
- CallRemoteFunction("EndMission","");
- KillTimer(FlashTimer);
- }
- else
- {
- SetTimerEx("Explosion", 1000, false, "ii", start, until);
- }
- return 1;
- }
- DisableCheckpointForAll()
- {
- for(new i=0,j=GetPlayerPoolSize(); i <=j ; i++)
- {
- if(!IsPlayerConnected(i)) continue;
- DisablePlayerCheckpoint(i);
- }
- }
- PlaySoundForAll(sound)
- {
- for(new i=0,j=GetPlayerPoolSize(); i <=j ; i++)
- {
- if(IsPlayerConnected(i)) PlayerPlaySound(i,sound,0,0,0);
- }
- }
- //==============================================================================
- // Important functions required
- //==============================================================================
- FUNCTION OnPlayerNameRecieve(playerid,name[])
- {
- format(PlayerMissionInfo[playerid][UserName],MAX_PLAYER_NAME,"%s",name);
- return 1;
- }
- FUNCTION CancelTheMission()
- {
- MissionCancelled= true;
- return 1;
- }
- FUNCTION MissionObjectiveStarted() return ObjectiveStarted;
- FUNCTION OnPlayerSpectateObjective(playerid)
- {
- SetPlayerCameraPos(playerid, CP_POS + 2.5);
- SetPlayerCameraLookAt(playerid, CP_POS);
- SetPlayerPos(playerid, CP_POS - 5);
- SetPlayerColor(playerid, (PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK) ? COLOR_TEAM_ATTACK_INV : COLOR_TEAM_DEFEND_INV);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment