Advertisement
Guest User

Untitled

a guest
Mar 18th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.10 KB | None | 0 0
  1. CMD:tr(playerid)
  2. {
  3.     new string[MAX_STRING];
  4.     new org = GetPlayerOrg(playerid);
  5.     if(!IsOrgTr(playerid))
  6.         return SendClientMessage(playerid, COLOR_GREY, "Você não pode dominar um territorio");
  7.  
  8.     if(IsAPlane(GetPlayerVehicleID(playerid)) && IsPlayerInAnyVehicle(playerid))
  9.         return SendClientMessage(playerid, COLOR_GREY, "Você não pode dominar dentro de um avião ou helicoptero!");
  10.  
  11.     if((PlayerInfo[playerid][pAdmin] && admtrampando[playerid]) || (PlayerInfo[playerid][pHelper] && helpertrampando[playerid]))
  12.         return SendClientMessage(playerid, COLOR_GREY, "Você precisa estar em modo jogo para dominar territorios.");
  13.  
  14.     new tr = GetPlayerTr(playerid);
  15.  
  16.     if(tr < 0)
  17.         return SendClientMessage(playerid, COLOR_GREY, "Você não está em nenhum terrotorio da cidade.");
  18.  
  19.     if(gettime() < trLS[tr][trLiberarGuerra])
  20.     {
  21.         format(string, sizeof string, "Teve uma guerra aqui recentemente, espere %s para criar outra nesta região!",ConvertTime(trLS[tr][trLiberarGuerra] - gettime()));
  22.         SendClientMessage(playerid, COLOR_GREY, string);
  23.         return 1;
  24.     }
  25.     if(trLS[tr][trDono] == org)
  26.         return SendClientMessage(playerid, COLOR_GREY, "Esta região ja pertence a sua organização.");
  27.  
  28.     if(trLS[tr][trGuerra])
  29.         return SendClientMessage(playerid, COLOR_GREY, "ja está tendo uma guerra neste local.");
  30.  
  31.     for(new i; i != MAX_TERRITORIOS; i++)
  32.     {
  33.         if(trLS[i][trGangAttack] == org || trLS[i][trGangDeffend] == org)
  34.             return SendClientMessage(playerid, COLOR_GREY, "Sua organização ja está defendendo ou atacando algum territorio.");
  35.  
  36.     }
  37.     for(new tri; tri != MAX_TERRITORIOS; tri++)
  38.     {
  39.         for(new i=1; i != MAX_ORGS; i++)
  40.         {
  41.             if(trLS[tri][trGangAttack] == i || trLS[tri][trGangDeffend] == i)
  42.             {
  43.                 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!");
  44.             }
  45.         }
  46.     }
  47.  
  48.  
  49.     new color;
  50.  
  51.     if(IsACop(playerid))
  52.     {
  53.         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]);
  54.         PlayerTextDrawSetString(playerid, textaviso[playerid], string);
  55.  
  56.         GangZoneFlashForAll(trLS[tr][trGZ], 0x8470FF95);
  57.         color = 0x8470FF95;
  58.         format(string, sizeof string, "Policial: %s está retomando o controle da região de %s.", NomePlayer(playerid), trLS[tr][trName]);
  59.  
  60.     }
  61.     else
  62.     {
  63.         if(trLS[tr][trDono] < 1)
  64.         {
  65.  
  66.             format(string, sizeof string, "Sua organizacao esta tentando tomar a regiao de ~g~%s", trLS[tr][trName]);
  67.             SendFamilyTextMessage(org, string);
  68.  
  69.             format(string, sizeof string, "** %s está tentando tomar a região de %s para os %s.", NomePlayer(playerid), trLS[tr][trName], GetOrgNameG(org));
  70.         }
  71.         else
  72.         {
  73.             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]);
  74.             SendFamilyTextMessage(trLS[tr][trDono], string);
  75.  
  76.             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]));
  77.             SendFamilyTextMessage(org, string);
  78.  
  79.             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]));
  80.         }
  81.         GangZoneFlashForAll(trLS[tr][trGZ], GetPlayerGZColor(playerid));
  82.         color = GetPlayerGZColor(playerid);
  83.     }
  84.     SendClientMessageToAll(GetPlayerColor(playerid), string);
  85.  
  86.     SendClientMessage(playerid, COLOR_GRAD1, "**Fique esperto, porque todos os Policiais e as Gangs foram avisadas de sua invasão!");
  87.  
  88.     SetPVarInt(playerid, "TomandoTr", trLS[tr][trArea]);
  89.  
  90.     trLS[tr][trGuerra] = true;
  91.  
  92.     trLS[tr][trGangAttack] = org;
  93.     trLS[tr][trGangDeffend] = trLS[tr][trDono];
  94.     trLS[tr][trLiberarGuerra] = gettime()+1*60;
  95.  
  96.     trLS[tr][trPontosAttack] = 0;
  97.     trLS[tr][trPontosDeffend] = 0;
  98.  
  99.     trLS[tr][trTempoGuerra] = 60;
  100.     trLS[tr][trTimer] = SetTimerEx("GuerraTr", 1000, 1, "dd", tr, color);
  101.  
  102.     return 1;
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement