Paste Description for GTA: Bombing Run
GTA: Bombing Run By [xA]Ramjet
- GTA: Bombing Run
- Thursday, January 11th, 2007 at 9:15:23pm MST
- // GTA: BOMBING RUN By Ramjet
- // Based off LYSE coded by Jax.
- #include <a_samp>
- #include <core>
- #include <float>
- #define MAX_PLAYERS 100
- #define INVALID_PLAYER_ID 100
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define OBJECTIVE_COLOR 0xE2C063FF
- #define BALL_RESET_TIME 30000 // ms
- forward SetPlayerToTeamColor(playerid);
- forward SetPlayerTeamFromClass(playerid,classid);
- forward SetPlayerRandomSpawn(playerid);
- forward ExitTheGameMode();
- forward SetupPlayerForClassSelection(playerid);
- static gTeam[MAX_PLAYERS]; // Tracks the team assignment for each player
- #define OBJECTIVE_VEHICLE 1
- #define TEAM_BLUE 1 //tg
- #define TEAM_GREEN 2 //tb
- #define TEAM_BLUE_COLOR 0x0000FFAA
- #define TEAM_GREEN_COLOR 0x33AA33AA
- #define GAME_ROUNDLIMIT 9
- new gPlayerCar[MAX_PLAYERS]; // For Car Jacking Protection
- new gObjectiveBluePlayer=(-1);
- new gObjectiveGreenPlayer=(-1);
- new gObjectiveReached=0;
- new gGreenScore=0;
- new gBlueScore=0;
- new Float:gTeam1RandomPlayerSpawns[5][3] = {
- {1898.4811,-1213.7422,18.3800},
- {1903.7275,-1183.4065,22.9972},
- {1906.9772,-1194.1093,21.5643},
- {1918.7587,-1176.0880,22.3803},
- {1923.9995,-1219.1479,19.5952}
- };
- new Float:gTeam2RandomPlayerSpawns[5][3] = {
- {2015.3528,-1173.7057,21.7366},
- {2034.3434,-1190.3647,22.4699},
- {2036.5083,-1206.1500,22.6308},
- {2015.8668,-1217.2856,20.9440},
- {2019.4512,-1196.3738,20.5045}
- };
- main()
- {
- print("\nÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ");
- print("²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²");
- print("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");
- print("°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°");
- print("\n Å GTA: Bombing Run Å ");
- print("\n°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°");
- print("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");
- print("²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²");
- print("ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ");
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- new vehicleid;
- if(newstate == PLAYER_STATE_DRIVER)
- {
- vehicleid = GetPlayerVehicleID(playerid);
- if(gTeam[playerid] == TEAM_GREEN && vehicleid == OBJECTIVE_VEHICLE)
- { // It's the objective vehicle
- SetPlayerColor(playerid,OBJECTIVE_COLOR);
- GameTextForAll("~g~Green Team Has The Ball!",5000,5);
- gObjectiveBluePlayer = playerid;
- SetPlayerCheckpoint(playerid,2048.3293,-1194.6172,23.6734,7.0);
- }
- if(gTeam[playerid] == TEAM_BLUE && vehicleid == OBJECTIVE_VEHICLE)
- { // It's the objective vehicle
- SetPlayerColor(playerid,OBJECTIVE_COLOR);
- GameTextForPlayer(playerid,"~b~Blue Team Has The Ball!",5000,5);
- gObjectiveGreenPlayer = playerid;
- SetPlayerCheckpoint(playerid,1885.1376,-1204.1265,19.6797,7.0);
- }
- }
- else if(newstate == PLAYER_STATE_ONFOOT)
- {
- if(playerid == gObjectiveBluePlayer) {
- gObjectiveBluePlayer = (-1);
- SetPlayerToTeamColor(playerid);
- DisablePlayerCheckpoint(playerid);
- }
- if(playerid == gObjectiveGreenPlayer) {
- gObjectiveGreenPlayer = (-1);
- SetPlayerToTeamColor(playerid);
- DisablePlayerCheckpoint(playerid);
- }
- }
- switch (newstate) {
- case PLAYER_STATE_ONFOOT:
- {
- gPlayerCar[playerid] = -1;
- }
- case PLAYER_STATE_DRIVER:
- {
- gPlayerCar[playerid] = GetPlayerVehicleID(playerid);
- for(new i=0; i<MAX_PLAYERS; i++) {
- if (gPlayerCar[playerid] == gPlayerCar[i] && playerid != i) {
- RemovePlayerFromVehicle(i);
- GameTextForPlayer(i,"~r~You Got Jacked!!!",4000,1);
- }
- }
- }
- }
- return 1;
- }
- public SetPlayerTeamFromClass(playerid,classid)
- {
- // Set their team number based on the class they selected.
- if(classid == 0 || classid == 1) {
- gTeam[playerid] = TEAM_GREEN;
- } else if(classid == 2 || classid == 3) {
- gTeam[playerid] = TEAM_BLUE;
- }
- }
- public SetPlayerToTeamColor(playerid)
- {
- if(gTeam[playerid] == TEAM_BLUE) {
- SetPlayerColor(playerid,TEAM_BLUE_COLOR); // blue
- } else if(gTeam[playerid] == TEAM_GREEN) {
- SetPlayerColor(playerid,TEAM_GREEN_COLOR); // green
- }
- }
- public OnGameModeExit()
- {
- print("GameModeExit()");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- GameTextForPlayer(playerid,"~w~SA-MP:~g~GTA~w~:~r~Bombing Run",4000,5);
- SendPlayerFormattedText(playerid, "Welcome to GTA: Bombing Run, for help type /help.", 0);
- GivePlayerMoney(playerid, 500);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256];
- new idx;
- cmd = strtok(cmdtext, idx);
- if(strcmp(cmd, "/help", true) == 0) {
- SendPlayerFormattedText(playerid,"GTA:Bombing Run Coded By [xA]Ramjet and the SA-MP Team.",0);
- SendPlayerFormattedText(playerid,"Type: /objective : to find out what to do in this gamemode.",0);
- SendPlayerFormattedText(playerid,"Type: /taunt : to send taunts to people.",0);
- return 1;
- }
- if(strcmp(cmd, "/objective", true) == 0) {
- SendPlayerFormattedText(playerid,"The Objective of this gamemode is to steal the ball, which in",0);
- SendPlayerFormattedText(playerid,"this particular gamemode is a Bike. The first team to capture,",0);
- SendPlayerFormattedText(playerid,"the bike ten times wins.",0);
- return 1;
- }
- if(strcmp(cmd, "/taunt", true) == 0) {
- SendPlayerFormattedText(playerid,"1 - And Stay Down",0);
- SendPlayerFormattedText(playerid,"2 - Anyone Else Want Some?,",0);
- SendPlayerFormattedText(playerid,"3 - Burn BABY",0);
- SendPlayerFormattedText(playerid,"4 - BOOM!",0);
- SendPlayerFormattedText(playerid,"5 - Die Bitch",0);
- SendPlayerFormattedText(playerid,"6 - Duck Faster Next Time",0);
- SendPlayerFormattedText(playerid,"7 - Eat THAT",0);
- SendPlayerFormattedText(playerid,"8 - Hold Still Damnit",0);
- SendPlayerFormattedText(playerid,"9 - Holy Shit",0);
- return 1;
- }
- return 0;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerToTeamColor(playerid);
- SetVehicleParamsForPlayer(OBJECTIVE_VEHICLE,playerid,1,0);
- SetPlayerWorldBounds(playerid,2061.1836,1857.3367,-1141.2140,-1255.8501);
- GameTextForPlayer(playerid,"Capture The Bike And Put In In Goals",6000,5);
- if(gTeam[playerid] == TEAM_BLUE) {
- SetPlayerRandomSpawn(playerid);
- }
- else if(gTeam[playerid] == TEAM_GREEN) {
- SetPlayerRandomSpawn(playerid);
- }
- SetPlayerInterior(playerid,0);
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- new playervehicleid = GetPlayerVehicleID(playerid);
- if(gObjectiveReached) return;
- if(playervehicleid == OBJECTIVE_VEHICLE && gTeam[playerid] == TEAM_BLUE)
- { // Green OBJECTIVE REACHED.
- GameTextForAll("~b~Blue ~w~team has ~r~Scored~w~!!!",5000,5);
- gObjectiveReached = 1;
- SetPlayerScore(playerid,GetPlayerScore(playerid)+5);
- if (gBlueScore < GAME_ROUNDLIMIT) {
- gBlueScore++;
- RemovePlayerFromVehicle(playerid);
- SetPlayerColor(playerid, TEAM_BLUE_COLOR);
- SetVehicleToRespawn(OBJECTIVE_VEHICLE);
- gObjectiveReached = 0;
- }
- else if (gBlueScore == GAME_ROUNDLIMIT) {
- SetTimer("ExitTheGameMode", 4000, 0); // Set up a timer to exit this mode.
- }
- return;
- }
- else if(playervehicleid == OBJECTIVE_VEHICLE && gTeam[playerid] == TEAM_GREEN)
- { // Blue OBJECTIVE REACHED.
- GameTextForAll("~g~Green ~w~team has ~r~Scored~w~!!!",5000,5);
- gObjectiveReached = 1;
- SetPlayerScore(playerid,GetPlayerScore(playerid)+5);
- if (gGreenScore < GAME_ROUNDLIMIT) {
- gGreenScore++;
- RemovePlayerFromVehicle(playerid);
- SetPlayerColor(playerid, TEAM_GREEN_COLOR);
- SetVehicleToRespawn(OBJECTIVE_VEHICLE);
- gObjectiveReached = 0;
- }
- else if (gGreenScore == GAME_ROUNDLIMIT) {
- SetTimer("ExitTheGameMode", 4000, 0); // Set up a timer to exit this mode.
- }
- return;
- }
- }
- public ExitTheGameMode()
- {
- GameModeExit();
- }
- public SetPlayerRandomSpawn(playerid)
- {
- if(gTeam[playerid] == TEAM_GREEN) {
- new rand = random(sizeof(gTeam1RandomPlayerSpawns));
- SetPlayerPos(playerid, gTeam1RandomPlayerSpawns[rand][0], gTeam1RandomPlayerSpawns[rand][1], gTeam1RandomPlayerSpawns[rand][2]); // Warp the player
- }
- else if(gTeam[playerid] == TEAM_BLUE) {
- new rand = random(sizeof(gTeam2RandomPlayerSpawns));
- SetPlayerPos(playerid, gTeam2RandomPlayerSpawns[rand][0], gTeam2RandomPlayerSpawns[rand][1], gTeam2RandomPlayerSpawns[rand][2]); // Warp the player
- }
- return 1;
- }
- //------------------------------------------------------------------------------------------------------
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SendDeathMessage(killerid,playerid,reason);
- if(killerid == INVALID_PLAYER_ID) {
- SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
- } else {
- if(gTeam[killerid] != gTeam[playerid]) {
- // Valid kill
- SendDeathMessage(killerid,playerid,reason);
- SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
- }
- else {
- // Team kill
- SendDeathMessage(killerid,playerid,reason);
- SetPlayerHealth(killerid, 0.0);
- SendClientMessage(killerid, COLOR_RED, "You Have Been Punished For Teamkilling!!!");
- }
- }
- return 1;
- }
- //------------------------------------------------------------------------------------------------------
- public OnPlayerText(playerid, text[])
- {
- switch (text[0]){
- case '1':{
- GameTextForAll("~r~And Stay Down!", 2000, 4);
- return 0;
- }
- case '2':{
- GameTextForAll("~r~Anyone Else Want Some?", 2000, 4);
- return 0;
- }
- case '3':{
- GameTextForAll("~r~Burn BABY", 2000, 4);
- return 0;
- }
- case '4':{
- GameTextForAll("~r~BOOM!", 2000, 4);
- return 0;
- }
- case '5':{
- GameTextForAll("~r~Die Bitch", 2000, 4);
- return 0;
- }
- case '6':{
- GameTextForAll("~r~Duck Faster Next Time", 2000, 4);
- return 0;
- }
- case '7':{
- GameTextForAll("~r~Eat That", 2000, 4);
- return 0;
- }
- case '8':{
- GameTextForAll("~r~Hold Still Damnit", 2000, 4);
- return 0;
- }
- case '9':{
- GameTextForAll("~r~Holy Shit", 2000, 4);
- return 0;
- }
- }
- return 1;
- }
- //------------------------------------------------------------------------------------------------------
- public SetupPlayerForClassSelection(playerid)
- {
- SetPlayerPos(playerid,1969.4491,-1157.4449,20.9622);
- SetPlayerFacingAngle(playerid, 92.3617);
- SetPlayerCameraPos(playerid,1963.7303,-1157.4513,20.9621);
- SetPlayerCameraLookAt(playerid,1969.4491,-1157.4449,20.9622);
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetupPlayerForClassSelection(playerid);
- SetPlayerTeamFromClass(playerid,classid);
- if(classid == 0 || classid == 1) {
- GameTextForPlayer(playerid,"~g~GREEN ~w~TEAM",1000,5);
- } else if(classid == 2 || classid == 3) {
- GameTextForPlayer(playerid,"~b~BLUE ~w~TEAM",1000,5);
- }
- return 1;
- }
- public OnGameModeInit()
- {
- SetGameModeText("GTA: Bombing Run!");
- ShowPlayerMarkers(1);
- ShowNameTags(1);
- // Player Class's
- AddPlayerClass(45,1958.3783,1343.1572,15.3746,269.1425,0,0,31,400,29,400);
- AddPlayerClass(101,1958.3783,1343.1572,15.3746,269.1425,0,0,31,400,29,400);
- AddPlayerClass(44,1958.3783,1343.1572,15.3746,269.1425,0,0,31,400,29,400);
- AddPlayerClass(79,1958.3783,1343.1572,15.3746,269.1425,0,0,31,400,29,400);
- //The Ball
- AddStaticVehicle(509,1969.6045,-1188.2485,25.3040,183.7018,3,0);
- return 1;
- }
- public SendPlayerFormattedText(playerid, const str[], define)
- {
- new tmpbuf[256];
- format(tmpbuf, sizeof(tmpbuf), str, define);
- SendClientMessage(playerid, 0xFFFF00AA, tmpbuf);
- }
- public SendAllFormattedText(playerid, const str[], define)
- {
- new tmpbuf[256];
- format(tmpbuf, sizeof(tmpbuf), str, define);
- SendClientMessageToAll(0xFFFF00AA, tmpbuf);
- }
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.