/* ×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××× × Sniper Elite × × By: [X2G]Sneaky × ×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××*/ #include #pragma tabsize 0 #define TEAM_1 0 #define TEAM_2 1 #define COLOR_YELLOW 0x33AA33AA #define COLOR_BASEBALL 0xAA3333AA #define G 0xC3C3C3FF #define COLOR_GRAD1 0xB4B5B7FF #define COLOR_WHITE 0xFFFFFFAA new gTeam[MAX_PLAYERS]; new gPlayerClass[MAX_PLAYERS]; new YoMomma[MAX_PLAYERS]; new BALLZ,TITS; new SEX; new msv[256]; new cdt=-1; new timer; new Team[MAX_PLAYERS]; new delay=1000; forward Score(); forward count1(); forward SetupPlayerForClassSelection(playerid); forward SetTeamFromClass(playerid, classid); forward SetTeamToColor(playerid); new Float:gRandomt1PlayerSpawns[3][4] = { {322.3492,870.4527,20.3990}, {320.6684,873.0169,20.3990}, {323.7792,867.0750,20.4063} }; new Float:gRandomt2PlayerSpawns[3][4] = { {832.4816,866.0623,12.6722}, {834.4856,868.3402,12.8827}, {835.6846,865.6111,12.8717} }; main() { print("\n----------------------------------"); print(" Sniper Elite - By: [X2G]Sneaky"); print("----------------------------------\n"); } public OnGameModeInit() { SetGameModeText("Sniper Elite"); ShowNameTags(1); ShowPlayerMarkers(1); SetWorldTime(0); SetTimer("Score",100,1); SEX = 0; SetTeamCount(2); UsePlayerPedAnims(); AddPlayerClass(195,1410.6829,2111.6638,12.0220,358.9967,0,0,0,0 ,0,0); AddPlayerClass(199,1310.6882,2211.8193,12.0156,270.2545,0,0,0,0 ,0,0); return 1; } public Score() { new string[256]; if(SEX == 1){} if(SEX == 0){ format(string,sizeof(string)," ~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~ team1: ~h~ ~w~ %d ~b~ team2: ~h~ ~w~ %d",TITS,BALLZ); GameTextForAll(string,850,3);} if(BALLZ == 50) { GameTextForAll("~r~Team 1 Wins!",5000,0); for(new i = 0; i < MAX_PLAYERS; i++) { if(Team[i] == TEAM_1) YoMomma[i] = 2; SpawnPlayer(i); TogglePlayerControllable(i,0);} BALLZ = 0; BALLZ = 0; TITS = 0; TITS = 0; {cdt=6;timer=SetTimer("count1",delay,1);}} if(TITS == 50) { GameTextForAll("~r~Team 1 Wins!!",5000,0); for(new i = 0; i < MAX_PLAYERS; i++){ if(Team[i] == TEAM_2) YoMomma[i] = 2; SpawnPlayer(i); TogglePlayerControllable(i,0);} TITS = 0; TITS = 0; BALLZ = 0; BALLZ = 0; {cdt=6;timer=SetTimer("count1",delay,1); }}} public count1() { SEX = 1; if(cdt==6) {GameTextForAll("~y~Starting",1000,6);} else if (cdt>=5) {format(msv,sizeof(msv),"%d",cdt); for(new i = 0; i < MAX_PLAYERS; i++) { GameTextForAll("~r~5",1000,6); PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);}} else if (cdt>=4) {format(msv,sizeof(msv),"%d",cdt); for(new i = 0; i < MAX_PLAYERS; i++) { GameTextForAll("~r~4",1000,6); PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);}} else if (cdt>=3) {format(msv,sizeof(msv),"%d",cdt); for(new i = 0; i < MAX_PLAYERS; i++) { GameTextForAll("~y~3",1000,6); PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);}} else if (cdt>=2) {format(msv,sizeof(msv),"%d",cdt); for(new i = 0; i < MAX_PLAYERS; i++) { GameTextForAll("~y~2",1000,6); PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);}} else if (cdt>=1) {format(msv,sizeof(msv),"%d",cdt); for(new i = 0; i < MAX_PLAYERS; i++) { GameTextForAll("~g~1",1000,6); PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);}} else if (cdt==0){ GameTextForAll("F I G H T",1000,6); SEX = 0; SEX = 0; for(new i = 0; i < MAX_PLAYERS; i++) { TogglePlayerControllable(i,1); PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0); SetPlayerHealth(i,100);}} cdt--; if (cdt==-1){KillTimer(timer); }} public OnPlayerRequestClass(playerid, classid) { SetTeamFromClass(playerid, classid); SetupPlayerForClassSelection(playerid); gPlayerClass[playerid] = classid; switch (classid) { case 0:{GameTextForPlayer(playerid, "~y~team 1", 1000, 3);} case 1:{GameTextForPlayer(playerid, "~b~team 2", 1000, 3);}} return 1; } public SetupPlayerForClassSelection(playerid) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid, -878.2040,-2285.7019,30.9392); SetPlayerCameraPos(playerid, -874.9014,-2287.0837,29.9809); SetPlayerCameraLookAt(playerid, -878.2040,-2285.7019,30.9392); SetPlayerFacingAngle(playerid, 240.5105); return 1; } public SetTeamFromClass(playerid, classid) { if(classid == 0){ gTeam[playerid] = TEAM_1; }else if(classid == 1){ gTeam[playerid] = TEAM_2; }} public SetTeamToColor(playerid){ if(gTeam[playerid] == TEAM_1) { SetPlayerColor(playerid,COLOR_YELLOW); }else if(gTeam[playerid] == TEAM_2){ SetPlayerColor(playerid,COLOR_BASEBALL); }} public OnPlayerConnect(playerid) { new Text:poop; poop = TextDrawCreate(100.0, 10.0,"Sniper Elite Biatch! first team to 50 killz"); TextDrawUseBox(poop, 1); TextDrawBoxColor(poop, 0x000000AA); TextDrawFont(poop, 2); TextDrawSetShadow(poop,0); TextDrawSetOutline(poop,1); TextDrawBackgroundColor(poop,0x000000FF); TextDrawColor(poop,0xE9070DFF); TextDrawShowForPlayer(playerid, poop); SEX = 1; return 1; } public OnPlayerSpawn(playerid) { SEX = 0; SetTeamToColor(playerid); SetPlayerInterior(playerid,0); if(gTeam[playerid] == TEAM_1) { new rand = random(sizeof(gRandomt1PlayerSpawns)); SetPlayerPos(playerid, gRandomt1PlayerSpawns[rand][0], gRandomt1PlayerSpawns[rand][1], gRandomt1PlayerSpawns[rand][2]); GivePlayerWeapon(playerid,34,99999999); GivePlayerWeapon(playerid,4,99999999); } if(gTeam[playerid] == TEAM_2) { new rand = random(sizeof(gRandomt2PlayerSpawns)); SetPlayerPos(playerid, gRandomt2PlayerSpawns[rand][0], gRandomt2PlayerSpawns[rand][1], gRandomt2PlayerSpawns[rand][2]); GivePlayerWeapon(playerid,34,99999999); GivePlayerWeapon(playerid,4,99999999); } return 1; } public OnPlayerDeath(playerid, killerid, reason) { new Float:slx, Float:sly, Float:slz; YoMomma[playerid] = 1; if(killerid == INVALID_PLAYER_ID) { SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);} else{if(gTeam[killerid] != gTeam[playerid]){ SendDeathMessage(killerid,playerid,reason); if(gTeam[playerid] == TEAM_1) { BALLZ = BALLZ + 1;} else if(gTeam[playerid] == TEAM_2) { TITS = TITS + 1;} SetPlayerScore(killerid,GetPlayerScore(killerid)+1); }else{ SendDeathMessage(killerid,playerid,reason); SetPlayerScore(killerid, GetPlayerScore(killerid) -1); GetPlayerPos(killerid, slx, sly, slz); SetPlayerPos(killerid, slx, sly, slz+5); PlayerPlaySound(killerid, 1130, slx, sly, slz+100); SendClientMessage(killerid,COLOR_YELLOW,"NO TEAMKILLING!"); if(gTeam[killerid] == TEAM_1) { BALLZ = BALLZ + 1;} else if(gTeam[killerid] == TEAM_2){ TITS = TITS + 1;}}} return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256]; new idx; cmd = strtok(cmdtext, idx); if (strcmp(cmd, "/kill", true)==0){SetPlayerHealth(playerid, 0);return 1;} if(strcmp(cmd, "/help", true) == 0 && IsPlayerConnected(playerid)) { SendClientMessage(playerid, COLOR_WHITE, "[-----> Sniper Elite <-----]"); SendClientMessage(playerid, COLOR_GRAD1, "HELP: This mod is al about being the sneakiest motherfucker around"); SendClientMessage(playerid, COLOR_GRAD1, "HELP: You can hide yourself using the commands below, when you"); SendClientMessage(playerid, COLOR_GRAD1, "HELP: reached 25 kills you win the round"); SendClientMessage(playerid, COLOR_GRAD1, "CMDS: Use /bush1-2 to place a bush so you can hide behind it"); SendClientMessage(playerid, COLOR_GRAD1, "CMDS: Use /barrel to place a barrel so you can shoot it later"); return 1; } if(strcmp(cmd, "/bush1", true) == 0 && IsPlayerConnected(playerid)) { new Float:dx, Float:dy, Float:dz; GetPlayerPos(playerid, dx, dy, dz); new tree = CreateObject(647, dx, dy, dz, 0.00, 0.00, 0.00); AttachObjectToPlayer(tree, playerid, 0.0,0.0,3.5,0.0,0.0,0.0); return 1; } if(strcmp(cmd, "/chicken", true) == 0 && IsPlayerConnected(playerid)) { new Float:dx, Float:dy, Float:dz; GetPlayerPos(playerid, dx, dy, dz); new chicken = CreateObject(16776, dx, dy, dz, 0.00, 0.00, 0.00); AttachObjectToPlayer(chicken, playerid, 0.0,0.0,3.5,0.0,0.0,0.0); return 1; } if(strcmp(cmd, "/bush2", true) == 0 && IsPlayerConnected(playerid)) { new Float:dx, Float:dy, Float:dz; GetPlayerPos(playerid, dx, dy, dz); CreateObject(800, dx, dy, dz, 0.00, 0.00, 0.00); return 1; } if(strcmp(cmd, "/barrel", true) == 0 && IsPlayerConnected(playerid)) { new Float:dx, Float:dy, Float:dz; GetPlayerPos(playerid, dx, dy, dz); CreateObject(1225, dx, dy, dz, 0.00, 0.00, 0.00); return 1; } return 0; } 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; }