#include #include #include //Color Defines #define COLOR_RED 0xAA3333AA #define COLOR_GREEN 0x33AA33AA #define COLOR_BLUE 0x0000BBAA #define COLOR_DARKRED 0x660000AA #define COLOR_LIGHTBLUE 0x33CCFFAA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_GREY 0xAFAFAFAA //Team Defines #define TEAM_1 0 #define TEAM_2 1 #define TEAM_REF 2 #define MAX_STRING 255 new gTeam[MAX_PLAYERS]; new gPlayerClass[MAX_PLAYERS]; new tkscore[MAX_PLAYERS]; new TEAM1[256], TEAM2[256], MAXKILLS; new wpn1, wpn2, wpn3; new ammo1, ammo2, ammo3; new DeathCount[MAX_PLAYERS]; new sCount1, sCount2; new winner[256]; //new astring[256]; new aAutoS; //------------------------------------------------------------------------------ main() { print("\n----------------------------------"); print(" ClanBattle: v1.0 "); print("----------------------------------\n"); print("Loading Config......\n"); printf(" | %s VS %s | ",TEAM1, TEAM2); printf(" |First Clan to %d Kills",MAXKILLS); // if(aAutoS > 0){ print(" |Auto-Clan-Detection [Activated]\n"); }else{ print(" |Auto-Clan-Detection [Disabled]\n");} } //------------------------------------------------------------------------------ public OnGameModeInit() { SetGameModeText("[HC4L] VS [HC4L]"); SetTeamCount(3); ShowNameTags(1); ShowPlayerMarkers(1); SetWorldTime(1); rConfig(); UsePlayerPedAnims(); AddPlayerClass(299,1410.8242,2102.9089,12.0156,352.7742,wpn1,ammo1,wpn2,ammo2,wpn3,ammo3); // Team1 spawn if(aAutoS == 0){ AddPlayerClass(105,1306.5330,2211.8743,12.0156,270.3902,wpn1,ammo1,wpn2,ammo2,wpn3,ammo3); // Team2 spawn AddPlayerClass(21,1368.5774,2196.8315,9.7578,176.8027,43,500,0,0,0,0); //Ref spawn } return 1; } //------------------------------------------------------------------------------ public OnPlayerConnect(playerid) { new wString[256]; SendClientMessage(playerid, COLOR_GREEN, "Welcome to ClanBattle v1.0"); SendClientMessage(playerid, COLOR_GREEN, "Type an ! before your message to talk to the team"); format(wString, sizeof(wString), " %s vs %s || First Clan to %d Kills", TEAM1, TEAM2, MAXKILLS); SetPlayerArmour(playerid, 100); SendClientMessage(playerid, COLOR_GREEN, wString); SetPlayerColor(playerid, COLOR_GREY); gTeam[playerid] = ClanDetect(playerid); return 1; } public OnPlayerDisconnect(playerid) { tkscore[playerid] = 0; return 1; } //------------------------------------------------------------------------------ public OnPlayerSpawn(playerid) { SetPlayerInterior(playerid,0); if(gTeam[playerid] == TEAM_1) { SetPlayerColor(playerid,COLOR_RED);// Red SetPlayerArmour(playerid, 100); } else if(gTeam[playerid] == TEAM_2) { SetPlayerColor(playerid,COLOR_BLUE); // Blue SetPlayerArmour(playerid, 100); } else if(gTeam[playerid] == TEAM_REF) { SetPlayerColor(playerid,COLOR_LIGHTBLUE); // Light Blue SetPlayerArmour(playerid, 100); } if(aAutoS == 1) // AUTO SPAWN IMPLEMENTATION { if(gTeam[playerid] == TEAM_1) { SetPlayerPos(playerid,1410.8242,2102.9089,12.0156,352.7742); SetPlayerFacingAngle(playerid, 270); SetPlayerSkin(playerid, 105); return 1; } else if(gTeam[playerid] == TEAM_2) { SetPlayerPos(playerid,1306.5330,2211.8743,12.0156,270.3902); SetPlayerFacingAngle(playerid, 90); SetPlayerSkin(playerid, 299); return 1; } else if(gTeam[playerid] == TEAM_REF) { SetPlayerPos(playerid,1368.5774,2196.8315,9.7578,176.8027); SetPlayerFacingAngle(playerid, 90); SetPlayerSkin(playerid, 21); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 43,500); return 1; } } return 1; } public SetupPlayerForClassSelection(playerid) // CHANGE ALL { SetPlayerInterior(playerid, 0); SetPlayerPos(playerid,1410.5830,2109.2654,12.0156); SetPlayerFacingAngle(playerid, 90); SetPlayerCameraPos(playerid,1368.5774,2196.8315,9.7578,176.8027); SetPlayerCameraLookAt(playerid,1368.5774,2196.8315,9.7578,176.8027); return 1; } //------------------------------------------------------------------------------ public OnPlayerDeath(playerid, killerid, reason) { if(gTeam[killerid] != gTeam[playerid]) { SendDeathMessage(killerid,playerid,reason); SetPlayerScore(killerid,GetPlayerScore(killerid)+1); } else { new warning[256]; format(warning, sizeof(warning), "Be careful! Do Not Team-Kill"); SendClientMessage(killerid, 0xFFFF00AA, warning); SendDeathMessage(killerid,playerid,reason); SetPlayerScore(killerid, GetPlayerScore(killerid) - 1); tkscore[playerid]++; return 1; } new string[256], string2[256], string3[256], gtstring[256]; DeathCount[playerid]++; if(killerid == INVALID_PLAYER_ID) { SendDeathMessage(INVALID_PLAYER_ID,playerid,reason); SetPlayerScore(playerid, GetPlayerScore(playerid)-1); } if(IsPlayerConnected(killerid)) { if(gTeam[killerid] == TEAM_1) { sCount1++; format(string2, sizeof(string2), "%s Score: %d", TEAM1, sCount1); SendClientMessageToAllEx(COLOR_YELLOW, string2); for(new z=0;z ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; } stock SendClientMessageToAllEx(color,msg[]) { SendClientMessageToAll(color,msg); CallRemoteFunction("explain", "s", msg); }