Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:attack(playerid, params[])
- {
- if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
- if(!IsAGangMember(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu faci parte dintr-un gang!");
- if(!CanStartWar) return SendClientMessage(playerid, COLOR_ERROR, "Warurile sunt dezactivate acum!");
- if(PlayerInfo[playerid][pRank] < 5) return SendClientMessage(playerid, COLOR_ERROR, "Ai nevoie de rank 5 sau mai mare pentru a ataca o zona!");
- new whour , wminute, wsecond;
- gettime(whour, wminute, wsecond);
- /*new day, month, year;
- getdate(year, month, day);
- if(strmatch(GetWeekDay(day, month, year), "Sunday") || strmatch(GetWeekDay(day, month, year), "Saturday")) return SendClientMessage(playerid, COLOR_ERROR, "You can't start a war in weekend."); */
- if(whour < 1 || whour > 22) return SendClientMessage(playerid, COLOR_ERROR, "Razboaiele pot fi date doar in intervalul 14:00 - 22:00");
- new zone = GetPlayerZone(playerid);
- new member = PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader];
- if(zone == -1) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti intr-o zona!");
- if(ZoneInfo[zone][zTeam] < 1) return SendClientMessage(playerid, COLOR_ERROR, "Trebuie sa fii intr-o zona ca sa poti ataca!");
- if(WarPause[member] > gettime())
- {
- format(gString, sizeof(gString), "Trebuie sa mai astepti %d secunde. (Cooldown)", WarPause[member]-gettime());
- SendClientMessage(playerid, COLOR_ERROR, gString);
- return 1;
- }
- if(ZoneInfo[zone][zHours] > 0) return SendClientMessage(playerid, COLOR_ERROR, "Nu poti sa ataci zona acum!");
- if(ZoneInfo[zone][zTeam] == member) return SendClientMessage(playerid, COLOR_ERROR, "Nu poti sa iti ataci propria zona!");
- if(TakeON[zone]) return SendClientMessage(playerid, COLOR_ERROR, "Aceasta zona este deja ataca de cineva!");
- if(InWar[ZoneInfo[zone][zTeam]] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Gang-ul provocat este prezent deja intr-un war!");
- if(InWar[member] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Gang-ul tau are deja un war in desfasurare!");
- if(War == 1) return SendClientMessage(playerid, COLOR_ERROR, "Este deja un war in progres!");
- if(War == 0)
- {
- Attackers = member;
- Defenders = ZoneInfo[zone][zTeam];
- format(gString, sizeof(gString), "[WAR]: %s (%s) v-a atacat teritoriul cu numarul %d",FactionName[Attackers],GetName(playerid),zone);
- SendFactionMessage(Defenders, COLOR_WAR, gString);
- format(gString, sizeof(gString), "[WAR]: Gang-ul tau (%s) a atacat teritoriul cu numarul %d detinut de %s",GetName(playerid),zone,FactionName[Defenders]);
- SendFactionMessage(Attackers, COLOR_WAR, gString);
- ScoreAtt = 0.0;
- ScoreDef = 0.0;
- War = 1;
- TakeON[zone] = 1;
- GangZoneFlashForAllEx(Zone[zone], GetZoneColor(Attackers));
- new sec = 1000;
- WarTime[0] = 900;
- SetTimerEx("StopWar", sec*WarTime[0], 0, "ii", zone, 1);
- format(gString, sizeof(gString), "[WAR]: Teritoriul %d, Timp ramas: 15:00",zone);
- SendFactionMessage(Defenders, COLOR_WAR, gString);
- SendFactionMessage(Attackers, COLOR_WAR, gString);
- format(gString, sizeof(gString), "Turf Number: %d",zone);
- TextDrawSetString(TextdrawWar[playerid][1], gString);
- InWar[Attackers] = 1;
- InWar[Defenders] = 1;
- mysql_format(handle, gQuery, sizeof(gQuery), "UPDATE `players` SET `PersonalKills` = '0' ");
- mysql_format(handle, gQuery, sizeof(gQuery), "UPDATE `players` SET `PersonalDeaths` = '0' ");
- OnPlayerSpawn(playerid);
- for(new i = gsb[0]; i <= albastrii[7]; i++) if(GetVehicleVirtualWorld(i) == 0) SetVehicleToRespawn(i);
- format(gString, sizeof(gString), "%s - %s",WarFactionName[Defenders], WarFactionName[Attackers]);
- TextDrawSetString(TextdrawWar[playerid][5], gString);
- return 1;
- }
- if(War2 == 0)
- {
- Attackers2 = member;
- Defenders2 = ZoneInfo[zone][zTeam];
- format(gString, sizeof(gString), "[WAR]: %s (%s) v-a atacat teritoriul cu numarul %d",FactionName[Attackers2],GetName(playerid),zone);
- SendFactionMessage(Defenders2, COLOR_WAR, gString);
- format(gString, sizeof(gString), "[WAR]: Gang-ul tau (%s) a atacat teritoriul cu numarul %d detinut de %s",GetName(playerid),zone,FactionName[Defenders2]);
- SendFactionMessage(Attackers2, COLOR_WAR, gString);
- ScoreAtt2 = 0.0;
- ScoreDef2 = 0.0;
- War2 = 1;
- TakeON[zone] = 2;
- GangZoneFlashForAllEx(Zone[zone], GetZoneColor(Attackers2));
- new sec = 1000;
- WarTime[1] = 900;
- SetTimerEx("StopWar", sec*WarTime[1], 0, "ii", zone, 2);
- format(gString, sizeof(gString), "[WAR]: Teritoriul %d, Timp ramas: 15:00",zone);
- SendFactionMessage(Defenders2, COLOR_WAR, gString);
- SendFactionMessage(Attackers2, COLOR_WAR, gString);
- format(gString, sizeof(gString), "Turf Number: %d",zone);
- TextDrawSetString(TextdrawWar[playerid][1], gString);
- InWar[Attackers2] = 1;
- InWar[Defenders2] = 1;
- mysql_format(handle, gQuery, sizeof(gQuery), "UPDATE `players` SET `PersonalKills` = '0' ");
- mysql_format(handle, gQuery, sizeof(gQuery), "UPDATE `players` SET `PersonalDeaths` = '0' ");
- OnPlayerSpawn(playerid);
- for(new i = gsb[0]; i <= albastrii[7]; i++) if(GetVehicleVirtualWorld(i) == 0) SetVehicleToRespawn(i);
- format(gString, sizeof(gString), "%s - %s",WarFactionName[Defenders2], WarFactionName[Attackers2]);
- TextDrawSetString(TextdrawWar[playerid][5], gString);
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement