Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Script by: Sasuke_Uchiha
- 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 "Zombotech Breakout"
- #define Health 99.0
- #define OBJ_NAME "Analysis Lab"
- #define CP_POS -1921.3180,643.8784,46.5625
- #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 "Scientists"
- #define TEAM_ATTACK_NAME "Hippies"
- #define MAX_MAP_OBJECTS 23
- #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,72,-1706.9100,1018.2330,17.5859,265.7611,0,0,WEAPON_DEAGLE,100,WEAPON_SHOTGUN,100,WEAPON_MP5,120},
- {TEAM_DEFEND,70, -1973.8809,640.2412,46.5625,358.0914,0,0,WEAPON_DEAGLE,100,WEAPON_SHOTGUN,100,WEAPON_MP5,120},
- {TEAM_ATTACK,73,-1716.0190,1018.3843,17.5859,89.9794,0,0,WEAPON_COLT45,280,WEAPON_SHOTGSPA,160,WEAPON_AK47,120},
- {TEAM_DEFEND,290, -1985.9628,660.1379,46.5683,266.8450,0,0,WEAPON_COLT45,280,WEAPON_SHOTGSPA,160,WEAPON_AK47,120}
- };
- new const Float:ExplosionsInfo[][3] = {
- {-1960.4420,685.3842,50.5625},
- {-1956.4834,644.5552,50.5625},
- {-1920.3893,644.8896,46.5625},
- {-1922.2981,679.2878,46.5625},
- {-1951.9568,651.3607,47.7031},
- {-1983.3198,650.9373,46.5683},
- {-1952.7455,685.1750,46.5625},
- {-1930.7869,685.9023,46.5625},
- {-1971.1843,695.2595,46.5683}
- };
- #if MAX_MAP_OBJECTS != 0
- new Object[MAX_MAP_OBJECTS];
- CreateMap()
- {
- Object[0] = CreateObject(19903,-1917.1569800,639.2388900,45.5165100,0.0000000,0.0000000,92.4600100); //
- Object[1] = CreateObject(19903,-1926.9942600,639.1651600,45.5165100,0.0000000,0.0000000,92.4600100); //
- Object[2] = CreateObject(2190,-1920.5046400,638.8864100,46.6175600,0.0000000,0.0000000,180.9000200); //
- Object[3] = CreateObject(3383,-1921.9122300,639.6029100,45.5628600,0.0000000,0.0000000,0.0000000); //
- Object[4] = CreateObject(19449,-1916.2100800,639.8951400,52.4401000,0.0000000,90.0000000,1800.0000000); //
- Object[5] = CreateObject(354,-1923.2518300,639.7293100,47.6154400,0.0000000,0.0000000,0.0000000); //
- Object[6] = CreateObject(354,-1921.1184100,639.6665600,47.6371300,0.0000000,0.0000000,0.0000000); //
- Object[7] = CreateObject(2908,-1923.0831300,639.7717300,46.6618700,0.0000000,90.0000000,-90.0000000); //
- Object[8] = CreateObject(2907,-1922.5830100,639.8042000,46.6167000,0.0000000,0.0000000,-90.0000000); //
- Object[9] = CreateObject(2906,-1922.6356200,639.5239900,46.6139500,0.0000000,0.0000000,-124.3800100); //
- Object[10] = CreateObject(2905,-1921.7828400,639.8706100,46.6394500,0.0000000,0.0000000,-90.0000000); //
- Object[11] = CreateObject(3675,-1917.5730000,652.7583000,51.2706000,0.0000000,0.0000000,-90.0000000); //
- Object[12] = CreateObject(3675,-1917.5730000,655.4498300,51.2706000,0.0000000,0.0000000,-90.0000000); //
- Object[13] = CreateObject(3675,-1917.5730000,657.8676800,51.2706000,0.0000000,0.0000000,-90.0000000); //
- Object[14] = CreateObject(9819,-1923.3176300,650.0571900,46.4414900,0.0000000,0.0000000,90.0000000); //
- Object[15] = CreateObject(3393,-1917.7061800,644.4429900,45.5453600,0.0000000,0.0000000,0.0000000); //
- Object[16] = CreateObject(10675,-1951.9462900,659.2756300,49.3085600,0.0000000,0.0000000,0.0000000); //
- Object[17] = CreateObject(1685,-1917.4967000,648.7882100,46.2534600,0.0000000,0.0000000,0.0000000); //
- Object[18] = CreateObject(3675,-1917.5730000,660.2581800,51.2706000,0.0000000,0.0000000,-90.0000000); //
- Object[19] = CreateObject(3675,-1917.5730000,662.8228100,51.2706000,0.0000000,0.0000000,-90.0000000); //
- Object[20] = CreateObject(3470,-1922.0819100,645.5271600,45.5833000,0.0000000,90.0000000,90.0000000); //
- Object[21] = CreateObject(3257,-1925.6503900,657.7735000,45.6263100,0.0000000,0.0000000,90.0000000); //
- Object[22] = CreateObject(3257,-1932.9851100,644.7775900,45.6263000,0.0000000,0.0000000,180.0000000); //
- CreateVehicle(586, -1689.1031, 1040.3396, 17.1095, 90.0000, -1, -1, 100);
- CreateVehicle(586, -1689.0413, 1044.7971, 17.1095, 90.0000, -1, -1, 100);
- CreateVehicle(586, -1689.3944, 1048.1548, 17.1095, 90.0000, -1, -1, 100);
- CreateVehicle(586, -1689.3392, 1052.1312, 17.1095, 90.0000, -1, -1, 100);
- CreateVehicle(542, -1736.5881, 1059.1284, 17.3073, -90.0000, -1, -1, 100);
- CreateVehicle(542, -1736.1342, 1053.3311, 17.3073, -90.0000, -1, -1, 100);
- CreateVehicle(542, -1736.2415, 1048.7224, 17.3073, -90.0000, -1, -1, 100);
- CreateVehicle(542, -1736.3802, 1045.0112, 17.3073, -90.0000, -1, -1, 100);
- CreateVehicle(542, -1736.0746, 1041.1436, 17.3073, -90.0000, -1, -1, 100);
- CreateVehicle(542, -1736.1768, 1036.9763, 17.3073, -90.0000, -1, -1, 100);
- CreateVehicle(542, -1736.2611, 1033.0726, 17.3073, -90.0000, -1, -1, 100);
- CreateVehicle(463, -1735.8231, 1028.7996, 17.0190, -90.0000, -1, -1, 100);
- CreateVehicle(463, -1736.1193, 1024.6992, 17.0190, -90.0000, -1, -1, 100);
- CreateVehicle(463, -1736.0945, 1020.4105, 17.0190, -90.0000, -1, -1, 100);
- CreateVehicle(463, -1735.5815, 1016.7099, 17.0190, -90.0000, -1, -1, 100);
- CreateVehicle(463, -1735.7897, 1012.8233, 17.0190, -90.0000, -1, -1, 100);
- }
- #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