Advertisement
Guest User

- Balkan Express TDM -

a guest
Sep 15th, 2016
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 39.08 KB | None | 0 0
  1. /*
  2.  
  3. --------------------------------------------------------------------------------
  4. |                             Balkan Express | TDM                             |
  5. |------------------------------------------------------------------------------|
  6. |                                 - Zasluge -                                  |
  7. |                                 = Krajna17 =                                 |
  8. |                                  = ZDE5 =                                    |
  9. |------------------------------------------------------------------------------|
  10. |                                  - Vezija -                                  |
  11. |                                  = v.2.5 =                                   |
  12. |------------------------------------------------------------------------------|
  13. |                                 - Sljedece -                                 |
  14. |                             = Dodati Admin System =                          |
  15. |                             = Dodati nove timove =                           |
  16. --------------------------------------------------------------------------------
  17. |                                 - Copyright -                                |
  18. |                              = Balkan Express =                              |
  19. |                              = Owner: Krajna17 =                             |
  20. |                                  * BE:TD *                                   |
  21. --------------------------------------------------------------------------------
  22.  
  23. */
  24.  
  25. //-- ( Includes ) --
  26. #include <a_samp>
  27. #include <streamer>
  28. #include <YSI\y_ini>
  29. #include <zcmd>
  30.  
  31. //-- ( Timovi ) --
  32. #define TEAM_SWAT 0
  33. #define TEAM_BALLAS 1
  34. #define TEAM_GROOVE 2
  35.  
  36. //-- ( O Serveru ) --
  37. #define     VLASNIK_SERVER                                            "Krajna17"
  38. #define     SERVER_WEB                                            "www.samp.com"
  39. #define     MAP_NAME                                                  "BE | TDM"
  40.  
  41. //-- ( Dialozi ) --
  42. #define DIALOG_REGISTRACIJA 1
  43. #define DIALOG_PRIJAVA 2
  44. #define DIALOG_ORUZIJE 3
  45. #define DIALOG_PROMJENILOZINKU 4
  46. #define DIALOG_USPIJEH 5
  47.  
  48. //-- ( Boje zona ) --
  49. #define SWAT_ZONE_COLOR 0x0065E196
  50. #define BALLAS_ZONE_COLOR 0xC90E5496
  51. #define GROOVE_ZONE_COLOR 0x33AA33AA
  52.  
  53. //-- ( Boje timova ) --
  54. #define TEAM_SWAT_COLOR 0x0065E196
  55. #define TEAM_BALLAS_COLOR 0xC90E5496
  56. #define TEAM_GROOVE_COLOR 0x33AA33AA
  57.  
  58. //-- ( Sve boje ) --
  59. #define                         COLOR_GREY                  0xAFAFAFAA
  60. #define                         COLOR_MALERT                0xDB4D33FF
  61. #define                         COLOR_LEAVE                 0xC86D46FF
  62. #define                         COLOR_GREEN                 0x33AA33AA
  63. #define                         COLOR_RED                   0xAA3333AA
  64. #define                         COLOR_MOST_WANTED           0x9A0000E7
  65. #define                         COLOR_YELLOW                0xFFFF00AA
  66. #define                         COLOR_WHITE                 0xFFFFFFAA
  67. #define                         COLOR_BLUE                  0x0000BBAA
  68. #define                         COLOR_LIGHTBLUE             0x33CCFFAA
  69. #define                         COLOR_CALERT                0x78B6A8FF
  70. #define                         COLOR_ORANGE                0xFF9900AA
  71. #define                         COLOR_FADE1                 0xE6E6E6E6
  72. #define                         COLOR_FADE2                 0xC8C8C8C8
  73. #define                         COLOR_FADE3                 0xAAAAAAAA
  74. #define                         COLOR_FADE4                 0x8C8C8C8C
  75. #define                         COLOR_FADE5                 0x6E6E6E6E
  76. #define                         COLOR_PURPLE                0xC2A2DAAA
  77. #define                         COLOR_LIME                  0x10F441AA
  78. #define                         COLOR_MAGENTA               0xFF00FFFF
  79. #define                         COLOR_SEAGREEN              0x10F441AA
  80. #define                         COLOR_NAVY                  0x000080AA
  81. #define                         COLOR_AQUA                  0xF0F8FFAA
  82. #define                         COLOR_CRIMSON               0xDC143CAA
  83. #define                         COLOR_FLBLUE                0x6495EDAA
  84. #define                         COLOR_BISQUE                0xFFE4C4AA
  85. #define                         COLOR_BLACK                 0x000000AA
  86. #define                         COLOR_REALRED               0xFF0606FF
  87. #define                         COLOR_LIGHTRED              0xFF6347AA
  88. #define                         COLOR_LIGHTBLUE             0x33CCFFAA
  89. #define                         COLOR_LIRED                 0xAF0000B4
  90. #define                         COLOR_LIGHTGREEN            0x9ACD32AA
  91. #define                         COLOR_CHARTREUSE            0x7FFF00AA
  92. #define                         COLOR_BROWN                 0XA52A2AAA
  93. #define                         COLOR_CORAL                 0xFF7F50AA
  94. #define                         COLOR_GOLD                  0xB8860BAA
  95. #define                         COLOR_GRAD1                 0xB4B5B7FF
  96. #define                         COLOR_GRAD2                 0xBFC0C2FF
  97. #define                         COLOR_GRAD3                 0xCBCCCEFF
  98. #define                         COLOR_GRAD4                 0xD8D8D8FF
  99. #define                         COLOR_GRAD5                 0xE3E3E3FF
  100. #define                         COLOR_GRAD6                 0xF0F0F0FF
  101. #define                         COL_WHITE                   "{FFFFFF}"
  102. #define                         COL_RED                     "{F81414}"
  103. #define                         COL_GREEN                   "{00FF22}"
  104. #define                         COL_LIGHTBLUE               "{00CED1}"
  105. #define                         purple                      "{D526D9}"
  106. #define                         lightgreen                  "{00FF00}"
  107. #define                         pink                        "{FF80FF}"
  108. #define                         green                       "{33AA33}"
  109. #define                         red                         "{FF0000}"
  110. #define                         yellow                      "{FFFF00}"
  111. #define                         white                       "{FFFFFF}"
  112. #define                         grey                        "{AFAFAF}"
  113. #define                         newb                        "{7DAEFF}"
  114. #define                         orange                      "{FF8000}"
  115. #define                         lightred                    "{FF6347}"
  116. #define                         lightblue                   "{33CCFF}"
  117.  
  118. //-- ( Random Poruke ) --
  119.  
  120. new RandomMessages[][] =
  121. {
  122.           "{F81414}[BE]: {FFFFFF}Dobrodosao na nas server, ugodnu igru zeli ti BE Staff Community!",
  123.           "{F81414}[BE]: {FFFFFF}Pomozite nasoj zajednici i pozovite vase prijatelje i reklamirajte nas!",
  124.           "{F81414}[BE]: {FFFFFF}Mozete promijeniti tim komadnom[/tim]!!",
  125.           "{F81414}[BE]: {FFFFFF}Mozete kupiti oruzija s komandom[/oruzije]!!",
  126.           "{F81414}[BE]: {FFFFFF}Server Verzija: Balkan Express v2.5 !!",
  127.           "{F81414}[BE]: {FFFFFF}Ukoliko primjetite neku gresku javite se na Facebook: Krayna NW!",
  128.           "{F81414}[BE]: {FFFFFF}Posjetite nas forum www.balkan-express-tdm.com!"
  129. };
  130.  
  131. //-- ( Spawn ) --
  132. new Float:SwatSpawn[][] =
  133. {
  134.    {1215.7853,-1814.2609,16.5938},
  135.    {1275.4395,-1803.1868,13.3885}
  136.  
  137. };
  138. new Float:BallasSpawn[][] =
  139. {
  140.    {2153.9648,-1812.1898,13.5498},
  141.    {2176.9434,-1788.8566,13.5156}
  142. };
  143. new Float:GrooveSpawn[][] =
  144. {
  145.    {2508.6692,-1686.1097,13.5636},
  146.    {2473.2097,-1690.3546,13.5141}
  147.  
  148. };
  149.  
  150. #define PATH "/Igraci/%s.ini"
  151.  
  152. new gTeam[MAX_PLAYERS];
  153. new GZ_ZONE1; //Swat
  154. new GZ_ZONE2; //Ballas
  155. new GZ_ZONE3; //Groove
  156. new Text:SWAT;
  157. new Text:BALLAS;
  158. new Text:GROOVE;
  159.  
  160. new telep;
  161. new SW; //Trgovina(Swat)
  162. new BA; //Trgovina(Ballas)
  163. new GR; //Trgovina(Groove)
  164.  
  165. //-- ( Zone za zauzimanje ) --
  166. #define SO 0
  167. #define SA 1
  168.  
  169. //-- ( Variable za zone ) --
  170. new CP[30];
  171. new Zone[30];
  172. new tCheck[30];
  173. new zDefine[MAX_PLAYERS];
  174. new UnderAttack[30];
  175. new timer[MAX_PLAYERS][30];
  176.  
  177. //-- ( TextDraw ) --
  178.  
  179. //------TDovi
  180.  
  181.  
  182. enum pInfo
  183. {
  184.     pPass,
  185.     pCash,
  186.     pAdmin,
  187.     pKills,
  188.     pScore,
  189.     pDeaths
  190. }
  191. new PlayerInfo[MAX_PLAYERS][pInfo];
  192.  
  193.  
  194.  
  195. //----------------------------------------------------------------------------//
  196. main()
  197. {
  198.     print("====================================");
  199.     print("          Balkan Express | TDM      ");
  200.     print("           Uspjesno ucitana         ");
  201.     print("            BE by Krajna17          ");
  202.     print("====================================");
  203. }
  204. public OnGameModeInit()
  205. {
  206.     SetGameModeText("BE | TDM");
  207.     SendRconCommand( "mapname "MAP_NAME"" );
  208.    
  209.     DisableInteriorEnterExits( );
  210.     UsePlayerPedAnims();
  211.    
  212.     SetTimer("RandomMessagess",110000,true);
  213.    
  214.     AddPlayerClass(285,1216.7590,-1814.5166,16.5938,250.5854,0,0,0,0,0,0); //Swat
  215.     AddPlayerClass(104,2153.5920,-1812.5614,13.5498,306.7557,0,0,0,0,0,0); //Ballas
  216.     AddPlayerClass(107,2494.6377,-1695.3959,23.5592,205.7720,0,0,0,0,0,0); //Groove
  217.    
  218.     GZ_ZONE1 = GangZoneCreate(1200.85, -1855.563, 1311.132, -1721.339); // Swat
  219.     GZ_ZONE2 = GangZoneCreate(2079.305, -1898.988, 2193.39, -1760.817); //Ballas
  220.     GZ_ZONE3 = GangZoneCreate(2457.724,-1629.878,2541.415,-1726.302); //Groove
  221.    
  222.     //-- ( Zone za zauzimanje ) --
  223.     Zone[SO] = GangZoneCreate(2406.349, -2052.949, 2512.828, -1883.197);
  224.     Zone[SA] = GangZoneCreate(2626.913, -1895.04, 2836.069, -1673.966);
  225.     //-- ( Checkpointi ) --
  226.     CP[SO] = CreateDynamicCP(2451.3579,-1976.1241,13.5539,3, -1,-1,-1,100.0);
  227.     CP[SA] = CreateDynamicCP(2702.9163,-1697.4459,11.5086,3, -1,-1,-1,100.0);
  228.  
  229.    
  230.     telep = CreatePickup(1318, 19, 2152.0903,-1789.1897,13.5108);
  231.     SW = CreatePickup(1314, 19, 1255.4547,-1804.9713,13.4197);
  232.     BA = CreatePickup(1314, 19, 2168.4553,-1788.4194,13.5204);
  233.     GR = CreatePickup(1314, 19, 2514.3193,-1691.6177,14.0460);
  234.    
  235.     Create3DTextLabel("*Krov*", 0xFFAF02FF, 2152.0903,-1789.1897,13.5108, 30.0,0);
  236.     Create3DTextLabel("*Trgovina*", 0xFFAF02FF, 1255.4547,-1804.9713,13.4197, 40.0,0); //Swat
  237.     Create3DTextLabel("*Trgovina*", 0xFFAF02FF, 2168.4553,-1788.4194,13.5204, 40.0,0); //Ballas
  238.     Create3DTextLabel("*Trgovina*", 0xFFAF02FF, 2514.3193,-1691.6177,14.0460, 40.0,0); //Groove
  239.    
  240.     //-- ( SWAT Baza ) --
  241.     CreateObject(987, 1195.38245, -1820.17358, 12.48669,   0.00000, 0.00000, 269.74701);
  242.     CreateObject(987, 1195.32190, -1830.17163, 12.48669,   0.00000, 0.00000, 269.74701);
  243.     CreateObject(987, 1195.18335, -1842.05725, 12.48669,   0.00000, 0.00000, 359.70959);
  244.     CreateObject(3749, 1214.04004, -1842.35474, 18.17841,   0.00000, 0.00000, 359.86862);
  245.     CreateObject(987, 1221.69373, -1842.04395, 12.48669,   0.00000, 0.00000, 359.70959);
  246.     CreateObject(987, 1233.67407, -1842.11987, 12.48669,   0.00000, 0.00000, 359.70959);
  247.     CreateObject(987, 1245.65527, -1842.21289, 12.48669,   0.00000, 0.00000, 359.70959);
  248.     CreateObject(987, 1249.60681, -1842.31689, 12.48669,   0.00000, 0.00000, 359.70959);
  249.     CreateObject(3749, 1269.20520, -1842.74231, 18.38751,   0.00000, 0.00000, 359.86862);
  250.     CreateObject(987, 1287.37524, -1830.21191, 12.48669,   0.00000, 0.00000, 90.03559);
  251.     CreateObject(987, 1275.64404, -1842.07874, 12.48669,   0.00000, 0.00000, 359.70959);
  252.     CreateObject(987, 1287.35449, -1842.21643, 12.48669,   0.00000, 0.00000, 90.03559);
  253.     CreateObject(987, 1287.35938, -1818.20593, 12.48669,   0.00000, 0.00000, 90.03559);
  254.     CreateObject(987, 1287.32690, -1806.22742, 12.48669,   0.00000, 0.00000, 90.03559);
  255.     CreateObject(987, 1287.26782, -1797.24548, 12.48669,   0.00000, 0.00000, 90.03559);
  256.     CreateObject(987, 1287.39343, -1785.54675, 12.16636,   0.00000, 0.00000, 179.17168);
  257.     CreateObject(16599, 1199.17261, -1822.96228, 17.07084,   0.00000, 0.00000, 359.38477);
  258.     CreateObject(3881, 1277.17200, -1837.43213, 14.23146,   0.00000, 0.00000, 359.92636);
  259.     CreateObject(1684, 1250.65967, -1804.32056, 13.77478,   0.00000, 0.00000, 36.75390);
  260.     CreateObject(939, 1262.36035, -1790.91028, 15.00116,   0.00000, 0.00000, 358.83173);
  261.     CreateObject(2036, 1224.99622, -1811.92578, 15.66597,   0.00000, 0.00000, 352.81271);
  262.     CreateObject(2035, 1225.48157, -1812.16174, 15.61054,   0.00000, 0.00000, 0.00000);
  263.    
  264.     //-- ( SWAT vozila ) --
  265.     CreateVehicle(427, 1270.7599, -1796.1221, 13.3485, 178.9794, -1, -1, -1);
  266.     CreateVehicle(427, 1275.1378, -1796.2709, 13.3485, 178.9794, -1, -1, -1);
  267.     CreateVehicle(427, 1279.9856, -1796.2302, 13.3485, 178.9794, -1, -1, -1);
  268.     CreateVehicle(490, 1254.0857, -1833.9554, 13.4270, 0.0585, -1, -1, -1);
  269.     CreateVehicle(490, 1248.5536, -1833.8389, 13.4270, 359.8564, -1, -1, -1);
  270.     CreateVehicle(523, 1244.3732, -1834.9708, 12.7828, 0.0000, -1, -1, -1);
  271.     CreateVehicle(523, 1241.7274, -1834.9020, 12.7828, 0.0000, -1, -1, -1);
  272.     CreateVehicle(523, 1239.3851, -1834.8463, 12.7828, 0.0000, -1, -1, -1);
  273.     CreateVehicle(528, 1280.1508, -1813.8910, 13.1808, 89.2648, -1, -1, -1);
  274.     CreateVehicle(528, 1279.9313, -1819.0088, 13.1808, 89.2648, -1, -1, -1);
  275.     CreateVehicle(601, 1199.8546, -1834.6018, 13.0058, 270.4161, -1, -1, -1);
  276.     CreateVehicle(601, 1199.7339, -1827.6613, 13.0058, 270.4161, -1, -1, -1);
  277.     CreateVehicle(596, 1234.8986, -1834.0291, 13.0015, 359.1868, -1, -1, -1);
  278.     CreateVehicle(596, 1230.5980, -1833.8588, 13.0015, 359.1868, -1, -1, -1);
  279.    
  280.     //-- ( BALLAS Baza ) --
  281.     CreateObject(3749, 2185.28662, -1764.43384, 17.98042,   0.00000, 0.00000, 0.00000);
  282.     CreateObject(987, 2195.06543, -1777.24792, 15.03420,   0.00000, 0.00000, 89.74636);
  283.     CreateObject(987, 2195.13696, -1789.20520, 15.03420,   0.00000, 0.00000, 89.74636);
  284.     CreateObject(987, 2195.11011, -1801.19739, 15.03420,   0.00000, 0.00000, 89.74636);
  285.     CreateObject(987, 2195.06787, -1813.13782, 15.03420,   0.00000, 0.00000, 89.74636);
  286.     CreateObject(987, 2195.00952, -1814.99780, 15.03420,   0.00000, 0.00000, 89.74636);
  287.     CreateObject(3593, 2190.72412, -1810.46155, 12.73489,   0.00000, 0.00000, 353.17432);
  288.     CreateObject(3593, 2187.78442, -1809.19458, 12.73489,   0.00000, 0.00000, 353.17432);
  289.     CreateObject(1230, 2178.44727, -1769.35889, 12.89274,   0.00000, 0.00000, 0.00000);
  290.     CreateObject(1230, 2177.73706, -1770.03406, 12.89274,   0.00000, 0.00000, 0.00000);
  291.     CreateObject(1230, 2178.93628, -1770.71484, 12.89374,   0.00000, 0.00000, 0.00000);
  292.     CreateObject(16096, 2168.54443, -1784.59583, 13.52810,   0.00000, 0.00000, 88.95236);
  293.    
  294.     //-- ( BALLAS Vozila ) --
  295.     CreateVehicle(463, 2172.0120, -1792.8088, 12.8607, 178.0000, 211, 0, -1);
  296.     CreateVehicle(566, 2182.5864, -1807.2084, 13.0604, 0.0000, 211, 0, -1);
  297.     CreateVehicle(566, 2178.2295, -1807.3373, 13.0604, 0.0000, 211, 0, -1);
  298.     CreateVehicle(581, 2173.8892, -1808.7372, 12.8611, 0.0000, 211, 0, -1);
  299.     CreateVehicle(463, 2169.5820, -1792.7960, 12.8607, 178.0000, 211, 0, -1);
  300.     CreateVehicle(463, 2167.0925, -1792.7181, 12.8607, 178.0000, 211, 0, -1);
  301.     CreateVehicle(581, 2171.4058, -1808.6403, 12.8611, 0.0000, 211, 0, -1);
  302.     CreateVehicle(475, 2158.0933, -1793.6899, 12.9726, 180.2626, 211, 0, -1);
  303.     CreateVehicle(475, 2161.9470, -1793.6361, 12.9726, 180.2626, 211, 0, -1);
  304.     CreateVehicle(459, 2188.1936, -1800.1414, 13.2603, 0.0000, 211, 0, -1);
  305.     CreateVehicle(459, 2188.1338, -1792.9691, 13.2603, 0.0000, 211, 0, -1);
  306.     CreateVehicle(548, 2160.7998, -1773.5038, 20.2283, 0.3314, 211, 0, -1);
  307.     CreateVehicle(548, 2140.7144, -1773.6785, 20.2283, 0.3314, 211, 0, -1);
  308.     CreateVehicle(469, 2141.4348, -1812.6525, 18.8620, 359.4868, 211, 0, -1);
  309.    
  310.     //-- ( GROOVE Baza ) --
  311.     CreateObject(1411,2485.0000000,-1722.1000000,14.2000000,0.0000000,0.0000000,358.0000000);
  312.     CreateObject(1411,2479.8999000,-1721.9000000,14.2000000,0.0000000,0.0000000,0.0000000);
  313.     CreateObject(2991,2482.5000000,-1719.8000000,13.2000000,0.0000000,0.0000000,270.0000000);
  314.     CreateObject(2991,2478.7000000,-1719.7000000,13.2000000,0.0000000,0.0000000,270.0000000);
  315.     CreateObject(2991,2480.6001000,-1720.3000000,14.5000000,0.0000000,0.0000000,160.0000000);
  316.     CreateObject(2991,2480.3999000,-1716.7000000,13.2000000,0.0000000,0.0000000,180.0000000);
  317.     CreateObject(2991,2480.5000000,-1717.3000000,14.5000000,0.0000000,0.0000000,187.9990000);
  318.     CreateObject(3749,2463.0000000,-1658.8000000,18.0000000,0.0000000,0.0000000,272.0000000);
  319.     CreateObject(1411,2521.1001000,-1722.1000000,14.2000000,0.0000000,0.0000000,0.0000000);
  320.     CreateObject(1411,2540.5000000,-1717.9000000,14.1000000,0.0000000,0.0000000,88.0000000);
  321.     CreateObject(1411,2540.5000000,-1712.5000000,14.1000000,0.0000000,0.0000000,87.9950000);
  322.     CreateObject(1411,2526.3000000,-1722.0000000,14.2000000,0.0000000,0.0000000,359.9950000);
  323.     CreateObject(1411,2531.5000000,-1722.0000000,14.3000000,0.0000000,0.0000000,359.9950000);
  324.     CreateObject(1411,2535.0000000,-1722.0000000,14.2000000,0.0000000,0.0000000,359.9950000);
  325.     CreateObject(997,2537.8000000,-1722.3000000,14.9000000,0.0000000,0.0000000,28.0000000);
  326.    
  327.     //-- ( GROOVE Vozila ) --
  328.     CreateVehicle(567,2468.1001000,-1669.7000000,13.3000000,10.0000000,137,132,-1);
  329.     CreateVehicle(567,2471.7000000,-1678.3000000,13.5000000,43.9980000,137,132,-1);
  330.     CreateVehicle(492,2510.0000000,-1666.1000000,13.5000000,10.0000000,137,157,-1);
  331.     CreateVehicle(492,2507.6001000,-1677.9000000,13.4000000,325.9960000,137,157,-1);
  332.     CreateVehicle(411,2505.8999000,-1695.3000000,13.4000000,0.0000000,137,110,-1);
  333.     CreateVehicle(482,2478.3000000,-1653.4000000,13.7000000,90.0000000,137,28,-1);
  334.     CreateVehicle(482,2486.5000000,-1653.6000000,13.7000000,90.0000000,137,28,-1);
  335.     CreateVehicle(468,2532.3000000,-1669.8000000,14.9000000,0.0000000,137,34,-1);
  336.     CreateVehicle(468,2530.3999000,-1669.8000000,14.9000000,0.0000000,137,34,-1);
  337.     CreateVehicle(468,2528.6001000,-1669.9000000,14.9000000,0.0000000,137,34,-1);
  338.     CreateVehicle(468,2526.8999000,-1669.8000000,14.9000000,0.0000000,137,34,-1);
  339.     CreateVehicle(487,2528.3000000,-1677.3000000,20.2000000,86.0000000,137,169,-1);
  340.     CreateVehicle(487,2494.2000000,-1703.0000000,23.6000000,359.9950000,137,169,-1);
  341.     CreateVehicle(481,2497.2000000,-1653.4000000,13.1000000,128.0000000,137,152,-1);
  342.     CreateVehicle(481,2499.6001000,-1653.9000000,13.1000000,127.9960000,137,152,-1);
  343.    
  344.     //-- ( TextDraw - Create ) --
  345.     SWAT = TextDrawCreate(205.000000, 250.000000, "~b~Swat");
  346.     TextDrawBackgroundColor(SWAT, 51);
  347.     TextDrawFont(SWAT, 2);
  348.     TextDrawLetterSize(SWAT, 0.538000, 2.271997);
  349.     TextDrawColor(SWAT, 16711935);
  350.     TextDrawSetOutline(SWAT, 1);
  351.     TextDrawSetProportional(SWAT, 1);
  352.     TextDrawSetShadow(SWAT,1);
  353.  
  354.     BALLAS = TextDrawCreate(205.000000, 250.000000, "~r~Ballas");
  355.     TextDrawBackgroundColor(BALLAS, 51);
  356.     TextDrawFont(BALLAS, 2);
  357.     TextDrawLetterSize(BALLAS, 0.538000, 2.271997);
  358.     TextDrawColor(BALLAS, 0xFF0000AA);
  359.     TextDrawSetOutline(BALLAS, 1);
  360.     TextDrawSetProportional(BALLAS, 1);
  361.     TextDrawSetShadow(BALLAS,1);
  362.    
  363.     GROOVE = TextDrawCreate(205.000000, 250.000000, "Groove");
  364.     TextDrawBackgroundColor(GROOVE, 51);
  365.     TextDrawFont(GROOVE, 2);
  366.     TextDrawLetterSize(GROOVE, 0.538000, 2.271997);
  367.     TextDrawColor(GROOVE, 0x33AA33AA);
  368.     TextDrawSetOutline(GROOVE, 1);
  369.     TextDrawSetProportional(GROOVE, 1);
  370.     TextDrawSetShadow(GROOVE,1);
  371.     return 1;
  372. }
  373. public OnPlayerConnect(playerid)
  374. {
  375.     //-- ( Poruka na ulasku ) --
  376.     SendClientMessage(playerid, COLOR_GREY,"Dobrodosao na Balkan Express | TDM server!");
  377.    
  378.     //-- ( CP Zone ) --
  379.     GangZoneShowForPlayer(playerid, Zone[SO], 0xFFFFFF96);
  380.     GangZoneShowForPlayer(playerid, Zone[SA], 0xFFFFFF96);
  381.    
  382.     TextDrawHideForPlayer(playerid, SWAT);
  383.     TextDrawHideForPlayer(playerid, BALLAS);
  384.     TextDrawHideForPlayer(playerid, GROOVE);
  385.     //TextDrawHideForPlayer(playerid, BE0);
  386.     //TextDrawHideForPlayer(playerid, BE1);
  387.     if(fexist(UserPath(playerid)))
  388.     {
  389.         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  390.         ShowPlayerDialog(playerid, DIALOG_PRIJAVA, DIALOG_STYLE_INPUT,"{F81414}Prijava","{FFFFFF}Dobrodosao!\n{FFFFFF}Tvoj account je {F81414}pronadjen!{FFFFFF}\nUpisite svoju lozinku ispod.","Prijava","Izlaz");
  391.     }
  392.     else
  393.     {
  394.         ShowPlayerDialog(playerid, DIALOG_REGISTRACIJA, DIALOG_STYLE_INPUT,"{F81414}Registracija","{FFFFFF}Dobrodosao!\n{FFFFFF}Tvoj account nije pronadjen!\nUpisite svoju lozinku za registraciju.","Registracija","Izlaz");
  395.     }
  396.     return 1;
  397. }
  398.  
  399.  
  400. //-- ( Random Poruke ) --
  401. forward RandomMessagess();
  402. public RandomMessagess()
  403. {
  404.      SendClientMessageToAll(-1, RandomMessages[random(sizeof(RandomMessages))]);
  405.      return 1;
  406. }
  407.  
  408. public OnPlayerRequestClass(playerid, classid)
  409. {
  410.     new Float:x, Float:y, Float:z;
  411.     GetPlayerPos(playerid, x,y,z);
  412.     switch(classid)
  413.     {
  414.         case 0:
  415.         {
  416.             // SWAT //
  417.             SetPlayerFacingAngle(playerid, 300.10);
  418.             SetPlayerPos(playerid, 1216.7590,-1814.5166,16.5938);
  419.             SetPlayerCameraPos(playerid,1221.9364,-1815.9675,16.5938);
  420.             SetPlayerCameraLookAt(playerid, 1216.7590,-1814.5166,16.5938, CAMERA_MOVE);
  421.             TextDrawShowForPlayer(playerid, SWAT);
  422.             TextDrawHideForPlayer(playerid, BALLAS);
  423.             TextDrawHideForPlayer(playerid, GROOVE);
  424.             gTeam[playerid] = TEAM_SWAT;
  425.             SetPlayerTeam(playerid, 0);
  426.             SetPlayerSkin(playerid, 285);
  427.             SetPlayerColor(playerid, TEAM_SWAT_COLOR);
  428.         }
  429.         case 1:
  430.         {
  431.             // BALLAS //
  432.             SetPlayerFacingAngle(playerid, 300.10);
  433.             SetPlayerPos(playerid, 2153.5920,-1812.5614,13.5498);
  434.             SetPlayerCameraPos(playerid, 2157.4919,-1808.9727,13.3745);
  435.             SetPlayerCameraLookAt(playerid, 2153.5920,-1812.5614,13.5498, CAMERA_MOVE);
  436.             TextDrawHideForPlayer(playerid, SWAT);
  437.             TextDrawShowForPlayer(playerid, BALLAS);
  438.             TextDrawHideForPlayer(playerid, GROOVE);
  439.             SetPlayerTeam(playerid, 1);
  440.             SetPlayerSkin(playerid, 104);
  441.             gTeam[playerid] = TEAM_BALLAS;
  442.             SetPlayerColor(playerid, TEAM_BALLAS_COLOR);
  443.         }
  444.         case 2:
  445.         {
  446.             // GROOVE //
  447.             SetPlayerFacingAngle(playerid, 300.10);
  448.             SetPlayerPos(playerid, 2494.1904,-1696.6300,23.6543);
  449.             SetPlayerCameraPos(playerid, 2494.3242,-1692.5642,23.6843);
  450.             SetPlayerCameraLookAt(playerid, 2494.1904,-1696.6300,23.6543, CAMERA_MOVE);
  451.             TextDrawHideForPlayer(playerid, SWAT);
  452.             TextDrawShowForPlayer(playerid, GROOVE);
  453.             TextDrawHideForPlayer(playerid, BALLAS);
  454.             SetPlayerTeam(playerid, 2);
  455.             SetPlayerSkin(playerid, 105);
  456.             gTeam[playerid] = TEAM_GROOVE;
  457.             SetPlayerColor(playerid, TEAM_GROOVE_COLOR);
  458.         }
  459.     }
  460.     return 1;
  461. }
  462. public OnPlayerSpawn(playerid)
  463. {
  464.        SetPlayerVirtualWorld(playerid, 0);
  465.        SetPlayerInterior(playerid, 0);
  466.        
  467.        if(gTeam[playerid] == TEAM_SWAT)
  468.        {
  469.        new rand = random(sizeof(SwatSpawn));
  470.        SetPlayerPos(playerid, SwatSpawn[rand][0], SwatSpawn[rand][1], SwatSpawn[rand][2]);
  471.        GivePlayerWeapon(playerid, 24, 100);
  472.        GivePlayerWeapon(playerid, 4, 1);
  473.        GivePlayerWeapon(playerid, 25, 150);
  474.        GivePlayerWeapon(playerid, 31, 150);
  475.        }
  476.        else if(gTeam[playerid] == TEAM_BALLAS)
  477.        {
  478.        new rand = random(sizeof(BallasSpawn));
  479.        SetPlayerPos(playerid, BallasSpawn[rand][0], BallasSpawn[rand][1], BallasSpawn[rand][2]);
  480.        GivePlayerWeapon(playerid, 30, 200);
  481.        GivePlayerWeapon(playerid, 29, 100);
  482.        GivePlayerWeapon(playerid, 33, 50);
  483.        }
  484.        else if(gTeam[playerid] == TEAM_GROOVE)
  485.        {
  486.        new rand = random(sizeof(GrooveSpawn));
  487.        SetPlayerPos(playerid, GrooveSpawn[rand][0], GrooveSpawn[rand][1], GrooveSpawn[rand][2]);
  488.        GivePlayerWeapon(playerid, 30, 200);
  489.        GivePlayerWeapon(playerid, 29, 100);
  490.        GivePlayerWeapon(playerid, 33, 50);
  491.        }
  492.        if(gTeam[playerid] == TEAM_SWAT)
  493.        {
  494.         SetPlayerTeam(playerid, TEAM_SWAT);
  495.         SetPlayerColor(playerid, TEAM_SWAT_COLOR);
  496.        }
  497.        if(gTeam[playerid] == TEAM_BALLAS)
  498.        {
  499.         SetPlayerTeam(playerid, TEAM_BALLAS);
  500.         SetPlayerColor(playerid, TEAM_BALLAS_COLOR);
  501.        }
  502.        if(gTeam[playerid] == TEAM_GROOVE)
  503.        {
  504.         SetPlayerTeam(playerid, TEAM_GROOVE);
  505.         SetPlayerColor(playerid, TEAM_GROOVE_COLOR);
  506.        }
  507.        GangZoneShowForAll(GZ_ZONE1, SWAT_ZONE_COLOR); //Swat
  508.        GangZoneShowForAll(GZ_ZONE2, BALLAS_ZONE_COLOR); // Ballas
  509.        GangZoneShowForAll(GZ_ZONE3, GROOVE_ZONE_COLOR); //Groove
  510.  
  511.  
  512.        TextDrawHideForPlayer(playerid, SWAT);
  513.        TextDrawHideForPlayer(playerid, BALLAS);
  514.        TextDrawHideForPlayer(playerid, GROOVE);
  515.        //TextDrawShowForPlayer(playerid, BE0);
  516.        //TextDrawShowForPlayer(playerid, BE1);
  517.        
  518.        SetPlayerMapIcon(playerid, 5, 1255.4547,-1804.9713,13.4197, 18,2,MAPICON_LOCAL); //Swat ikona(Oruzije)
  519.        
  520.        SetPlayerMapIcon(playerid, 6, 2168.4553,-1788.4194,13.52047, 18,2,MAPICON_LOCAL); //Ballas ikona(Oruzije)
  521.        
  522.        SetPlayerMapIcon(playerid, 6, 2487.4058,-1672.4552,13.3359, 18,2,MAPICON_LOCAL); //Groove ikona(Oruzije)
  523.        
  524.        SetPlayerMapIcon(playerid, 7, 2451.3579,-1976.1241,13.5539, 19,2,MAPICON_GLOBAL); //Skladiste oruzija(Zastava)
  525.        
  526.        SetPlayerMapIcon(playerid, 8, 2702.9163,-1697.4459,11.5086, 19,2,MAPICON_GLOBAL); //Stadion(Zastava)
  527.        return 1;
  528. }
  529. forward LoadUser_data(playerid,name[],value[]);
  530. public LoadUser_data(playerid,name[],value[])
  531. {
  532.     INI_Int("Password",PlayerInfo[playerid][pPass]);
  533.     INI_Int("Cash",PlayerInfo[playerid][pCash]);
  534.     INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  535.     INI_Int("Kills",PlayerInfo[playerid][pKills]);
  536.     INI_Int("Score",PlayerInfo[playerid][pScore]);
  537.     INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  538.     return 1;
  539. }
  540.  
  541. forward CountingDown(playerid, time);
  542. public CountingDown(playerid, time)
  543. {
  544.     if(time != 0)
  545.     {
  546.     new string[5];
  547.     format(string, sizeof(string), "%d", time);
  548.     GameTextForPlayer(playerid, string, 1200, 4);
  549.     SetTimerEx("CountingDown", 1000, true, "ii", playerid, time-1);
  550.     }
  551.     else
  552.     {
  553.     GameTextForPlayer(playerid, "~g~ZAUZETO!", 2500, 3);
  554.     TogglePlayerControllable(playerid, 1);
  555.     }
  556.     return true;
  557. }
  558. forward SetZone(playerid);
  559. public SetZone(playerid)
  560. {
  561.     SetPlayerScore(playerid, GetPlayerScore(playerid) + 10); //Nagrade - Zone
  562.     GivePlayerMoney(playerid, 20000);
  563.     SendClientMessage(playerid,COLOR_GREEN,"Cestitke! Zauzeo si zonu i zaradio 20000$ i 10 Skora! ");
  564.     UnderAttack[SO] = 0; //Zaustavljamo zauzimanje zone!
  565.     UnderAttack[SA] = 0;
  566.     KillTimer(timer[playerid][SO]);//Iskljucujemo tajmer
  567.     KillTimer(timer[playerid][SA]);
  568.     SetGangZone(playerid);
  569.     return 1;
  570. }
  571. forward SetGangZone(playerid);
  572. public SetGangZone(playerid)
  573. {
  574.     if(zDefine[playerid] == SO)
  575.     {
  576.     GangZoneShowForAll(Zone[SO],GetPlayerColor(playerid));
  577.     new string[126], pName5[MAX_PLAYER_NAME];
  578.     GetPlayerName(playerid,pName5,sizeof(pName5));
  579.     format(string,sizeof string,"%s je zauzeo Skladiste oruzija",pName5);
  580.     GangZoneStopFlashForAll(Zone[SO]);
  581.     SendClientMessageToAll(COLOR_GREEN, string);
  582.     tCheck[SO] = gTeam[playerid];
  583.     }
  584.     if(zDefine[playerid] == SA)
  585.     {
  586.     GangZoneShowForAll(Zone[SA],GetPlayerColor(playerid));
  587.     new string[126], pName5[MAX_PLAYER_NAME];
  588.     GetPlayerName(playerid,pName5,sizeof(pName5));
  589.     format(string,sizeof string,"%s je zauzeo Stadion ",pName5);
  590.     GangZoneStopFlashForAll(Zone[SA]);
  591.     SendClientMessageToAll(COLOR_GREEN, string);
  592.     tCheck[SA] = gTeam[playerid];
  593.     }
  594.     return 1;
  595. }
  596. CMD:promjenilozinku(playerid)
  597. {
  598.     ShowPlayerDialog(playerid,DIALOG_PROMJENILOZINKU, DIALOG_STYLE_INPUT,"Promjena Lozinke","Ukucaj novu lozinku :","U redu","Izlaz");
  599.     return 1;
  600. }
  601. CMD:oruzije(playerid, params[])
  602. {
  603.     ShowPlayerDialog(playerid, DIALOG_ORUZIJE, DIALOG_STYLE_LIST, "*Oruzarnica*", "Noz - 5000$\nBombe - 20000$\nDeagle - 10000$\nShotgun - 20000$\nMP5 - 25000$", "Odaberi", "Izlaz");
  604.     return 1;
  605. }
  606. CMD:tim(playerid, params[])
  607. {
  608.     SetPlayerHealth(playerid, 0.0);
  609.     ForceClassSelection(playerid);
  610.     return 1;
  611. }
  612. CMD:ubijse(playerid, params[])
  613. {
  614.     SetPlayerHealth(playerid, 0);
  615.     SendClientMessage(playerid,COLOR_RED,"Ubio si se");
  616.     return 1;
  617. }
  618. CMD:pomoc(playerid, params[])
  619. {
  620.     SendClientMessage(playerid, COLOR_YELLOW,"----------------( Server Pomoc )-------------------");
  621.     SendClientMessage(playerid, COLOR_YELLOW,"Dobrodosao na Balkan Express server");
  622.     SendClientMessage(playerid, COLOR_YELLOW,"Vas zadatak je da osvajate zone!");
  623.     SendClientMessage(playerid, COLOR_YELLOW,"Koristite tim chat upisom ! i vasim tekstom!");
  624.     SendClientMessage(playerid, COLOR_YELLOW,"Posjetite nas forum: www.balkan-express-tdm.com!");
  625.     SendClientMessage(playerid, COLOR_YELLOW,"Nadam se da ce vam se svidjeti nas server!");
  626.     SendClientMessage(playerid, COLOR_YELLOW,"---------------------------------------------------");
  627.     return 1;
  628. }
  629. CMD:komande(playerid, params[])
  630. {
  631.     SendClientMessage(playerid, COLOR_GREEN,"----------------( Server Komande )-------------------");
  632.     SendClientMessage(playerid, COLOR_YELLOW,"/pomoc, /oruzije, /ubijse, /tim, /promjenilozinku");
  633.     SendClientMessage(playerid, COLOR_GREEN,"-----------------------------------------------------");
  634.     return 1;
  635. }
  636. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  637. {
  638. if(response)
  639.     {
  640.     switch(dialogid)
  641.         {
  642.         case 2:
  643.             {
  644.             switch(listitem)
  645.             {
  646.                 case 0:
  647.                 {
  648.                     if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFF0000AA, "Greska: Nemas dovoljno novaca.");
  649.                     GivePlayerMoney(playerid, -10000);
  650.                     SetPlayerHealth(playerid, 100.0);
  651.                     SendClientMessage(playerid, 0xF8D873FF, "Kupio si Health za 10000$");
  652.                 }
  653.                 case 1:
  654.                 {
  655.                     if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid,0xFF0000AA, "Greska: Nemas dovoljno novaca.");
  656.                     GivePlayerMoney(playerid, -10000);
  657.                     SetPlayerArmour(playerid, 100.0);
  658.                     SendClientMessage(playerid, 0xF8D873FF, "Kupio si Armour za 10000$");
  659.                 }
  660.             }
  661.         }
  662.     }
  663.     return 1;
  664. }
  665. switch( dialogid )
  666.     {
  667.         case DIALOG_REGISTRACIJA:
  668.         {
  669.             if (!response) return Kick(playerid);
  670.             if(response)
  671.             {
  672.                 if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTRACIJA, DIALOG_STYLE_INPUT, "{F81414}Registracija","{FFFFFF}Upisao si netocnu lozinku!\n\nUpisite svoju lozinku ispod.","Registracija","Izlaz");
  673.                 new INI:File = INI_Open(UserPath(playerid));
  674.                 INI_SetTag(File,"data");
  675.                 INI_WriteInt(File,"Password",udb_hash(inputtext));
  676.                 INI_WriteInt(File,"Cash",0);
  677.                 INI_WriteInt(File,"Admin",0);
  678.                 INI_WriteInt(File,"Kills",0);
  679.                 INI_WriteInt(File,"Deaths",0);
  680.                 INI_Close(File);
  681.  
  682.                 SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
  683.                 SpawnPlayer(playerid);
  684.             }
  685.         }
  686.  
  687.         case DIALOG_PRIJAVA:
  688.         {
  689.             if ( !response ) return Kick ( playerid );
  690.             if( response )
  691.             {
  692.                 if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  693.                 {
  694.                     INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  695.                     GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  696.                 }
  697.                 else
  698.                 {
  699.                     ShowPlayerDialog(playerid, DIALOG_PRIJAVA, DIALOG_STYLE_INPUT,"{F81414}Prijava","{FFFFFF}Upisao si netocnu lozinku!\nUpisite svoju lozinku ispod.","Prijava","Izlaz");
  700.                 }
  701.                 return 1;
  702.             }
  703.         }
  704.        
  705.         case DIALOG_PROMJENILOZINKU:
  706.         {
  707.             if(!response) return Kick(playerid);
  708.             if(response)
  709.             {
  710.                 if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_PROMJENILOZINKU, DIALOG_STYLE_INPUT,"Promjena lozinke","Ukucajte novu lozinku :","U redu","Izlaz");
  711.                 new INI:File = INI_Open(UserPath(playerid));
  712.                 INI_SetTag(File,"data");
  713.                 INI_WriteInt(File,"Password",udb_hash(inputtext));
  714.                 INI_Close(File);
  715.  
  716.                 ShowPlayerDialog(playerid, DIALOG_USPIJEH, DIALOG_STYLE_MSGBOX,""COL_WHITE"Uspijeh!",""COL_GREEN"Lozinka promjenjena!","U redu","");
  717.             }
  718.         }
  719.         case DIALOG_ORUZIJE:
  720.         {
  721.             switch(listitem)
  722.             {
  723.                 case 0:
  724.                 {
  725.                     if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, COLOR_RED, "Upozorenje: Nemas dovoljno novaca.");
  726.                     else
  727.                     {
  728.                         GivePlayerWeapon(playerid, 4, 1);
  729.                         GivePlayerMoney(playerid, -5000);
  730.                         SendClientMessage(playerid, COLOR_YELLOW, "Kupio si Noz za 5000$.");
  731.                     }
  732.                 }
  733.                 case 1:
  734.                 {
  735.                     if(GetPlayerMoney(playerid) < 20000) return SendClientMessage(playerid, COLOR_RED, "Upozorenje: Nemas dovoljno novaca.");
  736.                     else
  737.                     {
  738.                         GivePlayerWeapon(playerid, 16, 5);
  739.                         GivePlayerMoney(playerid, -20000);
  740.                         SendClientMessage(playerid, COLOR_YELLOW, "Kupio si Bombe za 20000$.");
  741.                     }
  742.                 }
  743.                 case 2:
  744.                 {
  745.                     if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, COLOR_RED, "Upozorenje: Nemas dovoljno novaca.");
  746.                     else
  747.                     {
  748.                         GivePlayerWeapon(playerid, 24, 1000);
  749.                         GivePlayerMoney(playerid, -10000);
  750.                         SendClientMessage(playerid, COLOR_YELLOW, "Kupio si Deagle za 10000$.");
  751.                     }
  752.                 }
  753.                 case 3:
  754.                 {
  755.                     if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, COLOR_RED, "Upozorenje: Nemas dovoljno novaca.");
  756.                     else
  757.                     {
  758.                         GivePlayerWeapon(playerid, 25, 150);
  759.                         GivePlayerMoney(playerid, -20000);
  760.                         SendClientMessage(playerid, COLOR_YELLOW, "Kupio si Shotgun za 20000$.");
  761.                     }
  762.                 }
  763.                 case 4:
  764.                 {
  765.                     if(GetPlayerMoney(playerid) < 25000) return SendClientMessage(playerid, COLOR_RED, "Upozorenje: Nemas dovoljno novaca.");
  766.                     else
  767.                     {
  768.                         GivePlayerWeapon(playerid, 29, 750);
  769.                         GivePlayerMoney(playerid, -25000);
  770.                         SendClientMessage(playerid, COLOR_YELLOW, "Kupio si MP5 za 25000$.");
  771.                     }
  772.                 }
  773.             }
  774.         }
  775.     }
  776. return 1;
  777. }
  778. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
  779. {
  780.     if(gTeam[issuerid] == gTeam[playerid])
  781.     {
  782.         new Float:hps[MAX_PLAYERS];
  783.         GetPlayerHealth(issuerid, hps[issuerid]);
  784.         SetPlayerHealth(issuerid, hps[issuerid]-5);
  785.         GameTextForPlayer(issuerid,"~r~TVOJ TIM", 3000, 3);
  786.     }
  787.     return 1;
  788. }
  789. stock UserPath(playerid)
  790. {
  791.     new string[128],playername[MAX_PLAYER_NAME];
  792.     GetPlayerName(playerid,playername,sizeof(playername));
  793.     format(string,sizeof(string),PATH,playername);
  794.     return string;
  795. }
  796. public OnPlayerPickUpPickup(playerid, pickupid)
  797. {
  798.     if(pickupid == SW && GetPlayerTeam(playerid) != TEAM_SWAT) return SendClientMessage(playerid, 0xFF0000AA, "Nisi u mogucnosti da koristis ovu trgovinu.");
  799.     {
  800.     if(pickupid == SW) ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "*Trgovina*", "Health - 10000$\nArmour - 10000$", "Kupi", "Odustani");
  801.     }
  802.     if(pickupid == BA && GetPlayerTeam(playerid) != TEAM_BALLAS) return SendClientMessage(playerid, 0xFF0000AA, "Nisi u mogucnosti da koristis ovu trgovinu.");
  803.     {
  804.     if(pickupid == BA) ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "*Trgovina*", "Health - 10000$\nArmour - 10000$", "Kupi", "Odustani");
  805.     }
  806.     if(pickupid == GR && GetPlayerTeam(playerid) != TEAM_GROOVE) return SendClientMessage(playerid, 0xFF0000AA, "Nisi u mogucnosti da koristis ovu trgovinu.");
  807.     {
  808.     if(pickupid == GR) ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "*Trgovina*", "Health - 10000$\nArmour - 10000$", "Kupi", "Odustani");
  809.     }
  810.     if(pickupid == telep)
  811.     {
  812.        SetPlayerPos(playerid, 2148.5032,-1793.0162,18.8772);
  813.        return 1;
  814.     }
  815.     return 1;
  816. }
  817. public OnPlayerDisconnect(playerid, reason)
  818. {
  819.     new INI:File = INI_Open(UserPath(playerid));
  820.     INI_SetTag(File,"data");
  821.     INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  822.     INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  823.     INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  824.     INI_WriteInt(File,"Scores",PlayerInfo[playerid][pScore]);
  825.     INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  826.     INI_Close(File);
  827.     return 1;
  828. }
  829. public OnPlayerText(playerid,text[])
  830. {
  831.     if(text[0] == '!')
  832.     {
  833.       new string[128];  GetPlayerName(playerid, string, sizeof(string));
  834.       format(string, sizeof(string), "[*TEAM RADIO*] %s: %s", string, text[1]);
  835.       printf("%s", string);
  836.  
  837.       for(new i = 0; i < MAX_PLAYERS; i++)
  838.         {
  839.             if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string);
  840.         }
  841.       return 0;
  842.     }
  843.  
  844.     return 1;
  845. }
  846. stock GivePlayerScore(playerid, score)
  847. {
  848.         SetPlayerScore(playerid, GetPlayerScore(playerid)+score);
  849.         return 1;
  850. }
  851. stock udb_hash(buf[]) {
  852.     new length=strlen(buf);
  853.     new s1 = 1;
  854.     new s2 = 0;
  855.     new n;
  856.     for (n=0; n<length; n++)
  857.     {
  858.        s1 = (s1 + buf[n]) % 65521;
  859.        s2 = (s2 + s1)     % 65521;
  860.     }
  861.     return (s2 << 16) + s1;
  862. }
  863. public OnPlayerDeath(playerid, killerid, reason)
  864. {
  865.     //-- ( Razlog Smrti ) --
  866.     SendDeathMessage(killerid, playerid, reason);
  867.    
  868.     GivePlayerMoney(killerid, 5000); //Nagrada za svakog ubijenog neprijatelja
  869.     SendClientMessage(killerid, -1, "Ubio si neprijatelja. Dobio si {F81414}5000$ {FFFFFF}i {F81414}+1 {FFFFFF}Skor."); //Ovdje smo definiralu poruku nakon sto ubijete igraca
  870.     new weaponid = GetPlayerWeapon(killerid);
  871.     switch(weaponid)
  872.     {
  873.             case 2 .. 15: GivePlayerWeapon(killerid, GetPlayerWeapon(killerid), 1);
  874.             case  16 .. 18: GivePlayerWeapon(killerid, GetPlayerWeapon(killerid), 1);
  875.             case 22 .. 32: GivePlayerWeapon(killerid, GetPlayerWeapon(killerid), 60);
  876.             case 35 .. 46: GivePlayerWeapon(killerid, GetPlayerWeapon(killerid), 1);
  877.     }
  878.     SetPlayerScore(killerid, GetPlayerScore(killerid) +1);
  879.     PlayerInfo[killerid][pKills]++;
  880.     PlayerInfo[playerid][pDeaths]++;
  881.     return 1;
  882. }
  883. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  884. {
  885.     if(checkpointid == CP[SO])
  886.     {
  887.     if(tCheck[SO] == gTeam[playerid]) return SendClientMessage(playerid, COLOR_RED,"Ova zone je zauzeta od vaseg tima");
  888.     if(UnderAttack[SO] == 1) return SendClientMessage(playerid, COLOR_RED,"Ova zona je vec preuzeta!");
  889.     if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED,"Greska: Nemoze zauzeti u vozilu!");
  890.     UnderAttack[SO] = 1;
  891.     timer[playerid][SO] = SetTimerEx("SetZone",25000,false,"i", playerid);
  892.     if(gTeam[playerid] == TEAM_SWAT)
  893.     {
  894.     GangZoneFlashForAll(Zone[SO],0x0065E196);
  895.     SendClientMessageToAll(COLOR_RED,"VIJESTI: Tim Swat je zapoceo zauzimati Skladiste oruzija");
  896.     }
  897.     else if(gTeam[playerid] == TEAM_BALLAS)
  898.     {
  899.     GangZoneFlashForAll(Zone[SO],0xC90E5496);
  900.     SendClientMessageToAll(COLOR_RED,"VIJESTI: Tim Ballas je zapoceo zauzimati Skladiste oruzija");
  901.     }
  902.     SendClientMessage(playerid, COLOR_RED,"Ostani u Crvenom Markeru 25 Sekundi kako bi zauzeo zonu!");
  903.     zDefine[playerid] = SO;
  904.     }
  905.    
  906.     if(checkpointid == CP[SA])
  907.     {
  908.     if(tCheck[SA] == gTeam[playerid]) return SendClientMessage(playerid, COLOR_RED,"Ova zone je zauzeta od vaseg tima");
  909.     if(UnderAttack[SA] == 1) return SendClientMessage(playerid, COLOR_RED,"Ova zona je vec preuzeta!");
  910.     if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED,"Greska: Nemoze zauzeti u vozilu!");
  911.     UnderAttack[SA] = 1;
  912.     timer[playerid][SA] = SetTimerEx("SetZone",25000,false,"i", playerid);
  913.     if(gTeam[playerid] == TEAM_SWAT)
  914.     {
  915.     GangZoneFlashForAll(Zone[SA],0x0065E196);
  916.     SendClientMessageToAll(COLOR_RED,"VIJESTI: Tim Swat je zapoceo zauzimati Stadion");
  917.     }
  918.     else if(gTeam[playerid] == TEAM_BALLAS)
  919.     {
  920.     GangZoneFlashForAll(Zone[SA],0xC90E5496);
  921.     SendClientMessageToAll(COLOR_RED,"VIJESTI: Tim Ballas je zapoceo zauzimati Stadion");
  922.     }
  923.     SendClientMessage(playerid, COLOR_RED,"Ostani u Crvenom Markeru 25 Sekundi kako bi zauzeo zonu!");
  924.     zDefine[playerid] = SA;
  925.     }
  926.     return 1;
  927. }
  928. public OnPlayerLeaveDynamicCP(playerid, checkpointid)
  929. {
  930.     if(checkpointid == CP[SO])
  931.     {
  932.     UnderAttack[SO] = -1;
  933.     GangZoneStopFlashForAll(Zone[SO]);
  934.     KillTimer(timer[playerid][SO]);
  935.     }
  936.     if(checkpointid == CP[SA])
  937.     {
  938.     UnderAttack[SA] = -1;
  939.     GangZoneStopFlashForAll(Zone[SA]);
  940.     KillTimer(timer[playerid][SA]);
  941.     }
  942.     return 1;
  943. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement