Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* -----------------------------------------------------------------------------------
- Mini Missions
- Mission 1
- Author: freshOrange
- -------------------------------------------------------------------------------------- */
- #include <a_samp>
- #include <zcmd>
- /* ----------------------------------------------------------------------------------- */
- new gTeam[MAX_PLAYERS];
- /* ----------------------------------------------------------------------------------- */
- #define TEAM_POLICE 0
- #define TEAM_MAFIA 1
- #define COLOR_BROWN 0x8b4513AA
- #define COLOR_BLUE 0xadd8e6AA
- /* ----------------------------------------------------------------------------------- */
- forward NextMission(playerid);
- forward UpdateTime();
- /* ----------------------------------------------------------------------------------- */
- new Time, TimeM, TimeS;
- new Text:Timer;
- /* ----------------------------------------------------------------------------------- */
- main()
- {
- }
- /* ----------------------------------------------------------------------------------- */
- public OnGameModeInit()
- {
- SetTimer("NextMission",6000000,false); // 10 minutes
- SetGameModeText("Mini Misijas");
- Timer = TextDrawCreate(550.000000, 30.000000, "10:00");
- TextDrawFont(Timer, 3);
- TextDrawLetterSize(Timer, 0.600000, 1.100000);
- TextDrawSetOutline(Timer, 1);
- TextDrawSetShadow(Timer, 0);
- TimeM = 10;
- TimeS = 0;
- Time = SetTimer("UpdateTime", 1000, true);
- EnableStuntBonusForAll(0);
- DisableInteriorEnterExits();
- AddPlayerClass(280,162.9307,-25.8189,1.5781,269.6755,3,1,24,50,29,200); // Police officer nr.1
- AddPlayerClass(281,162.9307,-25.8189,1.5781,269.6755,3,1,24,50,29,200); // Police officer nr.2
- AddPlayerClass(282,162.9307,-25.8189,1.5781,269.6755,3,1,24,50,29,200); // Police officer nr.3
- AddPlayerClass(124,-107.5323,-219.7684,2.0466,84.4703,1,1,23,150,25,50); // Mafia member nr.1
- AddPlayerClass(125,-107.5323,-219.7684,2.0466,84.4703,1,1,23,150,25,50); // Mafia member nr.2
- AddPlayerClass(126,-107.5323,-219.7684,2.0466,84.4703,1,1,23,150,25,50); // Mafia member nr.3
- // Police cars
- AddStaticVehicleEx (596, 166.1790,-7.2172,1.5846,180.0846, -1, -1, 60);
- AddStaticVehicleEx (596, 169.5349,-7.1033,1.3017,180.0391, -1, -1, 60);
- AddStaticVehicleEx (596, 172.9866,-7.0533,1.3007,180.5353, -1, -1, 60);
- AddStaticVehicleEx (596, 176.2777,-7.0842,1.2984,179.6193, -1, -1, 60);
- AddStaticVehicleEx (596, 179.7451,-7.1449,1.2991,179.3092, -1, -1, 60);
- AddStaticVehicleEx (596, 183.1234,-7.1395,1.2994,180.0071, -1, -1, 60);
- AddStaticVehicleEx (596, 186.4222,-7.0926,1.2997,179.4864, -1, -1, 60);
- AddStaticVehicleEx (596, 189.8661,-7.0732,1.2986,178.6444, -1, -1, 60);
- AddStaticVehicleEx (596, 193.1977,-7.1274,1.2987,178.4328, -1, -1, 60);
- AddStaticVehicleEx (596, 196.7410,-7.1193,1.2984,179.2526, -1, -1, 60);
- // Mafia cars
- AddStaticVehicleEx (585, -113.2624,-206.4,1.4219,178.1578, -1, -1, 60);
- AddStaticVehicleEx (585, -116.9332,-206.0521,1.0138,176.4025, -1, -1, 60);
- AddStaticVehicleEx (585, -120.8481,-205.3327,1.0151,174.4080, -1, -1, 60);
- AddStaticVehicleEx (585, -124.7338,-204.4919,1.0146,173.0910, -1, -1, 60);
- AddStaticVehicleEx (585, -128.7097,-203.7087,1.0149,172.7836, -1, -1, 60);
- AddStaticVehicleEx (585, -132.5875,-202.9248,1.0158,171.1926, -1, -1, 60);
- return 1;
- }
- /* ----------------------------------------------------------------------------------- */
- public OnPlayerConnect(playerid)
- {
- PlayerPlaySound(playerid, 1097, -1889.2936,13.7995,38.2361);
- TextDrawShowForPlayer(playerid, Timer);
- return 1;
- }
- /* ----------------------------------------------------------------------------------- */
- public OnPlayerSpawn(playerid)
- {
- ClearAnimations(playerid);
- ApplyAnimation(playerid, "CARRY", "crry_prtial", 2.0, 0, 0, 0, 0, 0);
- PlayerPlaySound(playerid,1186,162.9307,-25.8189,1.5781);
- PlayerPlaySound(playerid,1186,-107.5323,-219.7684,2.0466);
- SetPlayerToTeamColor(playerid);
- SetPlayerCheckpoint(playerid, 244.6853,-54.9326,1.5776,1.0);
- SetPlayerWeather(playerid, 1);
- }
- /* ----------------------------------------------------------------------------------- */
- public OnPlayerEnterCheckpoint(playerid)
- {
- new string[128];
- new playername [MAX_PLAYER_NAME];
- GetPlayerName (playerid, playername, sizeof(string));
- if(gTeam[playerid] == TEAM_MAFIA)
- {
- format (string, sizeof(string), "Attention: %s is planting the bomb!", playername);
- SendClientMessageToAll (COLOR_BROWN, string);
- SetTimerEx("Blow", 10000, false, "i", playerid);
- }
- return 1;
- }
- /* ----------------------------------------------------------------------------------- */
- public OnPlayerLeaveCheckpoint(playerid)
- {
- new string[128];
- new playername [MAX_PLAYER_NAME];
- GetPlayerName (playerid, playername, sizeof(string));
- if(gTeam[playerid] == TEAM_MAFIA)
- {
- format (string, sizeof(string), "Attention: %s has stopped planting the bomb!", playername);
- SendClientMessageToAll (COLOR_BROWN, string);
- }
- return 1;
- }
- /* ----------------------------------------------------------------------------------- */
- forward Blow(playerid);
- public Blow(playerid)
- {
- SetTimer("NextMission",3100, true);
- DisablePlayerCheckpoint(playerid);
- GameTextForAll("~g~Mafia wins!~n~~n~~w~+1000", 3100, 5);
- if(gTeam[playerid] == TEAM_MAFIA)
- {
- GivePlayerMoney(playerid, 1000);
- }
- CreateExplosion(244.6853,-54.9326,1.5776,6,10.0);
- CreateExplosion(244.6853,-54.9326,1.5776,6,10.0);
- CreateExplosion(244.6853,-54.9326,1.5776,6,10.0);
- CreateExplosion(244.6853,-54.9326,1.5776,6,10.0);
- CreateExplosion(244.6853,-54.9326,1.5776,6,10.0);
- SetPlayerCameraPos(playerid, 233.2313,-89.3113,13.8129);
- SetPlayerCameraLookAt(playerid, 252.0213,-61.7359,3.0750);
- }
- /* ----------------------------------------------------------------------------------- */
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(killerid == INVALID_PLAYER_ID)
- {
- SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
- }
- else
- {
- SendDeathMessage(killerid,playerid,reason);
- SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
- }
- }
- /* ----------------------------------------------------------------------------------- */
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, -1889.18,18.0183,38.2361);
- SetPlayerInterior(playerid, 0);
- SetPlayerFacingAngle(playerid, 180);
- SetPlayerCameraPos(playerid, -1889.2936,13.7995,38.2361);
- SetPlayerCameraLookAt(playerid, -1889.1069,18.1730,39.0669);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_HANDSUP);
- SetPlayerTeamFromClass(playerid, classid);
- switch (classid)
- {
- case 0:
- {
- GameTextForPlayer(playerid, "~b~POLICE", 2000, 6);
- }
- case 1:
- {
- GameTextForPlayer(playerid, "~b~POLICE", 2000, 6);
- }
- case 2:
- {
- GameTextForPlayer(playerid, "~b~POLICE", 2000, 6);
- }
- case 3:
- {
- GameTextForPlayer(playerid, "~g~MAFIA", 2000, 6);
- }
- case 4:
- {
- GameTextForPlayer(playerid, "~g~MAFIA", 2000, 6);
- }
- case 5:
- {
- GameTextForPlayer(playerid, "~g~MAFIA", 2000, 6);
- }
- }
- return 1;
- }
- /* ----------------------------------------------------------------------------------- */
- public NextMission(playerid)
- {
- if(gTeam[playerid] == TEAM_POLICE)
- {
- GivePlayerMoney(playerid, 1000);
- SetPlayerCameraPos(playerid, 233.2313,-89.3113,13.8129);
- SetPlayerCameraLookAt(playerid, 252.0213,-61.7359,3.0750);
- }
- GameTextForAll("~b~Police wins!~n~~n~~w~+1000", 5000, 5);
- SendRconCommand("gmx");
- return 1;
- }
- /* ----------------------------------------------------------------------------------- */
- public UpdateTime()
- {
- new Str[34];
- TimeS --;
- if(TimeM == 0 && TimeS == 0)
- {
- KillTimer(Time);
- }
- if(TimeS == -1)
- {
- TimeM--;
- TimeS = 59;
- }
- format(Str, sizeof(Str), "%02d:%02d", TimeM, TimeS);
- TextDrawSetString(Timer, Str);
- return 1;
- }
- /* ----------------------------------------------------------------------------------- */
- CMD:kill(playerid, params[])
- {
- SetPlayerHealth(playerid, 0);
- return 1;
- }
- /* ----------------------------------------------------------------------------------- */
- SetPlayerTeamFromClass(playerid, classid)
- {
- switch(classid)
- {
- case 0,1,2: gTeam[playerid] = TEAM_POLICE;
- case 3,4,5: gTeam[playerid] = TEAM_MAFIA;
- }
- return 0;
- }
- /* ----------------------------------------------------------------------------------- */
- SetPlayerToTeamColor(playerid)
- {
- if (gTeam[playerid] == TEAM_POLICE)
- {
- SetPlayerColor(playerid, COLOR_BLUE);
- }
- else if (gTeam[playerid] == TEAM_MAFIA)
- {
- SetPlayerColor(playerid, COLOR_BROWN);
- }
- }
- /* ----------------------------------------------------------------------------------- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement