Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Script by: Bullet
- Map by: Bullet
- Mission Base: Team Deathmatch
- Mission Type: Team Deathmatch
- Mission Type ID: 6
- */
- //==============================================================================
- // Includes
- //==============================================================================
- #include <a_samp>
- #include <crashdetect>
- #include <float>
- #include <fixes2>
- #include "..\filterscripts\MM\stuff\defines"
- #include "..\filterscripts\MM\stuff\serverkeymsg"
- //==============================================================================
- // Defines
- //==============================================================================
- #define MISSION_NAME "Drainage"
- #define Health 99.0
- #define TEAM_DEFEND_NAME "Federal Agent"
- #define TEAM_ATTACK_NAME "County Sheriff"
- #define MAX_MAP_OBJECTS 106
- #define VEHICLE_HEALTH 0
- #define CLASS_POSTION 4141.5347,2121.2827,23.2835
- #define CLASS_CAMERA 4142.8501,2116.5156,23.2835
- #define CLASS_FACING_AGNLE 198.6635
- #define SINKING false
- #define SPAWN_PROTECTION true
- //==============================================================================
- // Per mission functions
- //==============================================================================
- enum ped_enum
- {
- TeamID,
- Skin,
- Float:SpawnX,
- Float:SpawnY,
- Float:SpawnZ,
- Float:SpawnAngle,
- SpawnInterior,
- VirtualWorld,
- Weapon1,
- Ammo1,
- Weapon2,
- Ammo2,
- Weapon3,
- Ammo3,
- };
- new PedInfo[][ped_enum] = {
- {TEAM_ATTACK, 283, 4123.7314,2188.5642,17.2619,359.7547,0,0,WEAPON_SNIPER,9999,0,0,0,0},
- {TEAM_DEFEND, 286, 4082.3262,2091.0059,15.5818,179.5620,0,0,WEAPON_SNIPER,9999,0,0,0,0}
- };
- #if SINKING == true
- new MapSkining[2];
- #endif
- #if MAX_MAP_OBJECTS != 0
- new Object[MAX_MAP_OBJECTS];
- CreateMap()
- {
- Object[0] = CreateObject(8,4092.4409200,2119.9299300,11.3761000,0.0000000,0.0000000,0.0000000); //
- Object[1] = CreateObject(8210,4100.4570300,2189.3310500,17.5001000,0.0000000,0.0000000,-90.0000000); //
- Object[2] = CreateObject(8210,4100.3671900,2133.8305700,17.5001000,0.0000000,0.0000000,-90.0000000); //
- Object[3] = CreateObject(8210,4127.6860400,2051.7866200,17.4830800,0.0000000,0.0000000,-180.0000500); //
- Object[4] = CreateObject(8210,4155.6899400,2135.2675800,17.5001000,0.0000000,0.0000000,-90.0000000); //
- Object[5] = CreateObject(8210,4155.6860400,2190.8120100,17.5001000,0.0000000,0.0000000,-90.0000000); //
- Object[6] = CreateObject(8210,4127.6987300,2217.2417000,17.5001000,0.0000000,0.0000000,-180.0000000); //
- Object[7] = CreateObject(8071,4120.8911100,2136.3532700,15.6869000,0.0000000,0.0000000,90.0000000); //
- Object[8] = CreateObject(7249,4185.9287100,2161.4311500,23.5581300,0.0000000,0.0000000,-180.0601200); //
- Object[9] = CreateObject(12919,4123.4995100,2191.8278800,14.6221400,0.0000000,0.0000000,-269.9999100); //
- Object[10] = CreateObject(8210,4155.6694300,2079.7111800,17.5001000,0.0000000,0.0000000,-90.0000000); //
- Object[11] = CreateObject(3885,4123.0488300,2203.8051800,18.7224300,0.0000000,0.0000000,-21.8400000); //
- Object[12] = CreateObject(5291,4158.1157200,2220.0986300,25.7798900,0.0000000,0.0000000,-138.7200200); //
- Object[13] = CreateObject(3286,4140.7856400,2171.0324700,19.2845200,0.0000000,0.0000000,-87.0600000); //
- Object[14] = CreateObject(8653,4115.0625000,2142.6298800,15.4524300,0.0000000,0.0000000,-90.0000300); //
- Object[15] = CreateObject(14409,4145.9594700,2126.2421900,17.5554900,0.0000000,0.0000000,0.0000000); //
- Object[16] = CreateObject(8838,4143.3510700,2105.9948700,20.7529000,0.0000000,0.0000000,90.0000000); //
- Object[17] = CreateObject(8838,4148.4287100,2121.1584500,5.5882800,0.0000000,90.0000000,90.0000000); //
- Object[18] = CreateObject(8838,4143.3330100,2121.1848100,5.5883000,0.0000000,90.0000000,90.0000000); //
- Object[19] = CreateObject(8838,4148.4711900,2105.9982900,20.7529000,0.0000000,0.0000000,90.0000000); //
- Object[20] = CreateObject(8838,4143.3173800,2090.8225100,5.5883000,0.0000000,90.0000000,-90.0000000); //
- Object[21] = CreateObject(8838,4148.4526400,2090.8203100,5.5883000,0.0000000,90.0000000,-90.0000000); //
- Object[22] = CreateObject(8838,4142.2890600,2106.0231900,19.6997800,270.0000000,0.0000000,90.0000000); //
- Object[23] = CreateObject(8838,4142.2890600,2106.0231900,14.5794100,270.0000000,0.0000000,90.0000000); //
- Object[24] = CreateObject(3628,4147.8129900,2152.6872600,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[25] = CreateObject(3628,4147.8105500,2173.7434100,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[26] = CreateObject(3628,4147.8115200,2194.7956500,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[27] = CreateObject(3628,4147.8125000,2131.6098600,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[28] = CreateObject(3628,4147.7363300,2110.5730000,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[29] = CreateObject(3628,4147.7866200,2089.5117200,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[30] = CreateObject(3628,4147.7700200,2068.4321300,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[31] = CreateObject(3628,4147.7705100,2047.3533900,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[32] = CreateObject(3628,4163.5166000,2083.5844700,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[33] = CreateObject(3628,4161.7900400,2194.7905300,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[34] = CreateObject(3628,4161.8559600,2173.6948200,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[35] = CreateObject(3628,4161.8540000,2152.6364700,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[36] = CreateObject(3628,4161.8457000,2131.5700700,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[37] = CreateObject(3628,4161.7788100,2110.5485800,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[38] = CreateObject(3628,4161.8369100,2089.4724100,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[39] = CreateObject(3628,4161.8115200,2068.4331100,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[40] = CreateObject(3628,4161.8149400,2047.3710900,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[41] = CreateObject(12921,4100.3632800,2131.4099100,17.8798200,0.0000000,0.0000000,-269.9997900); //
- Object[42] = CreateObject(8210,4072.3759800,2105.8850100,17.5001000,0.0000000,0.0000000,-180.0600000); //
- Object[43] = CreateObject(8210,4062.5615200,2089.1252400,17.5001000,0.0000000,0.0000000,-90.0600000); //
- Object[44] = CreateObject(7250,4052.1965300,2004.6585700,6.7860100,0.0000000,0.0000000,-270.1800200); //
- Object[45] = CreateObject(7249,4214.2485400,2057.4160200,23.5581300,0.0000000,0.0000000,-232.9200700); //
- Object[46] = CreateObject(8210,4072.1501500,2051.7922400,17.4934300,0.0000000,0.0000000,-180.0000500); //
- Object[47] = CreateObject(7250,4015.5730000,2126.2922400,-5.8957000,0.0000000,0.0000000,-360.0603600); //
- Object[48] = CreateObject(8210,4063.9826700,2033.6689500,17.5001000,0.0000000,0.0000000,-87.0599900); //
- Object[49] = CreateObject(7250,4143.5727500,2263.2990700,11.2249700,0.0000000,0.0000000,-90.1199900); //
- Object[50] = CreateObject(8210,4127.7670900,2214.9206500,17.5001000,0.0000000,0.0000000,-180.0001700); //
- Object[51] = CreateObject(3628,4147.7578100,2215.8498500,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[52] = CreateObject(3628,4161.8222700,2215.8476600,10.5907400,0.0000000,0.0000000,0.0000000); //
- Object[53] = CreateObject(7250,4040.0622600,2165.3918500,-5.8957000,0.0000000,0.0000000,-384.7803300); //
- Object[54] = CreateObject(18250,4081.8461900,2086.0534700,20.6364600,0.0000000,0.0000000,0.0000000); //
- Object[55] = CreateObject(3279,4069.9477500,2058.6591800,14.4251200,0.0000000,0.0000000,0.0000000); //
- Object[56] = CreateObject(3249,4118.5073200,2100.2275400,14.5895000,0.0000000,0.0000000,-90.0000000); //
- Object[57] = CreateObject(3246,4130.0913100,2071.5993700,14.5895000,0.0000000,0.0000000,-90.0000000); //
- Object[58] = CreateObject(3244,4147.6699200,2063.8090800,14.5895000,0.0000000,0.0000000,-90.0000000); //
- Object[59] = CreateObject(3253,4114.9531300,2077.4653300,14.5895000,0.0000000,0.0000000,-90.0000000); //
- Object[60] = CreateObject(17039,4106.2456100,2153.1523400,14.5555000,0.0000000,0.0000000,-0.1200100); //
- Object[61] = CreateObject(17000,4107.2168000,2207.3781700,14.2716400,0.0000000,0.0000000,0.0000000); //
- Object[62] = CreateObject(16406,4112.0546900,2059.8115200,19.1236800,0.0000000,0.0000000,0.0000000); //
- Object[63] = CreateObject(17060,4126.0073200,2121.9023400,14.1606700,0.0000000,0.0000000,-179.9999400); //
- Object[64] = CreateObject(17074,4141.6191400,2196.4746100,14.5148000,0.0000000,0.0000000,0.0000000); //
- Object[65] = CreateObject(1458,4071.5571300,2084.7482900,14.9393000,0.0000000,0.0000000,-107.7000000); //
- Object[66] = CreateObject(1457,4090.8076200,2087.7836900,16.2930900,0.0000000,0.0000000,0.0000000); //
- Object[67] = CreateObject(1483,4133.0971700,2141.1569800,16.2763600,0.0000000,0.0000000,-89.9999800); //
- Object[68] = CreateObject(1483,4133.0815400,2137.4499500,16.2763600,0.0000000,0.0000000,-270.0000300); //
- Object[69] = CreateObject(7250,4049.6477100,2230.6323200,-5.5715000,0.0000000,0.0000000,-356.1004900); //
- Object[70] = CreateObject(18013,4146.8920900,2098.4763200,20.1680000,0.0000000,0.0000000,90.0000000); //
- Object[71] = CreateObject(18013,4146.8813500,2113.7258300,20.1680000,0.0000000,0.0000000,90.0000000); //
- Object[72] = CreateObject(18013,4146.8676800,2109.2270500,20.1680200,0.0000000,0.0000000,90.0000200); //
- Object[73] = CreateObject(18013,4146.8979500,2105.0053700,20.1680000,0.0000000,0.0000000,90.0000000); //
- Object[74] = CreateObject(8838,4153.5727500,2106.0083000,20.7529000,0.0000000,0.0000000,-90.0000000); //
- Object[75] = CreateObject(17060,4112.0263700,2120.7714800,14.1606700,0.0000000,0.0000000,-179.9999400); //
- Object[76] = CreateObject(3364,4148.1645500,2152.7780800,14.5510800,0.0000000,0.0000000,0.0000000); //
- Object[77] = CreateObject(18609,4080.3293500,2092.6975100,15.6354400,0.0000000,0.0000000,0.0000000); //
- Object[78] = CreateObject(17030,4062.9267600,2115.5681200,13.4331100,0.0000000,0.0000000,-307.9801300); //
- Object[79] = CreateObject(17030,4063.1438000,2116.1489300,22.0727500,15.5400000,-3.5399900,-307.9801300); //
- Object[80] = CreateObject(17030,4061.8386200,2116.2004400,27.7001000,15.5400000,-3.5399900,-307.9801300); //
- Object[81] = CreateObject(3363,4124.9594700,2158.4860800,14.5872200,0.0000000,0.0000000,0.0000000); //
- Object[82] = CreateObject(14875,4105.8403300,2175.8916000,15.3631700,0.0000000,0.0000000,0.0000000); //
- Object[83] = CreateObject(14875,4107.5410200,2174.9545900,15.3631700,0.0000000,0.0000000,0.0000000); //
- Object[84] = CreateObject(3252,4085.4282200,2059.6499000,14.5895000,0.0000000,0.0000000,-90.0000000); //
- Object[85] = CreateObject(3285,4096.0659200,2060.2382800,16.3421500,0.0000000,0.0000000,-90.0000000); //
- Object[86] = CreateObject(14875,4109.3486300,2174.0114700,15.3631700,0.0000000,0.0000000,0.0000000); //
- Object[87] = CreateObject(11364,-2073.7109400,-859.9453100,30.5703100,0.0000000,0.0000000,0.0000000); //
- Object[88] = CreateObject(16302,4118.6162100,2095.8767100,12.9404100,0.0000000,0.0000000,-91.2000000); //
- Object[89] = CreateObject(3280,4123.3237300,2178.7385300,17.9888300,0.0000000,0.0000000,0.0000000); //
- Object[90] = CreateObject(3278,4124.2939500,2176.8466800,20.1450400,0.0000000,0.0000000,0.0000000); //
- Object[91] = CreateObject(3278,4122.2724600,2176.8701200,20.1450400,0.0000000,0.0000000,0.0000000); //
- Object[92] = CreateObject(3278,4122.2724600,2176.8701200,19.5978900,0.0000000,0.0000000,0.0000000); //
- Object[93] = CreateObject(3278,4124.7192400,2176.9160200,19.5978900,0.0000000,0.0000000,0.0000000); //
- Object[94] = CreateObject(3278,4116.3046900,2201.0449200,15.5561000,0.0000000,0.0000000,90.0000300); //
- Object[95] = CreateObject(3278,4116.2690400,2198.6350100,15.5561000,0.0000000,0.0000000,90.0000300); //
- Object[96] = CreateObject(3278,4130.9502000,2180.4003900,15.5561000,0.0000000,0.0000000,90.0000300); //
- Object[97] = CreateObject(3278,4130.9692400,2182.8298300,15.5561000,0.0000000,0.0000000,90.0000300); //
- Object[98] = CreateObject(8171,4022.9270000,2106.1980000,15.8115100,0.0000000,-90.0000000,-90.0000200); //
- Object[99] = CreateObject(8171,4061.9731400,2040.3776900,25.2540000,0.0000000,-90.0000000,-0.0000100); //
- Object[100] = CreateObject(8171,4115.7348600,2051.5908200,23.9922700,0.0000000,-90.0000000,89.8199300); //
- Object[101] = CreateObject(8171,4155.9555700,2120.1997100,23.9922700,0.0000000,-90.0000000,180.0000500); //
- Object[102] = CreateObject(8171,4155.9736300,2257.6821300,23.9922700,0.0000000,-90.0000000,180.0000500); //
- Object[103] = CreateObject(8171,4089.9292000,2215.5095200,23.9922700,0.0000000,-90.0000000,269.9996600); //
- Object[104] = CreateObject(17030,4065.4814500,2117.9951200,24.1583300,27.7200000,-4.0199900,-312.8399700); //
- Object[105] = CreateObject(8171,4099.9692400,2217.8371600,25.2540000,0.0000000,-90.0000000,0.0000300); //
- }
- #endif
- //==============================================================================
- // Basic vars
- //==============================================================================
- new bool:MissionStarted;
- new bool:ObjectiveStarted;
- new bool:MissionCancelled;
- native IsValidVehicle(vehicleid);
- enum teamdata
- {
- Kills,
- Name[32],
- Members
- };
- enum playerdata
- {
- UserName[MAX_PLAYER_NAME],
- bool:Counted,
- TeamSelection,
- PlayerClassID
- };
- new Team[2][teamdata];
- new PlayerMissionInfo[MAX_PLAYERS][playerdata];
- //==============================================================================
- // 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);
- if(CallRemoteFunction("GetCurrentMissionCJWalk","")) UsePlayerPedAnims();
- #if MAX_MAP_OBJECTS != 0
- CreateMap();
- #endif
- for(new i=0; i<sizeof(PedInfo); i++)AddPlayerClassEx(PedInfo[i][TeamID],PedInfo[i][Skin],PedInfo[i][SpawnX],PedInfo[i][SpawnY],PedInfo[i][SpawnZ],PedInfo[i][SpawnAngle],0,0,0,0,0,0);
- #if SINKING == true
- MapSkining[0] = SetTimer("SinkMap", 80*1000, false);
- #endif
- for(new i=0; i<MAX_VEHICLES; i++) if(IsValidVehicle(i)) SetVehicleHealth(i,VEHICLE_HEALTH);
- for(new i=0; i<MAX_PLAYERS; i++) PlayerMissionInfo[i][TeamSelection]= NO_TEAM;
- 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
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- if(PlayerMissionInfo[playerid][TeamSelection] != NO_TEAM && PlayerMissionInfo[playerid][Counted])
- {
- Team[PlayerMissionInfo[playerid][TeamSelection]][Members] --;
- PlayerMissionInfo[playerid][Counted] = 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("TdmHide","i",playerid);
- CallRemoteFunction("ShowClassSelection","ddsddd",playerid, PedInfo[classid][TeamID],Team[PedInfo[classid][TeamID]][Name], PedInfo[classid][Weapon1], PedInfo[classid][Weapon2], PedInfo[classid][Weapon3]);
- if(PlayerMissionInfo[playerid][Counted] && PlayerMissionInfo[playerid][TeamSelection] != NO_TEAM)
- {
- Team[PlayerMissionInfo[playerid][TeamSelection]][Members]--;
- PlayerMissionInfo[playerid][Counted] = false;
- }
- PlayerMissionInfo[playerid][TeamSelection] = PedInfo[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);
- CallRemoteFunction("TdmShow","i",playerid);
- CallRemoteFunction("TdmUpdate","sssdd","Kills",Team[TEAM_DEFEND][Name],Team[TEAM_ATTACK][Name],Team[TEAM_DEFEND][Kills],Team[TEAM_ATTACK][Kills]);
- SetPlayerHealth(playerid,Health);
- if(CallRemoteFunction("GetSpectateStatus","d",playerid)) return CallRemoteFunction("SpecOffAdmin","d",playerid);
- if(CallRemoteFunction("GetJailedStatus","d",playerid)) CallRemoteFunction("SetJailed","d",playerid);
- else
- {
- SetPlayerPos(playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][SpawnX],PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][SpawnY],PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][SpawnZ]);
- SetPlayerFacingAngle(playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][SpawnAngle]);
- SetPlayerInterior(playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][SpawnInterior]);
- SetPlayerVirtualWorld(playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][VirtualWorld]);
- CallRemoteFunction("GivePlayerWeaponEx","ddd",playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][Weapon1],PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][Ammo1]);
- CallRemoteFunction("GivePlayerWeaponEx","ddd",playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][Weapon2],PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][Ammo2]);
- CallRemoteFunction("GivePlayerWeaponEx","ddd",playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][Weapon3],PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][Ammo3]);
- if(!PlayerMissionInfo[playerid][Counted])
- {
- Team[PlayerMissionInfo[playerid][TeamSelection]][Members]++;
- PlayerMissionInfo[playerid][Counted] = true;
- new opp_team = (PlayerMissionInfo[playerid][TeamSelection] == 1)? 0:1;
- format(string,sizeof(string),"You have chosen team %s, your mission is to kill %s.",Team[PlayerMissionInfo[playerid][TeamSelection]][Name],Team[opp_team][Name]);
- CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1,string,0);
- format(string,sizeof(string),"~r~~h~Eliminate ~w~%s.",Team[opp_team][Name]);
- CallRemoteFunction("ShowInfoText", "iisi", playerid, -1,string,0);
- }
- }
- SetPlayerTeam(playerid,PlayerMissionInfo[playerid][TeamSelection]);
- if(PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK) SetPlayerColor(playerid,COLOR_TEAM_ATTACK);
- else SetPlayerColor(playerid,COLOR_TEAM_DEFEND);
- #if SPAWN_PROTECTION == true
- CallRemoteFunction("SetSpawnProtection","df",playerid,Health);
- #endif
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(killerid != INVALID_PLAYER_ID && PlayerMissionInfo[playerid][TeamSelection] != NO_TEAM && MissionStarted)
- {
- Team[PlayerMissionInfo[killerid][TeamSelection]][Kills]++;
- SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
- CallRemoteFunction("TdmUpdate","sssdd","Kills",Team[TEAM_DEFEND][Name],Team[TEAM_ATTACK][Name],Team[TEAM_DEFEND][Kills],Team[TEAM_ATTACK][Kills]);
- }
- CallRemoteFunction("UpdateAliveState","ii",playerid,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;
- new winning_team;
- if(Team[TEAM_DEFEND][Kills] == Team[TEAM_ATTACK][Kills]) { winning_team = 2; }
- else if(Team[TEAM_DEFEND][Kills] > Team[TEAM_ATTACK][Kills]) { winning_team = 0; }
- else { winning_team = 1; }
- if(winning_team != 2)
- {
- amount =amount+(Team[winning_team][Kills]*100);
- format(string,sizeof(string),""SERVER_KEY_MSG" %s has won the team deathmatch! Reward: $%d",Team[winning_team][Name],amount);
- CallRemoteFunction("IRC_SendMessage","ss",string,IRC_SERVER_COLOR);
- SendClientMessageToAll(COLOR_SERVER,string);
- 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][TeamSelection] == winning_team && PlayerMissionInfo[i][Counted])
- {
- PlayerPlaySound(i,3200,0,0,0);
- SendClientMessage(i,COLOR_SERVER,string);
- CallRemoteFunction("GivePlayerCash","ii",i,amount);
- CallRemoteFunction("PlayerMissionStats","dd",i,0);
- CallRemoteFunction("PlayerMissionStats","dd",i,6);
- }
- if(PlayerMissionInfo[i][TeamSelection] != winning_team && PlayerMissionInfo[i][Counted])
- {
- PlayerPlaySound(i,17004,0,0,0);
- GameTextForPlayer(i,"~R~MISSION FAILED~w~!",3000,3);
- CallRemoteFunction("PlayerMissionStats","dd",i,1);
- }
- }
- }
- else
- {
- PlaySoundForAll(1058);
- format(string,sizeof(string),""SERVER_KEY_MSG" IT'S A DRAW! No team has won the team-deathmatch.");
- SendClientMessageToAll(COLOR_SERVER,string);
- CallRemoteFunction("IRC_SendMessage","ss",string,IRC_SERVER_COLOR);
- for(new i=0,j=GetPlayerPoolSize(); i <= j; i++) if(IsPlayerConnected(i) && PlayerMissionInfo[i][Counted]) CallRemoteFunction("PlayerMissionStats","dd",i,2);
- }
- }
- 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
- //==============================================================================
- #if SINKING == true
- FUNCTION SinkMap()
- {
- GameTextForAll("~r~the island is sinking!",4000,3);
- new Float:X, Float:Y, Float:Z;
- new Float:oldRotX, Float:oldRotY, Float:oldRotZ;
- for(new i = 0; i < MAX_MAP_OBJECTS; i++) { GetObjectPos(Object[i], X, Y, Z), GetObjectRot(Object[i], oldRotX, oldRotY, oldRotZ); MoveObject(Object[i], X, Y, Z-40, 0.6, oldRotX, oldRotY, oldRotZ+0.05); }
- MapSkining[0] = SetTimer("ResurfaceMap", 150*1000,false);
- return true;
- }
- FUNCTION ResurfaceMap()
- {
- GameTextForAll("~g~the island is resurfacing!",4000,3);
- new Float:X, Float:Y, Float:Z;
- new Float:oldRotX, Float:oldRotY, Float:oldRotZ;
- for(new i = 0; i < MAX_MAP_OBJECTS; i++) { GetObjectPos(Object[i], X, Y, Z), GetObjectRot(Object[i], oldRotX, oldRotY, oldRotZ); MoveObject(Object[i], X, Y, Z+40, 0.6, oldRotX, oldRotY, oldRotZ-0.05); }
- //MapSkining[1] = SetTimer("SinkMap", 80000,false);
- return true;
- }
- #endif
- 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;
Advertisement
Add Comment
Please, Sign In to add comment