Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:tr(playerid)
- {
- new string[MAX_STRING];
- new org = GetPlayerOrg(playerid);
- if(!IsOrgTr(playerid))
- return SendClientMessage(playerid, COLOR_GREY, "Você não pode dominar um territorio");
- if(IsAPlane(GetPlayerVehicleID(playerid)) && IsPlayerInAnyVehicle(playerid))
- return SendClientMessage(playerid, COLOR_GREY, "Você não pode dominar dentro de um avião ou helicoptero!");
- if((PlayerInfo[playerid][pAdmin] && admtrampando[playerid]) || (PlayerInfo[playerid][pHelper] && helpertrampando[playerid]))
- return SendClientMessage(playerid, COLOR_GREY, "Você precisa estar em modo jogo para dominar territorios.");
- new tr = GetPlayerTr(playerid);
- if(tr < 0)
- return SendClientMessage(playerid, COLOR_GREY, "Você não está em nenhum terrotorio da cidade.");
- if(gettime() < trLS[tr][trLiberarGuerra])
- {
- format(string, sizeof string, "Teve uma guerra aqui recentemente, espere %s para criar outra nesta região!",ConvertTime(trLS[tr][trLiberarGuerra] - gettime()));
- SendClientMessage(playerid, COLOR_GREY, string);
- return 1;
- }
- if(trLS[tr][trDono] == org)
- return SendClientMessage(playerid, COLOR_GREY, "Esta região ja pertence a sua organização.");
- if(trLS[tr][trGuerra])
- return SendClientMessage(playerid, COLOR_GREY, "ja está tendo uma guerra neste local.");
- for(new i; i != MAX_TERRITORIOS; i++)
- {
- if(trLS[i][trGangAttack] == org || trLS[i][trGangDeffend] == org)
- return SendClientMessage(playerid, COLOR_GREY, "Sua organização ja está defendendo ou atacando algum territorio.");
- }
- for(new tri; tri != MAX_TERRITORIOS; tri++)
- {
- for(new i=1; i != MAX_ORGS; i++)
- {
- if(trLS[tri][trGangAttack] == i || trLS[tri][trGangDeffend] == i)
- {
- return SendClientMessage(playerid, COLOR_GREY, "Os donos desta região não podem defender esta área no momento, pois já estão em uma guerra!");
- }
- }
- }
- new color;
- if(IsACop(playerid))
- {
- format(string, sizeof string, "Voce esta retomando o controle da regiao de ~g~%s~w~~n~espere 1 minuto para conseguir dominar esta area", trLS[tr][trName]);
- PlayerTextDrawSetString(playerid, textaviso[playerid], string);
- GangZoneFlashForAll(trLS[tr][trGZ], 0x8470FF95);
- color = 0x8470FF95;
- format(string, sizeof string, "Policial: %s está retomando o controle da região de %s.", NomePlayer(playerid), trLS[tr][trName]);
- }
- else
- {
- if(trLS[tr][trDono] < 1)
- {
- format(string, sizeof string, "Sua organizacao esta tentando tomar a regiao de ~g~%s", trLS[tr][trName]);
- SendFamilyTextMessage(org, string);
- format(string, sizeof string, "** %s está tentando tomar a região de %s para os %s.", NomePlayer(playerid), trLS[tr][trName], GetOrgNameG(org));
- }
- else
- {
- format(string, sizeof string, "~r~%s (%s)~w~ estao tentando dominar a regiao de ~r~%s ~w~de voces~n~vao ate la e protejam o que e de voces", NomePlayer(playerid), GetOrgName(org), trLS[tr][trName]);
- SendFamilyTextMessage(trLS[tr][trDono], string);
- format(string, sizeof string, "Sua organizacao esta tentando tomar a regiao de ~g~%s~w~ dos ~r~%s", trLS[tr][trName], GetOrgNameG(trLS[tr][trDono]));
- SendFamilyTextMessage(org, string);
- format(string, sizeof string, "** %s e os %s estão tentando tomar a região de %s dos %s.", NomePlayer(playerid), GetOrgNameG(org), trLS[tr][trName], GetOrgNameG(trLS[tr][trDono]));
- }
- GangZoneFlashForAll(trLS[tr][trGZ], GetPlayerGZColor(playerid));
- color = GetPlayerGZColor(playerid);
- }
- SendClientMessageToAll(GetPlayerColor(playerid), string);
- SendClientMessage(playerid, COLOR_GRAD1, "**Fique esperto, porque todos os Policiais e as Gangs foram avisadas de sua invasão!");
- SetPVarInt(playerid, "TomandoTr", trLS[tr][trArea]);
- trLS[tr][trGuerra] = true;
- trLS[tr][trGangAttack] = org;
- trLS[tr][trGangDeffend] = trLS[tr][trDono];
- trLS[tr][trLiberarGuerra] = gettime()+1*60;
- trLS[tr][trPontosAttack] = 0;
- trLS[tr][trPontosDeffend] = 0;
- trLS[tr][trTempoGuerra] = 60;
- trLS[tr][trTimer] = SetTimerEx("GuerraTr", 1000, 1, "dd", tr, color);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement