Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <MWSGM>
- #define TEAM_ARMY 0
- #define TEAM_INSURG 1
- #define CP_AA 0
- #define CP_LV 1
- #define CP_NONE 2
- new obj1, obj2;
- new gTeam[MAX_PLAYERS];
- new CPStatus[MAX_PLAYERS];
- main()
- {
- print("\n----------------------------------");
- print(" Air Mayhem by Zallomallo");
- print("----------------------------------\n");
- }
- new Float:RanSpawnA[6][4] =
- {
- {444.6608,2475.0254,19.4859,52.4392},
- {443.1833,2526.4458,17.7539,102.2597},
- {415.3969,2534.6248,19.1484,342.5652},
- {389.2361,2531.3953,16.5391,171.8203},
- {337.3109,2534.1492,16.8018,179.0270},
- {321.1554,2463.1477,16.4766,5.1488}
- };
- new Float:RanSpawnB[3][4] =
- {
- {1585.9900,1644.6625,10.8203,84.0649},
- {1352.0114,1650.2816,10.8203,282.7697},
- {1302.1096,1495.5107,10.8203,262.6119}
- };
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Air Mayhem");
- AddPlayerClass(287, 1958.3783, 1343.1572, 15.3746, 269.1425, 31, 500, 0, 0, 0, 0);
- AddPlayerClass(165, 0.0, 0.0, 0.0, 0.0, 31, 500, 0, 0, 0, 0);
- AddStaticVehicle(520,1297.7546,1343.3573,11.7534,270.9451,0,7); // hyd
- AddStaticVehicle(476,1283.3756,1361.9178,11.5322,273.5233,0,7); // rustle3
- AddStaticVehicle(476,1281.6790,1324.0360,11.5245,270.6413,0,7); // rustle4
- AddStaticVehicle(476,325.4901,2536.2371,17.5130,179.7633,0,7); // rustle1
- AddStaticVehicle(476,290.3291,2539.7146,17.5262,181.6323,0,7); // rustle2
- AddStaticVehicle(469,365.6693,2538.1079,16.6645,179.9074,0,7); // heli1
- AddStaticVehicle(469,349.2796,2538.8364,16.7307,179.9620,0,7); // heli2
- AddStaticVehicle(603,308.3726,2534.1245,16.6539,180.8548,0,7); // car1
- AddStaticVehicle(555,277.3849,2536.2456,16.4471,181.2458,0,7); // car2
- AddStaticVehicle(415,1558.7574,1661.6639,10.5919,89.9900,0,7); // car1
- AddStaticVehicle(480,1339.2327,1541.5981,10.5943,266.9527,0,7); // car2
- obj1 = AddStaticVehicle(592,1309.2770,1399.1201,12.0151,272.2825,0,7); // objective1
- obj2 = AddStaticVehicle(609,403.7561,2446.3301,16.5674,1.2754,0,0); // objective2
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- switch(classid) {
- case 0: {
- gTeam[playerid] = TEAM_ARMY;
- GameTextForPlayer(playerid, "Army", 2000, 4);
- }
- case 1: {
- gTeam[playerid] = TEAM_INSURG;
- GameTextForPlayer(playerid, "Rebels", 2000, 4);
- }
- }
- SetPlayerPos(playerid, 1627.3291,-2286.6221,94.1328);
- SetPlayerFacingAngle(playerid, 179.6531);
- SetPlayerCameraPos(playerid, 1628.4277,-2299.7849,94.9248);
- SetPlayerCameraLookAt(playerid, 1627.3291,-2286.6221,94.1328);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new pname[24], string[256];
- GetPlayerName(playerid, pname, sizeof(pname));
- SendClientMessage(playerid, Blue1, "Welcome to Air Mayhem!");
- format(string, sizeof(string), "%s has joined the server!", pname);
- SendClientMessageToAll(Green1, string);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new pname[24], string[256];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "%s has left the server!", pname);
- SendClientMessageToAll(Green1, string);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(gTeam[playerid] == TEAM_ARMY) {
- new ranspawn = random(sizeof(RanSpawnB));
- SetPlayerPos(playerid, RanSpawnB[ranspawn][0], RanSpawnB[ranspawn][1], RanSpawnB[ranspawn][2]);
- SetPlayerFacingAngle(playerid, RanSpawnB[ranspawn][3]);
- SetCameraBehindPlayer(playerid);
- SetVehicleParamsForPlayer(obj1, playerid, 0, 1);
- SetVehicleParamsForPlayer(obj2, playerid, 1, 0);
- }
- if(gTeam[playerid] == TEAM_INSURG) {
- new ranspawn = random(sizeof(RanSpawnA));
- SetPlayerPos(playerid, RanSpawnA[ranspawn][0], RanSpawnA[ranspawn][1], RanSpawnA[ranspawn][2]);
- SetPlayerFacingAngle(playerid, RanSpawnA[ranspawn][3]);
- SetCameraBehindPlayer(playerid);
- SetVehicleParamsForPlayer(obj2, playerid, 0, 1);
- SetVehicleParamsForPlayer(obj1, playerid, 1, 0);
- }
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if(vehicleid == obj1 && !ispassenger) {
- SendClientMessage(playerid, Blue1, "Good, now fly back to your base!");
- SetPlayerCheckpoint(playerid, 417.1299,2450.4150,16.5000, 3.0);
- CPStatus[playerid] = CP_AA;
- }
- if(vehicleid == obj2 && !ispassenger) {
- SendClientMessage(playerid, Blue1, "Good, now drive back to your base!");
- SetPlayerCheckpoint(playerid, 1586.7177,1170.6078,10.8125, 3.0);
- CPStatus[playerid] = CP_LV;
- }
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- if(vehicleid == obj2 || vehicleid == obj1) {
- DisablePlayerCheckpoint(playerid);
- CPStatus[playerid] = CP_NONE;
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(CPStatus[playerid] == CP_AA) {
- new pname[24], string[256];
- SendClientMessage(playerid, Blue1, "You have won the round!");
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "%s has won the game for the Rebels!");
- DisablePlayerCheckpoint(playerid);
- CPStatus[playerid] = CP_NONE;
- SetTimer("EndGame", 2500, 0);
- }
- if(CPStatus[playerid] == CP_LV) {
- new pname[24], string[256];
- SendClientMessage(playerid, Blue1, "You have won the round!");
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "%s has won the game for the Army!");
- DisablePlayerCheckpoint(playerid);
- CPStatus[playerid] = CP_NONE;
- SetTimer("EndGame", 2500, 0);
- }
- return 1;
- }
- forward EndGame();
- public EndGame()
- {
- OnGameModeExit();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement