GangZonas Compráveis

By [GangstA]Kasura, 1 Month ago, written in cpp.
  1. //****************************************************
  2. //POR FAVOR NÃO REMOVA OS CRÉDITOS
  3. //Sistema de GangZonas Compraveis v1.0
  4. //****************************************************
  5. //CRÉDITOS
  6. //Retirado do: Las Venturas Brasil 7.0d
  7. //Créditos Gerais: [GangstA]Kasura EX: [Rockstar]Rell
  8. //Desenvolvedores: BcO e BnO
  9. //MSN: guerra-mortal@hotmail.com
  10. //****************************************************
  11.  
  12. #include <a_samp>
  13.  
  14. #pragma tabsize 0
  15.  
  16. #define COLOR_RED       0xAA3333AA
  17. #define COLOR_GREEN     0x33AA33AA
  18. #define COLOR_GREY      0xAFAFAFAA
  19. #define COLOR_ORANGE    0xFF9900AA
  20. #define COLOR_YELLOW    0xFFFF00AA
  21.  
  22. #define CP_GZ_AUTOBASE_LV 0
  23. #define CP_GZ_CONSTRUCAO_LV     1
  24. #define CP_GZ_RECINTO_LV    2
  25. #define CP_GZ_FABRICA_LV    3
  26. #define CP_GZ_AEROPLACE_LV    4
  27. #define CP_GZ_DISNEY_LV     5
  28. #define CP_GZ_EXERCITO_LV   6
  29. #define CP_GZ_CALIGULAS_LV  7
  30. #define CP_GZ_GOLF_LV       8
  31.  
  32. #define P_GZ_AUTOBASE_LV    0
  33. #define P_GZ_CONSTRUCAO_LV  1
  34. #define P_GZ_RECINTO_LV      2
  35. #define P_GZ_FABRICA_LV     3
  36. #define P_GZ_AEROPLACE_LV     4
  37. #define P_GZ_DISNEY_LV      5
  38. #define P_GZ_EXERCITO_LV        6
  39. #define P_GZ_CALIGULAS_LV   7
  40. #define P_GZ_GOLF_LV          8
  41.  
  42. #define P_OFFSET        14
  43. #define MAX_GZS 9
  44. #define MAX_GANGS           50
  45. #define MAX_GANG_NAME       50
  46.  
  47. forward GzScoreUpdate();
  48. forward PayPlayerInGz(playerID, GzID, Float:x1, Float:y1, Float:x2, Float:y2, cash);
  49. forward getCheckpointType(playerID);
  50. forward isPlayerInArea(playerID, Float:data[4]);
  51. forward checkpointUpdate();
  52. forward PropertyScoreUpdate();
  53.  
  54. new gangNames[MAX_GANGS][MAX_GANG_NAME];
  55. new playerCheckpoint[MAX_PLAYERS];
  56. new gangInfo[MAX_GANGS][3];
  57. new gz = 555;
  58. new GZ[MAX_GZS];
  59. new GZ_EXISTE[MAX_GZS][2];
  60. new gangZonaId[MAX_GZS];
  61. new gangZonaIdAnter[MAX_GZS];
  62. new playerGang[MAX_PLAYERS];
  63. new PLAYERLIST_authed[MAX_PLAYERS];
  64.  
  65. #define MAX_POINTS 9
  66.  
  67. new Float:checkCoords[MAX_POINTS][4] = {
  68. {1017.134948, 1222.946899, 1096.891235, 1361.736572},           //GZ_AUTOBASE_LV
  69. {2372.279052, 1832.521362, 2496.685302, 1962.471801},           //GZ_CONSTRUCAO_LV
  70. {2777.4753, 833.6251, 2894.6955, 1022.9479},                    //GZ_RECINTO_LV
  71. {918.294555, 2043.856567, 996.507202, 2182.339599},             //GZ_FABRICA_LV
  72. {1638.5530,1284.3757, 1716.3368,1319.3700},                     //GZ_AEROPLACE
  73. {2079.743,978.1417, 2329.653,1171.545},
  74. {81.74512,1763.359, 362.0141,2055.306},                         //GZ_EXERCITO
  75. {2099.267,1535.143, 2290.605,1728.547},                         //GZ_CALIGULAS_LV
  76. {1111.341,2718.771, 1509.635,2842.55}                           //GZ_GOLF_LV
  77. };
  78.  
  79. new Float:checkpoints[MAX_POINTS][3] = {
  80. {1040.142578,1305.848266,10.820312},            //GZ_AUTOBASE_LV
  81. {2436.580322,1913.306274,6.163729},                     //GZ_CONSTRUCAO_LV
  82. {2814.641357,969.982727,10.750000},                     //GZ_RECINTO_LV
  83. {929.612487,2068.309570,10.820312},                     //GZ_FABRICA_LV
  84. {1647.4393,1301.9464,10.8203},                  //GZ_AEROPLACE
  85. {2273.6250,1044.2716,10.8203},                  //GZ_DISNEY
  86. {202.9969,1888.7633,17.6481},                           //GZ_EXERCITO
  87. {2288.2988,1567.0795,10.8203},                  //GZ_CALIGULAS_LV
  88. {1457.4954,2773.3105,10.8203}                           //GZ_GOLF_LV
  89. };
  90.  
  91. new checkpointType[MAX_POINTS] = {
  92.         CP_GZ_AUTOBASE_LV,
  93.         CP_GZ_CONSTRUCAO_LV,
  94.         CP_GZ_RECINTO_LV,
  95.         CP_GZ_FABRICA_LV,
  96.         CP_GZ_AEROPLACE_LV,
  97.         CP_GZ_DISNEY_LV,
  98.         CP_GZ_EXERCITO_LV,
  99.         CP_GZ_CALIGULAS_LV,
  100.         CP_GZ_GOLF_LV
  101. };
  102.  
  103. #define MAX_PROPERTIES 9
  104.  
  105. new propertyNames[MAX_PROPERTIES][32] = {
  106.         "Gang Zona Auto Base",
  107.         "Gang Zona Construção",
  108.         "Gang Zona Recinto",
  109.         "Gang Zona Fabrica",
  110.         "Gang Zona Aero Place",
  111.         "Gang Zona Disney",
  112.         "Gang Zona Exercito",
  113.         "Gang Zona Caligulas",
  114.         "Gang Zona Golf"
  115. };
  116.  
  117. new propertyValues[MAX_PROPERTIES] = {
  118.         185000,
  119.         175000,
  120.         200000,
  121.         250000,
  122.         190000,
  123.         270000,
  124.         180000,
  125.         210000,
  126.         190000
  127. };
  128.  
  129. new propertyEarnings[MAX_PROPERTIES] = {
  130.         0,
  131.         0,
  132.         0,
  133.         0,
  134.         0,
  135.         0,
  136.         0,
  137.         0,
  138.         0
  139. };
  140.  
  141. public getCheckpointType(playerID) {
  142.         return checkpointType[playerCheckpoint[playerID]];
  143. }
  144.  
  145. new propertyOwner[MAX_PROPERTIES] = {999,999,999,999,999,999,999,999,999};
  146.  
  147. public PayPlayerInGz(playerID, GzID, Float:x1, Float:y1, Float:x2, Float:y2, cash) //ID_GZ
  148. {
  149.  
  150.         if(IsPlayerConnected(playerID))
  151.         {
  152.                 new Float:X, Float:Y, Float:Z, Float:Health, Float:Armour;
  153.  
  154.                 GetPlayerPos(playerID, X, Y, Z);
  155.                 GetPlayerHealth(playerID,Health);
  156.                 GetPlayerArmour(playerID,Armour);
  157.  
  158.                 if((X >= x1) && (X <= x2) && (Y >= y1) && (Y <= y2))
  159.                 {
  160.                         if(playerGang[playerID] > 0)
  161.                         {
  162.                                         if(gangZonaId[GzID] == playerGang[playerID])
  163.                                         {
  164.                                                 GivePlayerMoney(playerID, cash);
  165.                                                 GivePlayerWeapon(playerID, 31, 2);
  166.  
  167.                                                 if(Health < 105)
  168.                                                 {
  169.                                                         SetPlayerHealth(playerID,Health + 2);
  170.                                                 }
  171.                                             if(Armour< 105)
  172.                                             {
  173.                                                     SetPlayerArmour(playerID,Armour + 2);
  174.                                             }
  175.                                         }
  176.                                         else
  177.                                         {
  178.                                                 if(GZ_EXISTE[GzID][0] == 1)
  179.                                                 {
  180.                                                         if(Health > 2)
  181.                                                         {
  182.                                                                 SetPlayerHealth(playerID,Health - 2.5);
  183.                                                         }
  184.                                                 }
  185.                                                 else
  186.                                                 {
  187.                                                         return 1;
  188.                                                 }
  189.                                         }
  190. //                              }
  191.                         }
  192.                         else
  193.                         {
  194.                                 if(GZ_EXISTE[GzID][0] == 1)
  195.                                 {
  196.                                         if(Health > 2)
  197.                                         {
  198.                                                 SetPlayerHealth(playerID,Health - 2.5);
  199.                                         }
  200.                                 }
  201.                                 else
  202.                                 {
  203.                                         return 1;
  204.                                 }
  205.                         }
  206.                 }
  207.                 return 1;
  208.         }
  209.         return 0;
  210. }
  211.  
  212. public GzScoreUpdate()
  213. {
  214.         for(new i = 0 ; i < MAX_PLAYERS ; i++)
  215.         {
  216.                 // GZ AUTOBASE_LV
  217.                 PayPlayerInGz(i, 0, 1017.134948, 1222.946899, 1096.891235, 1361.736572, 500);
  218.                 // GZ CONSTRUCAO_LV
  219.                 PayPlayerInGz(i, 1, 2372.279052, 1832.521362, 2496.685302, 1962.471801, 500);
  220.                 // GZ RECINTO_LV
  221.                 PayPlayerInGz(i, 2, 2777.4753, 833.6251, 2894.6955, 1022.9479, 500);
  222.                 // GZ FABRICA_LV
  223.                 PayPlayerInGz(i, 3, 918.294555, 2043.856567, 996.507202, 2182.339599, 500);
  224.                 // GZ AEROPLACE_LV
  225.                 PayPlayerInGz(i, 4, 1638.5530, 1284.3757, 1716.3368, 1319.3700, 500);
  226.                 // GZ Disney_LV
  227.                 PayPlayerInGz(i, 5, 2079.743, 978.1417, 2329.653, 1171.545, 500);
  228.                 // GZ_EXERCITO_LV
  229.                 PayPlayerInGz(i, 6, 81.74512, 1763.359, 362.0141, 2055.306, 500);
  230.                 // GZ CALIGULAS_LV
  231.                 PayPlayerInGz(i, 7, 2099.267, 1535.143, 2290.605, 1728.547, 500);
  232.                 //GZ GOLF_LV
  233.                 PayPlayerInGz(i, 8, 1111.341, 2718.771, 1509.635, 2842.55, 500);
  234.         }
  235.         return 1;
  236. }
  237.  
  238. public OnPlayerConnect(playerid)
  239. {
  240.         playerGang[playerid]=0;
  241.         playerCheckpoint[playerid]=999;
  242.         for(new g = 0 ; g < MAX_GZS ; g++)
  243.         {
  244.                 if(GZ_EXISTE[g][0] == 1)
  245.             {
  246.                         GangZoneShowForPlayer(playerid, GZ[g], GZ_EXISTE[g][1]);
  247.                 }
  248.         }
  249.   PLAYERLIST_authed[playerid]=false;
  250.   return false;
  251. }
  252.  
  253. public OnPlayerCommandText(playerid, cmdtext[])
  254. {
  255.  
  256.         new string[256];
  257.     new cmd[256];
  258.     new idx;
  259.     cmd = strtok(cmdtext, idx);
  260.  
  261.         if(strcmp(cmdtext, "/gang zona comprar", true) == 0)
  262.         {
  263.                 new property = 999;
  264.  
  265.                 if(IsPlayerInCheckpoint(playerid))
  266.                 {
  267.                         switch (playerCheckpoint[playerid])
  268.                         {
  269.                                 case CP_GZ_AUTOBASE_LV:
  270.                                 {
  271.                                         property = P_GZ_AUTOBASE_LV;
  272.                                         gz = 0;
  273.                                 }
  274.                                 case CP_GZ_CONSTRUCAO_LV:
  275.                                 {
  276.                                         property = P_GZ_CONSTRUCAO_LV;
  277.                                         gz = 1;
  278.                                 }
  279.                                 case CP_GZ_RECINTO_LV:
  280.                                 {
  281.                                         property = P_GZ_RECINTO_LV;
  282.                                         gz = 2;
  283.                                 }
  284.                                 case CP_GZ_FABRICA_LV:
  285.                                 {
  286.                                         property = P_GZ_FABRICA_LV;
  287.                                         gz = 3;
  288.                                 }
  289.                                 case CP_GZ_AEROPLACE_LV:
  290.                                 {
  291.                                         property = P_GZ_AEROPLACE_LV;
  292.                                         gz = 4;
  293.                                 }
  294.                                 case CP_GZ_DISNEY_LV:
  295.                                 {
  296.                                         property = P_GZ_DISNEY_LV;
  297.                                         gz = 5;
  298.                                 }
  299.                                 case CP_GZ_EXERCITO_LV:
  300.                                 {
  301.                                         property = P_GZ_EXERCITO_LV;
  302.                                         gz = 6;
  303.                                 }
  304.                                 case CP_GZ_CALIGULAS_LV:
  305.                                 {
  306.                                         property = P_GZ_CALIGULAS_LV;
  307.                                         gz = 7;
  308.                                 }
  309.                                 case CP_GZ_GOLF_LV:
  310.                                 {
  311.                                         property = P_GZ_GOLF_LV;
  312.                                         gz = 8;
  313.                                 }
  314.                         }
  315.  
  316.                         if(gz == 999 || property == 999)
  317.                         {
  318.                                 SendClientMessage(playerid, COLOR_RED, "[GZ INFO] Vá para o checkpoint e digite /gang zona comprar");
  319.                                 return 1;
  320.                         }
  321.  
  322.                         if(GetPlayerMoney(playerid) < propertyValues[property])
  323.                         {
  324.                                 SendClientMessage(playerid, COLOR_RED, "<GZ INFO> Você não tem dinheiro para comprar essa Gang Zona!");
  325.                                 return 1;
  326.                         }
  327.  
  328.                         if(playerGang[playerid] > 0)
  329.                         {
  330.                                 if(gangZonaId[gz] == playerGang[playerid])
  331.                                 {
  332.                               SendClientMessage(playerid, COLOR_RED, "[GZ]: Essa Gang Zona já é da tua Gang!");
  333.                               return 1;
  334.                             }
  335.  
  336.                             new playerCor = gangInfo[playerGang[playerid]][2];
  337. //                          gangInfo[playerGang[playerid]][2] = playerColors[playerid];
  338.  
  339.                                 if(GZ_EXISTE[gz][0] == 1)
  340.                                 {
  341.                                         GangZoneDestroy(GZ[gz]);
  342.                                         GZ[gz] = 555;
  343.                                 }
  344.  
  345.                                 if(gangZonaId[gz] > 0)
  346.                                 {
  347.                                         gangZonaIdAnter[gz] = gangZonaId[gz];
  348.                                 }
  349.  
  350.                                 switch(gz)
  351.                                 {
  352.                                         case 0:
  353.                                         {
  354.                         if((!GZ[gz]) || (GZ[gz] == 555))
  355.                         {
  356.                                                         GZ[gz] = GangZoneCreate(1017.134948, 1222.946899, 1096.891235, 1361.736572);
  357.                                                 GangZoneShowForAll(GZ[gz], playerCor);
  358.                                                         gangZonaId[gz] = playerGang[playerid];
  359.                                                         GZ_EXISTE[gz][0] = 1;
  360.                                                         GZ_EXISTE[gz][1] = playerCor;
  361.                                                 }
  362.                                         }
  363.                                         case 1:
  364.                                         {
  365.  
  366.                         if((!GZ[gz]) || (GZ[gz] == 555))
  367.                         {
  368.                                                         GZ[gz] = GangZoneCreate(2372.279052, 1832.521362, 2496.685302, 1962.471801);
  369.                                                 GangZoneShowForAll(GZ[gz], playerCor);
  370.                                                         gangZonaId[gz] = playerGang[playerid];
  371.                                                         GZ_EXISTE[gz][0] = 1;
  372.                                                         GZ_EXISTE[gz][1] = playerCor;
  373.                                                 }
  374.                                         }
  375.                                         case 2:
  376.                                         {
  377.                         if((!GZ[gz]) || (GZ[gz] == 555))
  378.                         {
  379.                                                         GZ[gz] = GangZoneCreate(2777.4753, 833.6251, 2894.6955, 1022.9479);
  380.                                                 GangZoneShowForAll(GZ[gz], playerCor);
  381.                                                         gangZonaId[gz] = playerGang[playerid];
  382.                                                         GZ_EXISTE[gz][0] = 1;
  383.                                                         GZ_EXISTE[gz][1] = playerCor;
  384.                                                 }
  385.                                         }
  386.                                         case 3:
  387.                                         {
  388.                         if((!GZ[gz]) || (GZ[gz] == 555))
  389.                         {
  390.                                                         GZ[gz] = GangZoneCreate(918.294555, 2043.856567, 996.507202, 2182.339599);
  391.                                                 GangZoneShowForAll(GZ[gz], playerCor);
  392.                                                         gangZonaId[gz] = playerGang[playerid];
  393.                                                         GZ_EXISTE[gz][0] = 1;
  394.                                                         GZ_EXISTE[gz][1] = playerCor;
  395.                                                 }
  396.                                         }
  397.                                         case 4:
  398.                                         {
  399.                         if((!GZ[gz]) || (GZ[gz] == 555))
  400.                         {
  401.                                                         GZ[gz] = GangZoneCreate(1638.5530, 1284.3757, 1716.3368, 1319.3700);
  402.                                                 GangZoneShowForAll(GZ[gz], playerCor);
  403.                                                         gangZonaId[gz] = playerGang[playerid];
  404.                                                         GZ_EXISTE[gz][0] = 1;
  405.                                                         GZ_EXISTE[gz][1] = playerCor;
  406.                                                 }
  407.                                         }
  408.                                         case 5:
  409.                                         {
  410.                         if((!GZ[gz]) || (GZ[gz] == 555))
  411.                         {
  412.                                                         GZ[gz] = GangZoneCreate(2079.743, 978.1417, 2329.653, 1171.545);
  413.                                                 GangZoneShowForAll(GZ[gz], playerCor);
  414.                                                         gangZonaId[gz] = playerGang[playerid];
  415.                                                         GZ_EXISTE[gz][0] = 1;
  416.                                                         GZ_EXISTE[gz][1] = playerCor;
  417.                                                 }
  418.                                         }
  419.                                         case 6:
  420.                                         {
  421.                         if((!GZ[gz]) || (GZ[gz] == 555))
  422.                         {
  423.                                                         GZ[gz] = GangZoneCreate(81.74512, 1763.359, 362.0141, 2055.306);
  424.                                                 GangZoneShowForAll(GZ[gz], playerCor);
  425.                                                         gangZonaId[gz] = playerGang[playerid];
  426.                                                         GZ_EXISTE[gz][0] = 1;
  427.                                                         GZ_EXISTE[gz][1] = playerCor;
  428.                                                 }
  429.                                         }
  430.                                         case 7:
  431.                                         {
  432.                         if((!GZ[gz]) || (GZ[gz] == 555))
  433.                         {
  434.                                                         GZ[gz] = GangZoneCreate(2099.267, 1535.143, 2290.605, 1728.547);
  435.                                                 GangZoneShowForAll(GZ[gz], playerCor);
  436.                                                         gangZonaId[gz] = playerGang[playerid];
  437.                                                         GZ_EXISTE[gz][0] = 1;
  438.                                                         GZ_EXISTE[gz][1] = playerCor;
  439.                                                 }
  440.                                         }
  441.                                         case 8:
  442.                                         {
  443.                         if((!GZ[gz]) || (GZ[gz] == 555))
  444.                         {
  445.                                                         GZ[gz] = GangZoneCreate(1111.341, 2718.771, 1509.635, 2842.55);
  446.                                                 GangZoneShowForAll(GZ[gz], playerCor);
  447.                                                         gangZonaId[gz] = playerGang[playerid];
  448.                                                         GZ_EXISTE[gz][0] = 1;
  449.                                                         GZ_EXISTE[gz][1] = playerCor;
  450.                                                 }
  451.                                         }
  452.  
  453.                                         default: return 1;
  454.                                 }
  455.                         }
  456.                         else
  457.                         {
  458.                    SendClientMessage(playerid, COLOR_RED, "[GZ INFO] É preciso estar em uma gang para poder comprar!");
  459.                    return 1;
  460.                         }
  461.  
  462.             if(GZ_EXISTE[gz][0] == 1)
  463.             {
  464.                 GivePlayerMoney(playerid, 0-propertyValues[property]);
  465.  
  466.                                 format(string, sizeof(string), "A gang %s comprou a %s da gang %s!", gangNames[gangZonaId[gz]], propertyNames[property], gangNames[gangZonaIdAnter[gz]]);
  467.                                 SendClientMessageToAll(COLOR_GREEN, string);
  468.                         }
  469.                 }
  470.                 else
  471.                 {
  472.                         SendClientMessage(playerid, COLOR_RED, "[GZ INFO] Necessario estar no checkpoint para poder /gang zona comprar");
  473.                         return 1;
  474.                 }
  475.                 return 1;
  476.         }
  477.  
  478.         return 0;
  479. }
  480.  
  481. public OnPlayerEnterCheckpoint(playerid)
  482. {
  483.  
  484. new string[256];
  485.  
  486.         switch(getCheckpointType(playerid))
  487.         {
  488.                 case CP_GZ_AUTOBASE_LV:
  489.                 {
  490.                         SendClientMessage(playerid, COLOR_ORANGE, "[GZ]: Gang Zona Auto Base:");
  491.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Valor: $185000, Para comprar digite /gang zona comprar");
  492.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Ganhe dinheiro + recuperação de vida ficando nela");
  493.             gz = 0;
  494.                 }
  495.                 case CP_GZ_CONSTRUCAO_LV:
  496.                 {
  497.                         SendClientMessage(playerid, COLOR_ORANGE, "[GZ]: Gang Zona Construção:");
  498.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Valor: $175000, Para comprar digite /gang zona comprar");
  499.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Ganhe dinheiro + recuperação de vida ficando nela");
  500.             gz = 1;
  501.                 }
  502.                 case CP_GZ_RECINTO_LV:
  503.                 {
  504.                         SendClientMessage(playerid, COLOR_ORANGE, "[GZ]: Gang Zona Recinto:");
  505.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Valor: $200000, Para comprar digite /gang zona comprar");
  506.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Ganhe dinheiro + recuperação de vida ficando nela");
  507.             gz = 2;
  508.                 }
  509.                 case CP_GZ_FABRICA_LV:
  510.                 {
  511.                         SendClientMessage(playerid, COLOR_ORANGE, "[GZ]: Gang Zona Fabrica:");
  512.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Valor: $250000, Para comprar digite /gang zona comprar");
  513.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Ganhe dinheiro + recuperação de vida ficando nela");
  514.             gz = 3;
  515.                 }
  516.                 case CP_GZ_AEROPLACE_LV:
  517.                 {
  518.                         SendClientMessage(playerid, COLOR_ORANGE, "[GZ]: Gang Zona Aero Place:");
  519.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Valor: $190000, Para comprar digite /gang zona comprar");
  520.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Ganhe dinheiro + recuperação de vida ficando nela");
  521.             gz = 4;
  522.                 }
  523.                 case CP_GZ_DISNEY_LV:
  524.                 {
  525.                         SendClientMessage(playerid, COLOR_ORANGE, "[GZ]: Gang Zona Disney:");
  526.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Valor: $270000, Para comprar digite /gang zona comprar");
  527.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Ganhe dinheiro + recuperação de vida ficando nela");
  528.             gz = 5;
  529.                 }
  530.                 case CP_GZ_EXERCITO_LV:
  531.                 {
  532.                         SendClientMessage(playerid, COLOR_ORANGE, "[GZ]: Gang Zona Exercito:");
  533.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Valor: $180000, Para comprar digite /gang zona comprar");
  534.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Ganhe dinheiro + recuperação de vida ficando nela");
  535.             gz = 6;
  536.         }
  537.                 case CP_GZ_CALIGULAS_LV:
  538.                 {
  539.                         SendClientMessage(playerid, COLOR_ORANGE, "[GZ]: Gang Zona Caligulas:");
  540.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Valor: $210000, Para comprar digite /gang zona comprar");
  541.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Ganhe dinheiro + recuperação de vida ficando nela");
  542.             gz = 7;
  543.                 }
  544.                 case CP_GZ_GOLF_LV:
  545.                 {
  546.                         SendClientMessage(playerid, COLOR_ORANGE, "[GZ]: Gang Zona Golf:");
  547.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Valor: $190000, Para comprar digite /gang zona comprar");
  548.                         SendClientMessage(playerid, COLOR_YELLOW, "[GZ]: Ganhe dinheiro + recuperação de vida ficando nela");
  549.             gz = 8;
  550.                 }
  551.         }
  552.  
  553.         if(getCheckpointType(playerid) >= P_OFFSET)
  554.         {
  555.         if(GZ_EXISTE[gz][0] == 1)
  556.                 {
  557.                         format(string, sizeof(string), "[GZ]: Essa Gang Zona é atualmente da Gang: %s.", gangNames[gangZonaId[gz]]);
  558.                         SendClientMessage(playerid, COLOR_RED, string);
  559.                 }
  560.     }
  561. }
  562.  
  563. public OnFilterScriptInit()
  564. {
  565.         SetTimer("GzScoreUpdate", 2001, true);
  566.         SetTimer("checkpointUpdate", 1100, 1);
  567.  
  568.         return 1;
  569. }
  570.  
  571.  
  572. public checkpointUpdate()
  573. {
  574.         for(new i=0; i<MAX_PLAYERS; i++)
  575.         {
  576.             if(IsPlayerConnected(i)) {
  577.                 for(new j=0; j < MAX_POINTS; j++) {
  578.                     if(isPlayerInArea(i, checkCoords[j])) {
  579.                         if(playerCheckpoint[i]!=j) {
  580.                             DisablePlayerCheckpoint(i);
  581.                                                 SetPlayerCheckpoint(i, checkpoints[j][0],checkpoints[j][1],checkpoints[j][2],2);
  582.                                                 playerCheckpoint[i] = j;
  583.                                         }
  584.                     } else {
  585.                         if(playerCheckpoint[i]==j) {
  586.                             DisablePlayerCheckpoint(i);
  587.                             playerCheckpoint[i] = 999;
  588.                         }
  589.                     }
  590.                 }
  591.                 }
  592.         }
  593. }
  594.  
  595. public isPlayerInArea(playerID, Float:data[4])
  596. {
  597.         new Float:X, Float:Y, Float:Z;
  598.  
  599.         GetPlayerPos(playerID, X, Y, Z);
  600.         if(X >= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3]) {
  601.                 return 1;
  602.         }
  603.         return 0;
  604. }
  605.  
  606. strtok(const string[], &index)
  607. {
  608.         new length = strlen(string);
  609.         while ((index < length) && (string[index] <= ' '))
  610.         {
  611.                 index++;
  612.         }
  613.  
  614.         new offset = index;
  615.         new result[20];
  616.         while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  617.         {
  618.                 result[index - offset] = string[index];
  619.                 index++;
  620.         }
  621.         result[index - offset] = EOS;
  622.         return result;
  623. }
  624.  
  625. public PropertyScoreUpdate()
  626. {
  627.         new owners[MAX_PROPERTIES];
  628.         new payments[MAX_PROPERTIES];
  629.  
  630.         for(new i=0; i < MAX_PROPERTIES; i++)
  631.             owners[i]=999;
  632.  
  633.         for(new i=0; i < MAX_PROPERTIES; i++)
  634.         {
  635.                 if(propertyOwner[i] < 999) {
  636.  
  637.                         for(new j=0; j < MAX_PROPERTIES; j++) {
  638.                             if(owners[j]==propertyOwner[i]) {
  639.                                 payments[j]+=propertyEarnings[i];
  640.                                 j = MAX_PROPERTIES;
  641.                             } else if (owners[j]==999) {
  642.                                         owners[j]=propertyOwner[i];
  643.                                         payments[j]+=propertyEarnings[i];
  644.                                 j = MAX_PROPERTIES;
  645.                                 }
  646.                         }
  647.  
  648.                 }
  649.         }
  650.  }