// SniperAndDeagle Fight GM 0.1 // Coded by Chiarboss // ©2007 // Dont edit code or part of it without my permission // To get permission contact: marco.chiarelli@hotmail.it #include #pragma tabsize 0 new score1=0; new score2=0; enum PickupSpawnInfo { Float:PickupX, Float:PickupY, Float:PickupZ } enum PInfo{gTeam,class} new PlayerInfo[MAX_PLAYERS][PInfo]; #define TEAM_1 1 #define TEAM_2 2 #define TEAM_3 3 #define COLOR_RED 0xAA3333AA #define COLOR_GREY 0xAFAFAFAA #define COLOR_GREEN 0x33AA33AA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_BLUE 0x1111AAFF #define COLOR_PINK 0xFF66FFAA #define COLOR_LIGHTBLUE 0x33CCFFAA #define COLOR_DARKRED 0x660000AA #define COLOR_ORANGE 0xFF9900AA new UsePlayerPedAnimsEx=1,CameraControl=1,AdmCmd=0; new Float:gMap0[][4]={{2653.6177,2699.5452,19.3222,357.0792}, {2654.4541,2756.5874,19.3222,359.8993}, {2649.3098,2778.6165,19.3222,178.4776}, {2656.3977,2720.2966,19.3222,178.1643}}; new Float:gMap1[][4]={{2585.1531,2825.4797,27.8203,270.2851}, {2614.3735,2825.4641,27.8203,270.2851}, {2543.7920,2804.4189,27.8203,90.7668}, {2543.6899,2846.5703,27.8203,0.2126}}; new Float:gMap2[][4]={{2644.8828,2725.5647,23.8222,182.4684}, {2610.2295,2727.7295,36.5386,179.3116}, {2620.5757,2778.0261,23.8222,181.8417}, {2602.4526,2721.2402,25.8222,179.9617}}; new Float:gMap3[][4]={{2563.1934,2687.4331,22.9507,0.2387}, {2583.5452,2721.0745,22.9507,359.6119}, {2583.0959,2686.0825,22.9507,358.6719}, {2563.0083,2720.5132,22.9507,357.7319}}; new Float:gMap4[][4]={{2678.9963,2731.0764,19.0722,359.7485}, {2694.3757,2758.0808,19.0722,359.1218}, {2693.9392,2731.0591,19.0722,0.3751}, {2678.2969,2757.0691,19.0722,0.6885}}; new Float:gMap5[][4]={{2633.8818,2812.1548,36.3222,265.4603}, {2626.6284,2826.2056,36.3222,3.2212}, {2706.3015,2822.0974,36.3222,91.8719}, {2713.4214,2808.4314,36.3222,266.8586}}; new Float:gMap6[][4]={{2683.7361,2679.6985,22.9472,0.9122}, {2702.8184,2713.0776,22.9472,357.4655}, {2701.9470,2679.2290,22.9472,0.2621}, {2682.5295,2712.6245,22.9472,359.0088}}; new Float:gRandomSpawnsEx[][4]={{2656.4602,2646.9656,2781.9980,2695.8660}, {2616.6379,2538.9006,2851.3113,2802.9160}, {2645.9099,2594.3213,2782.0325,2695.8977}, {2583.9895,2561.9280,2722.5430,2685.4414}, {2695.4387,2677.7463,2760.3230,2730.4104}, {2714.9966,2625.3040,2827.9602,2806.4563}, {2703.8540,2681.6892,2715.3811,2677.9604}}; new Float:gRandomSpawns[][3]={{2555.9219,2832.5396,19.9922}, {2647.6680,2804.6726,10.8203}, {2510.7112,2849.9841,14.8222}, {2510.6958,2849.3123,14.8222}, {2647.7263,2804.6797,10.8203}, {2498.6592,2782.2397,10.8203}, {2672.4756,2792.0962,10.8203}, {2613.7029,2848.2712,19.9922}, {2522.1770,2815.0620,24.9536}, {2546.2788,2839.1575,10.8203}, {2611.5269,2845.3994,16.7020}, {2556.6067,2832.4768,19.9999}, {2561.9304,2848.1982,19.9922}, {2673.0364,2800.3350,10.8203}, {2614.0637,2848.7727,19.9922}}; new Float:gMinigunPickups[][PickupSpawnInfo] ={{2629.6345, 2732.8936, 36.5386}, {2635.4575, 2767.9346, 25.8222}, {2685.5012, 2746.6240, 20.3222}, {2668.6201, 2767.9753, 17.6896}, {2553.7502, 2754.9238, 10.8203}, {2524.9805, 2817.3428, 10.8203}, {2564.5159, 2823.4812, 12.7568}, {2594.1836, 2821.1226, 12.7647}, {2601.4983, 2769.2195, 25.8222}}; new Float:gSpec[][6]={{2594.2532,2771.8965,23.8222,2549.7339,2777.4407,10.8203}, {2545.8743,2806.3206,19.9922,2573.6655,2825.8774,10.8203}, {2679.6638,2731.6702,19.0722,2645.1572,2751.2966,23.8222}, {2639.2075,2782.0564,23.8222,2623.3687,2797.2498,10.8203}, {2561.8582,2690.6584,23.9507,2534.6184,2688.9778,10.8203}, {2646.0430,2695.7583,25.8222,2676.3088,2673.3342,10.8203}, {2661.2891,2806.6650,36.3222,2651.7915,2770.2126,19.3222}}; new gWeapons[]={24,34,-1}; new Menu:gMenu,Menu:soc,Menu:nt,Menu:pm,Menu:jd,Menu:spec,Menu:mr,team1[256]="Team 1",team2[256]="Team 2",players=0,spawned[MAX_PLAYERS],cw=0,/*incw[MAX_PLAYERS]=0,*/playersex=0,socdelay=60000,soctimer=0,jod=1,rounds=1,maxrounds=15,map=0,specex=1,death[MAX_PLAYERS]=0,rand=0,HighestScore,HighestScorers[MAX_PLAYERS]; new mutedall=0,freezedall=0,mute[MAX_PLAYERS],freezed[MAX_PLAYERS]; forward Soc();forward SetupForRounds();forward Winners();forward BestKiller(); main() { print("\n----------------------------------"); print(" Chiarboss's SniperAndDeagle Fight\n"); print("----------------------------------\n"); } public OnGameModeInit() { if(UsePlayerPedAnimsEx==1)UsePlayerPedAnims(); SetGameModeText("SniperAndDeagle Fight GM 0.1"); AddPlayerClass(0,0.0,0.0,0.0,0.0,34,999999,0,0,0,0); AddPlayerClass(0,0.0,0.0,0.0,0.0,24,999999,0,0,0,0); AddPlayerClass(0,0.0,0.0,0.0,0.0,34,999999,0,0,0,0); AddPlayerClass(0,0.0,0.0,0.0,0.0,24,999999,0,0,0,0); AddPlayerClass(264,0.0,0.0,0.0,0.0,38,500,43,1,0,0); SetWorldTime(12); gMenu=CreateMenu("SniperAndDeagle Fight",2, 200.0, 125.0, 220.0, 50.0); nt = CreateMenu("Name Tags",2, 200.0, 125.0, 220.0, 50.0); pm = CreateMenu("Player Mrkrs",2, 200.0, 125.0, 220.0, 50.0); jd = CreateMenu("JDMessages",2, 200.0, 125.0, 220.0, 50.0); spec = CreateMenu("Spectate Mode",2, 200.0, 125.0, 220.0, 50.0); mr = CreateMenu("Max Rounds",2, 200.0, 125.0, 220.0, 50.0); soc = CreateMenu("StopOnCrash",2, 200.0, 125.0, 220.0, 50.0); AddMenuItem(gMenu,0,"Start CW"),AddMenuItem(gMenu,0,"Stop CW"),AddMenuItem(gMenu,0,"Reset Game"); AddMenuItem(gMenu,0,"Max Rounds"),AddMenuItem(gMenu,0,"Name Tags"),AddMenuItem(gMenu,0,"Player Mrkrs"),AddMenuItem(gMenu,0,"JDMessages"),AddMenuItem(gMenu,0,"Spectate Mode"),AddMenuItem(gMenu,0,"StopOnCrash"),AddMenuItem(gMenu,0,"Ped Anims"); AddMenuItem(nt,0,"On"),AddMenuItem(nt,0,"Off"),AddMenuItem(pm,0,"On"),AddMenuItem(pm,0,"Off"),AddMenuItem(spec,0,"On"),AddMenuItem(spec,0,"Off"),AddMenuItem(jd,0,"On"),AddMenuItem(jd,0,"Off"),AddMenuItem(soc,0,"On"),AddMenuItem(soc,0,"Off"); AddMenuItem(mr,0,"15"),AddMenuItem(mr,0,"20");new randX=random(sizeof(gWeapons)); for(new i = 0, j = sizeof(gMinigunPickups); i < j; i++)AddStaticPickup(gWeapons[randX],15,gMinigunPickups[i][PickupX],gMinigunPickups[i][PickupY],gMinigunPickups[i][PickupZ]); return 1; } stock Control() { new counta,countb; for(new i=0;i<=playersex;i++) { switch(PlayerInfo[i][gTeam]) { case 1:counta++; case 2:countb++; } } if(counta>countb||countb ' ') && ((index - offset) < (sizeof (result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; } public SetupForRounds() { map=random(7); for(new i=0; i<=playersex; i++) { TogglePlayerControllable(i,1),ResetPlayerWeapons(i),SetCameraBehindPlayer(i),SpawnPlayer(i); if(spawned[i] == 1)players++; } return 1; } public Winners() { new string[256]; format(string,sizeof(string),"~b~%s ~y~%s~n~~w~%d %d",team1,team2,score1,score2); GameTextForAll(string,5000,6); SetTimer("BestKiller",10000,0); return 1; } stock CheckPlayerScore(){ new score; new numberscorers; for (new playerid = 0; playerid HighestScore){ for (new i=0; i 0){ HighestScorers[numberscorers]=playerid; numberscorers++; } score=0; } } } return numberscorers; } //------------------------------------------------------------------------- //In the routine where you make the call for the highest score: public BestKiller(){ new numberscorers=CheckPlayerScore(); //not sure if the () should be attached new giveplayername[MAX_PLAYER_NAME]; new string[256]; for (new i=0; i 0){ for (new i=0; imaxrounds)return format(string,sizeof(string),"Syntax Error. <1-%d>",maxrounds),SendClientMessage(playerid,COLOR_RED,string); format(string,sizeof(string),"GAMEMODE: C.R. setted to %d",strval(tmp)),SendClientMessageToAll(COLOR_GREEN,string); rounds=strval(tmp),SetupForRounds(); }else{SendClientMessage(playerid,COLOR_RED,"You arent admin!!!");} return 1;} if(AdmCmd==1) { if(strcmp(cmd,"/goto",true) == 0) { if(IsPlayerAdmin(playerid) == 1) { new playername[MAX_PLAYER_NAME]; new name[MAX_PLAYER_NAME]; new tmp[256]; new pid; new Float:plx; new Float:ply; new Float:plz; tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid,0xFF8A00AA,"Usage: /goto [playerid]"); return 1; } pid = strval(tmp); if(pid != INVALID_PLAYER_ID) { GetPlayerName(pid,playername,sizeof(playername)); GetPlayerName(playerid,name, sizeof(name)); GetPlayerPos(pid, plx, ply, plz); if (IsPlayerInAnyVehicle(playerid) == 0) { SetPlayerPos(playerid, plx, ply, plz); } else { SetVehiclePos(GetPlayerVehicleID(playerid),plx,ply,plz); LinkVehicleToInterior(GetPlayerVehicleID(pid),GetPlayerInterior(playerid)); } SetPlayerInterior(pid,GetPlayerInterior(playerid)); format(string,sizeof(string),"%s has warped to %s .",name,playername); SendClientMessageToAll(0xFF8A00AA,string); }else{SendClientMessage(playerid,COLOR_RED,"This is an invalid playerID. Press TAB for see the all valids playerID");} } else { SendClientMessage(playerid,COLOR_RED,"You arent admin!!!"); } return 1; } if(strcmp(cmd,"/gethere",true) == 0) { if(IsPlayerAdmin(playerid) == 1) { new playername[MAX_PLAYER_NAME]; new name[MAX_PLAYER_NAME]; new tmp[256]; new pid; new Float:plx; new Float:ply; new Float:plz; tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid,0xFF8A00AA,"Usage: /gethere [playerid]"); return 1; } pid = strval(tmp); if(pid != INVALID_PLAYER_ID) { GetPlayerName(pid,playername,sizeof(playername)); GetPlayerName(playerid,name, sizeof(name)); GetPlayerPos(playerid, plx, ply, plz); if (IsPlayerInAnyVehicle(pid) == 0) { SetPlayerPos(pid, plx, ply, plz); } else { SetVehiclePos(GetPlayerVehicleID(pid),plx,ply,plz); LinkVehicleToInterior(GetPlayerVehicleID(pid),GetPlayerInterior(playerid)); } SetPlayerInterior(pid,GetPlayerInterior(playerid)); format(string,sizeof(string),"%s has teleported to him %s .",name,playername); SendClientMessageToAll(0xFF8A00AA,string); }else{SendClientMessage(playerid,COLOR_RED,"This is an invalid playerID. Press TAB for see the all valids playerID");} } else { SendClientMessage(playerid,COLOR_RED,"You arent admin!!!"); } return 1; } if(strcmp(cmd,"/freeze",true) == 0) { if(IsPlayerAdmin(playerid)) { new name[MAX_PLAYER_NAME],tmp[256],pid,playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { if(freezedall == 0){format(string,sizeof(string),"The Admin %s has freezed all players connected.",name);freezedall=1;for(new i=0;i<=playersex;i++)TogglePlayerControllable(i,0);}else{format(string,sizeof(string),"The Admin %s has unfreezed all players connected.",name);freezedall=0;for(new i=0;i<=playersex;i++)TogglePlayerControllable(i,1);} SendClientMessageToAll(0xFF8A00AA,string); return 1; } pid = strval(tmp); GetPlayerName(pid,playername,sizeof(playername)); if(pid == playerid) { SendClientMessage(playerid,COLOR_RED,"You cannot freeze yourself!"); return 1; } if(pid != INVALID_PLAYER_ID) { if(freezed[pid] == 0){freezed[pid]=1;TogglePlayerControllable(pid,0);format(string,sizeof(string),"The Admin %s has freezed %s",name,playername);}else{ freezed[pid] = 0;TogglePlayerControllable(pid,1);format(string,sizeof(string),"The Admin %s has unfreezed %s",name,playername); } SendClientMessageToAll(0xFF8A00AA,string); }else{SendClientMessage(playerid,COLOR_RED,"This is an invalid playerID. Press TAB for see the all valids playerID");} } else { SendClientMessage(playerid,COLOR_RED,"You arent admin!!!"); } return 1; } if(strcmp(cmd,"/mute",true)==0) { if(IsPlayerAdmin(playerid)) { new name[MAX_PLAYER_NAME],tmp[256],pid,playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { if(mutedall == 0){format(string,sizeof(string),"The Admin %s has muted all players connected.",name);mutedall=1;for(new i=0;i<=playersex;i++)mute[i]=1;}else{format(string,sizeof(string),"The Admin %s has unmuted all players connected.",name);mutedall=0;for(new i=0;i<=playersex;i++)mute[i]=0;} SendClientMessageToAll(0xFF8A00AA,string); return 1; } pid = strval(tmp); if(pid == playerid) { SendClientMessage(playerid,COLOR_RED,"You cannot mute yourself!"); return 1; } if(pid != INVALID_PLAYER_ID) { if(mute[pid] == 0){mute[pid]=1;format(string,sizeof(string),"The Admin %s has muted %s",name,playername);}else{ mute[pid] = 0;format(string,sizeof(string),"The Admin %s has unmuted %s",name,playername); } SendClientMessageToAll(0xFF8A00AA,string); }else{SendClientMessage(playerid,COLOR_RED,"This is an invalid playerID. Press TAB for see the all valids playerID");} } else { SendClientMessage(playerid,COLOR_RED,"You arent admin!!!"); } return 1; } }else{return SendClientMessage(playerid,COLOR_RED,"Administration system is disabled.");} return 0;}