Advertisement
FoxHound

iBump - Autoscooter

Mar 8th, 2011
607
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 21.33 KB | None | 0 0
  1.                      /**//**//**//**//**//**//**//**//**/
  2.                     /*+--------------------------------+*/
  3.                     /*|                                |*/
  4.                     /*|              iBump             |*/
  5.                     /*|          FILTERSCRIPT          |*/
  6.                     /*|      bY PSPgamer/FoxHound      |*/
  7.                     /*|            2 0 1 0             |*/
  8.                     /*|                                |*/
  9.                     /*+--------------------------------+*/
  10.                     /*|          14 AUGUST 2010        |*/
  11.                     /*+--------------------------------+*/
  12.                      /**//**//**//**//**//**//**//**//**/
  13.  
  14. #include <a_samp>
  15.  
  16. #define CostProChip 100                     // Standartly, ONE Chip Costs 100$
  17. #define RoundTime 2                         // Standartly: ONE Round = 2 Minutes (TIME AS MINUTES)
  18. #define RoundWaitTime 60                    // Standartly: Waiting for the Round=60 Sec (1 Minute)
  19. #define ENABLE_BUMPERCAR_INVULNERABLITY     //Comment this, if you want that the BumperCars should get damages
  20. #define ChipBuyPickupPos 230.7943,-1921.2220,7.4070
  21.  
  22. #define xD 7
  23.  
  24. new vortex[17],map[118],pickup[9],
  25.     pPickupCreated[MAX_PLAYERS],pChip[MAX_PLAYERS],
  26.     bRoundStarted=0,bRoundNextStatus;
  27.  
  28. #define RoundStartTimer(); bRoundNextStatus=1;SetTimer("RoundStatusChange",RoundWaitTime*1000,0);
  29. #define RoundWaitTimer(); bRoundNextStatus=0;SetTimer("RoundStatusChange",RoundTime*60000,0);
  30.  
  31. public OnFilterScriptInit()
  32. {
  33.     pickup[1] = CreatePickup(354, 23, 256.558044, -1971.587769, 17.531267, -1);
  34.     pickup[2] = CreatePickup(354, 23, 237.466705, -1973.062622, 17.729715, -1);
  35.     pickup[3] = CreatePickup(354, 23, 224.514618, -1973.132690, 18.044230, -1);
  36.     pickup[4] = CreatePickup(354, 23, 202.781738, -1971.958374, 17.248663, -1);
  37.     pickup[5] = CreatePickup(354, 23, 202.688568, -1939.581543, 17.274645, -1);
  38.     pickup[6] = CreatePickup(354, 23, 223.743042, -1937.108154, 17.880533, -1);
  39.     pickup[7] = CreatePickup(354, 23, 237.231216, -1937.441650, 17.872381, -1);
  40.     pickup[8] = CreatePickup(354, 23, 256.416229, -1938.911377, 17.170809, -1);
  41.  
  42.  //Map
  43.     map[0] = CreateObject(7020, 218.842209, -1972.776611, 3.432788, 0.0000, 0.0000, 0.0000,500.0);
  44.     map[1] = CreateObject(7020, 240.280426, -1972.490112, -3.377496, 0.0000, 179.5182, 360.0000,500.0);
  45.     map[2] = CreateObject(3886, 226.162476, -1892.088135, -1.137368, 354.8434, 0.0000, 180.0000,500.0);
  46.     map[3] = CreateObject(3886, 233.811157, -1891.736938, -1.079310, 355.7028, 0.0000, 180.0000,500.0);
  47.     map[4] = CreateObject(982, 202.394470, -1951.575195, 7.090132, 0.0000, 0.0000, 0.0000,500.0);
  48.     map[5] = CreateObject(982, 202.352554, -1959.156006, 7.090132, 0.0000, 0.0000, 0.0000,500.0);
  49.     map[6] = CreateObject(982, 256.770081, -1959.131226, 7.090132, 0.0000, 0.0000, 0.0000,500.0);
  50.     map[7] = CreateObject(982, 256.769775, -1951.530762, 7.090132, 0.0000, 0.0000, 0.0000,500.0);
  51.     map[8] = CreateObject(982, 244.029633, -1938.827515, 7.090132, 0.0000, 0.0000, 270.0000,500.0);
  52.     map[9] = CreateObject(982, 215.196167, -1938.773315, 7.065132, 0.0000, 0.0000, 270.0000,500.0);
  53.     map[10] = CreateObject(983, 229.612961, -1938.762207, 7.069036, 0.0000, 0.0000, 270.0000,500.0);
  54.     map[11] = CreateObject(982, 243.998215, -1971.950562, 7.090132, 0.0000, 0.0000, 270.0000,500.0);
  55.     map[12] = CreateObject(982, 215.184219, -1971.953857, 7.090132, 0.0000, 0.0000, 270.0000,500.0);
  56.     map[13] = CreateObject(983, 229.593399, -1971.951172, 7.090132, 0.0000, 0.0000, 270.0000,500.0);
  57.     map[14] = CreateObject(13667, 230.097839, -1923.580566, 21.907694, 0.0000, 1.7189, 101.2500,500.0);
  58.     map[15] = CreateObject(14387, 233.204788, -1937.303467, 7.040854, 0.0000, 348.8273, 90.0000,500.0);
  59.     map[16] = CreateObject(14387, 228.597473, -1937.292725, 7.040559, 0.0000, 348.8273, 90.0000,500.0);
  60.     map[17] = CreateObject(3877, 202.911514, -1939.477417, 8.064395, 0.0000, 0.0000, 0.0000,500.0);
  61.     map[18] = CreateObject(3877, 220.980530, -1939.412598, 8.064395, 0.0000, 0.0000, 0.0000,500.0);
  62.     map[19] = CreateObject(3877, 240.236588, -1939.654907, 8.064395, 0.0000, 0.0000, 0.0000,500.0);
  63.     map[20] = CreateObject(3877, 256.273560, -1939.150269, 8.064395, 0.0000, 0.0000, 0.0000,500.0);
  64.     map[21] = CreateObject(3877, 256.395905, -1971.598267, 8.064395, 0.0000, 0.0000, 0.0000,500.0);
  65.     map[22] = CreateObject(3877, 202.674850, -1971.703247, 8.064395, 0.0000, 0.0000, 0.0000,500.0);
  66.     map[23] = CreateObject(3864, 237.403336, -1937.018311, 12.507852, 0.0000, 0.0000, 90.0000,500.0);
  67.     map[24] = CreateObject(3864, 223.720703, -1936.684814, 12.507554, 0.0000, 0.0000, 90.0000,500.0);
  68.     map[25] = CreateObject(3472, 229.856552, -1899.549316, -3.378106, 0.0000, 0.0000, 269.9999,500.0);
  69.     map[26] = CreateObject(974, 271.682800, -1918.963989, 3.610756, 0.0000, 0.0000, 180.0000,500.0);
  70.     map[27] = CreateObject(974, 271.655090, -1918.937622, -1.866224, 0.0000, 0.0000, 180.0000,500.0);
  71.     map[28] = CreateObject(974, 271.643219, -1918.935791, -1.873265, 0.0000, 0.0000, 180.0000,500.0);
  72.     map[29] = CreateObject(974, 265.106201, -1919.007690, 3.632051, 0.0000, 0.0000, 180.0000,500.0);
  73.     map[30] = CreateObject(974, 265.121613, -1918.984741, -1.835307, 0.0000, 0.0000, 180.0000,500.0);
  74.     map[31] = CreateObject(974, 258.528198, -1919.030151, 3.640152, 0.0000, 0.0000, 180.0000,500.0);
  75.     map[32] = CreateObject(974, 258.534637, -1919.027466, -1.839334, 0.0000, 0.0000, 180.0000,500.0);
  76.     map[33] = CreateObject(974, 251.862930, -1919.035278, 3.632217, 0.0000, 0.0000, 180.0000,500.0);
  77.     map[34] = CreateObject(974, 251.873871, -1919.037720, -1.821839, 0.0000, 0.0000, 180.0000,500.0);
  78.     map[35] = CreateObject(974, 245.256180, -1919.045532, 3.607688, 0.0000, 0.0000, 180.0000,500.0);
  79.     map[36] = CreateObject(974, 245.250626, -1919.067627, -1.783203, 0.0000, 0.0000, 180.0000,500.0);
  80.     map[37] = CreateObject(974, 238.752457, -1919.028320, 3.604942, 0.0000, 0.0000, 180.0000,500.0);
  81.     map[38] = CreateObject(974, 238.731277, -1919.021362, -1.843206, 0.0000, 0.0000, 180.0000,500.0);
  82.     map[39] = CreateObject(974, 240.584564, -1922.356812, 3.761045, 0.0000, 0.0000, 270.0000,500.0);
  83.     map[40] = CreateObject(974, 240.597549, -1927.582153, 3.680803, 0.0000, 0.0000, 270.0000,500.0);
  84.     map[41] = CreateObject(974, 240.610291, -1934.250244, 3.702232, 0.0000, 0.0000, 270.0000,500.0);
  85.     map[42] = CreateObject(974, 240.618103, -1940.930420, 3.618938, 0.0000, 0.0000, 270.0000,500.0);
  86.     map[43] = CreateObject(974, 240.588074, -1922.353882, -1.703655, 0.0000, 0.0000, 270.0000,500.0);
  87.     map[44] = CreateObject(974, 240.599213, -1928.985840, -1.737350, 0.0000, 0.0000, 270.0000,500.0);
  88.     map[45] = CreateObject(974, 240.618134, -1935.565186, -1.769412, 0.0000, 0.0000, 270.0000,500.0);
  89.     map[46] = CreateObject(974, 274.964813, -1915.563599, 0.727134, 0.0000, 0.0000, 90.0000,500.0);
  90.     map[47] = CreateObject(974, 274.963562, -1908.884766, 0.716044, 0.0000, 0.0000, 90.0000,500.0);
  91.     map[48] = CreateObject(974, 274.982697, -1912.223267, -4.702021, 0.0000, 0.0000, 90.0000,500.0);
  92.     map[49] = CreateObject(974, 274.981995, -1915.586182, -4.674996, 0.0000, 0.0000, 90.0000,500.0);
  93.     map[50] = CreateObject(974, 199.267731, -1915.691040, 0.742507, 0.0000, 0.0000, 90.0000,500.0);
  94.     map[51] = CreateObject(974, 199.287079, -1915.693604, -4.717402, 0.0000, 0.0000, 90.0000,500.0);
  95.     map[52] = CreateObject(974, 202.512985, -1919.030151, 3.612507, 0.0000, 0.0000, 360.0000,500.0);
  96.     map[53] = CreateObject(974, 202.484055, -1919.052856, -1.802067, 0.0000, 0.0000, 360.0000,500.0);
  97.     map[54] = CreateObject(974, 209.189270, -1919.052734, -1.815940, 0.0000, 0.0000, 360.0000,500.0);
  98.     map[55] = CreateObject(974, 209.213120, -1919.069946, 3.632793, 0.0000, 0.0000, 360.0000,500.0);
  99.     map[56] = CreateObject(974, 215.862793, -1919.029541, -1.825749, 0.0000, 0.0000, 360.0000,500.0);
  100.     map[57] = CreateObject(974, 215.863068, -1919.021729, 3.597453, 0.0000, 0.0000, 360.0000,500.0);
  101.     map[58] = CreateObject(974, 222.373779, -1919.085693, -1.775777, 0.0000, 0.0000, 360.0000,500.0);
  102.     map[59] = CreateObject(974, 222.425705, -1919.027832, 3.633120, 0.0000, 0.0000, 360.0000,500.0);
  103.     map[60] = CreateObject(974, 220.667679, -1922.408691, -1.821517, 0.0000, 0.0000, 269.9999,500.0);
  104.     map[61] = CreateObject(974, 220.675552, -1922.392334, 3.672257, 0.0000, 0.0000, 269.9999,500.0);
  105.     map[62] = CreateObject(974, 220.671478, -1929.068481, -1.808703, 0.0000, 0.0000, 269.9999,500.0);
  106.     map[63] = CreateObject(974, 220.676941, -1929.080811, 3.647152, 0.0000, 0.0000, 269.9999,500.0);
  107.     map[64] = CreateObject(974, 220.654633, -1935.740356, 3.624292, 0.0000, 0.0000, 269.9999,500.0);
  108.     map[65] = CreateObject(974, 220.681030, -1935.688110, -1.864830, 0.0000, 0.0000, 269.9999,500.0);
  109.     map[66] = CreateObject(967, 230.808746, -1922.973267, 6.410826, 0.0000, 0.0000, 0.0000,500.0);
  110.     map[67] = CreateObject(3010, 231.021790, -1923.288574, 6.901157, 30.0803, 0.0000, 334.8443,500.0);
  111.     map[68] = CreateObject(3007, 231.022995, -1923.184204, 7.031453, 317.0282, 358.2811, 9.2992,500.0);
  112.     map[69] = CreateObject(3008, 230.833130, -1922.967041, 7.155719, 312.7310, 69.6143, 357.4217,500.0);
  113.     map[70] = CreateObject(3009, 231.015137, -1923.271729, 7.079129, 310.1527, 58.4416, 101.0180,500.0);
  114.     map[71] = CreateObject(1663, 230.830139, -1923.144287, 6.871040, 0.0000, 0.0000, 168.7500,500.0);
  115.     map[72] = CreateObject(3010, 230.801773, -1923.212402, 6.898202, 30.0803, 0.0000, 348.7500,500.0);
  116.     map[73] = CreateObject(3012, 231.100937, -1922.791504, 7.124330, 343.6707, 338.5141, 15.4699,500.0);
  117.     map[74] = CreateObject(8373, 237.109375, -1905.491821, -24.382109, 0.0000, 0.0000, 180.0000,500.0);
  118.     map[75] = CreateObject(1270, 230.521271, -1922.814697, 6.779050, 0.0000, 0.0000, 0.0000,500.0);
  119.     map[76] = CreateObject(1471, 230.788330, -1921.866821, 6.047118, 91.9597, 0.0000, 0.0000,500.0);
  120.     map[77] = CreateObject(1252, 231.430084, -1923.249512, 7.355108, 0.0000, 0.0000, 270.0000,500.0);
  121.     map[78] = CreateObject(3522, 259.043304, -1913.745850, 3.446308, 0.0000, 0.0000, 90.0000,500.0);
  122.     map[79] = CreateObject(3522, 211.615616, -1913.795044, 3.446308, 0.0000, 0.0000, 90.0000,500.0);
  123.     map[80] = CreateObject(744, 221.867218, -1892.431763, -0.291512, 5.1566, 0.0000, 0.0000,500.0);
  124.     map[81] = CreateObject(744, 239.816315, -1892.004272, -0.113833, 6.8755, 0.0000, 56.2500,500.0);
  125.     map[82] = CreateObject(3660, 264.954102, -1915.030762, 9.061969, 0.0000, 0.0000, 0.0000,500.0);
  126.     map[83] = CreateObject(3660, 251.043732, -1915.602905, 9.061969, 0.0000, 0.0000, 180.0000,500.0);
  127.     map[84] = CreateObject(3660, 210.204041, -1916.019165, 9.061971, 0.0000, 0.0000, 180.0000,500.0);
  128.     map[88] = CreateObject(3802, 226.241898, -1900.761475, 3.859141, 0.0000, 0.0000, 92.6556,500.0);
  129.     map[89] = CreateObject(3802, 224.919540, -1900.761230, 3.772731, 0.0000, 0.0000, 92.6556,500.0);
  130.     map[90] = CreateObject(3802, 233.603409, -1900.769165, 3.774775, 0.0000, 0.0000, 92.6556,500.0);
  131.     map[91] = CreateObject(3802, 234.878113, -1900.766968, 3.747672, 0.0000, 0.0000, 92.6556,500.0);
  132.     map[92] = CreateObject(15038, 229.481323, -1922.742310, 7.024141, 0.0000, 0.0000, 0.0000,500.0);
  133.     map[93] = CreateObject(15038, 232.224731, -1922.609863, 7.024141, 0.0000, 0.0000, 0.0000,500.0);
  134.     map[94] = CreateObject(718, 272.465820, -1912.896729, 3.317765, 0.0000, 0.0000, 0.0000,500.0);
  135.     map[95] = CreateObject(718, 272.149261, -1908.432617, 3.316726, 0.0000, 0.0000, 0.0000,500.0);
  136.     map[96] = CreateObject(718, 272.238495, -1903.713501, 3.316728, 0.0000, 0.0000, 0.0000,500.0);
  137.     map[97] = CreateObject(718, 272.230804, -1899.253540, 3.316728, 0.0000, 0.0000, 0.0000,500.0);
  138.     map[98] = CreateObject(718, 202.856857, -1899.359375, 3.317765, 0.0000, 0.0000, 0.0000,500.0);
  139.     map[99] = CreateObject(718, 202.915985, -1903.805664, 3.317765, 0.0000, 0.0000, 0.0000,500.0);
  140.     map[100] = CreateObject(718, 202.824036, -1908.236206, 3.317765, 0.0000, 0.0000, 0.0000,500.0);
  141.     map[101] = CreateObject(718, 202.832779, -1912.545166, 3.317765, 0.0000, 0.0000, 0.0000,500.0);
  142.     map[102] = CreateObject(717, 260.920105, -1899.133911, 3.615000, 0.0000, 0.0000, 0.0000,500.0);
  143.     map[103] = CreateObject(717, 248.308807, -1898.823364, 3.613962, 0.0000, 0.0000, 0.0000,500.0);
  144.     map[104] = CreateObject(717, 209.047852, -1898.912598, 3.615000, 0.0000, 0.0000, 0.0000,500.0);
  145.     map[105] = CreateObject(717, 217.793259, -1899.156250, 3.615000, 0.0000, 0.0000, 0.0000,500.0);
  146.     map[106] = CreateObject(1210, 231.407455, -1922.812378, 6.555391, 0.0000, 0.0000, 90.0000,500.0);
  147.     map[107] = CreateObject(982, 230.637238, -1924.932373, 18.040514, 93.6785, 0.0000, 272.3375,500.0);
  148.     map[108] = CreateObject(2222, 230.277252, -1923.228760, 6.451786, 0.0000, 0.0000, 33.7500,500.0);
  149.     map[109] = CreateObject(2044, 231.507416, -1923.268555, 7.706479, 1.7189, 126.3373, 0.0000,500.0);
  150.     map[110] = CreateObject(3864, 224.550598, -1973.556030, 12.495680, 0.0000, 0.0000, 270.0000,500.0);
  151.     map[111] = CreateObject(3864, 237.283020, -1973.485962, 12.294857, 0.0000, 0.0000, 270.0000,500.0);
  152.     map[112] = CreateObject(1412, 237.448532, -1973.891724, 6.295784, 89.3814, 359.1406, 0.0000,500.0);
  153.     map[113] = CreateObject(1412, 224.406921, -1973.935425, 6.317168, 89.3814, 359.1406, 0.0000,500.0);
  154.     map[114] = CreateObject(3864, 256.831238, -1938.770630, 11.929991, 0.0000, 0.0000, 33.7499,500.0);
  155.     map[115] = CreateObject(3864, 202.475433, -1939.196045, 11.924023, 0.0000, 0.0000, 135.0000,500.0);
  156.     map[116] = CreateObject(3864, 202.305923, -1972.149536, 11.907219, 0.0000, 0.0000, 236.2500,500.0);
  157.     map[117] = CreateObject(3864, 256.772278, -1971.972168, 11.895689, 0.0000, 0.0000, 315.0000,500.0);
  158.  //Vehicles
  159.     vortex[0] = AddStaticVehicle(539,205.6203,-1970.1381,6.7588,269.7800,-1,-1); // vortex 1
  160.     vortex[1] = AddStaticVehicle(539,205.7458,-1966.9297,6.7588,270.2076,-1,-1); // vortex 2
  161.     vortex[2] = AddStaticVehicle(539,205.8162,-1963.8309,6.7588,266.3605,-1,-1); // vortex 3
  162.     vortex[3] = AddStaticVehicle(539,205.9396,-1960.5295,6.7588,267.6601,-1,-1); // vortex 4
  163.     vortex[4] = AddStaticVehicle(539,205.7356,-1957.1178,6.7588,268.6284,-1,-1); // vortex 5
  164.     vortex[5] = AddStaticVehicle(539,205.7949,-1953.8346,6.7532,270.5078,-1,-1); // vortex 6
  165.     vortex[6] = AddStaticVehicle(539,205.7412,-1950.2079,6.7588,273.3279,-1,-1); // vortex 7
  166.     vortex[7] = AddStaticVehicle(539,205.8260,-1946.6357,6.7590,266.7478,-1,-1); // vortex 8
  167.     vortex[8] = AddStaticVehicle(539,205.9477,-1943.0087,6.7589,269.8812,-1,-1); // vortex 9
  168.     vortex[9] = AddStaticVehicle(539,253.3609,-1941.7269,6.7587,89.1423,-1,-1); // vortex 9
  169.     vortex[10] = AddStaticVehicle(539,253.2638,-1945.5585,6.7633,86.3223,-1,-1); // vortex 10
  170.     vortex[11] = AddStaticVehicle(539,252.9221,-1949.2660,6.7587,86.3222,-1,-1); // vortex 11
  171.     vortex[12] = AddStaticVehicle(539,253.0848,-1953.0674,6.7588,87.8890,-1,-1); // vortex 12
  172.     vortex[13] = AddStaticVehicle(539,252.9968,-1956.7673,6.7588,87.7032,-1,-1); // vortex 13
  173.     vortex[14] = AddStaticVehicle(539,253.0719,-1960.3640,6.7584,88.3299,-1,-1); // vortex 14
  174.     vortex[15] = AddStaticVehicle(539,253.0696,-1964.2434,6.7588,88.1933,-1,-1); // vortex 15
  175.     vortex[16] = AddStaticVehicle(539,253.1736,-1968.0837,6.7588,88.2475,-1,-1); // vortex 16
  176.  
  177.     RoundStartTimer();
  178.     return 1;
  179. }
  180.  
  181. public OnFilterScriptExit()
  182. {
  183.     for(new CurrentVortex=0;CurrentVortex<sizeof(vortex);CurrentVortex++) { DestroyVehicle(vortex[CurrentVortex]); } // Destroy's all created Vortex's on Filterscript unload
  184.     for(new CurrentObject=0;CurrentObject<sizeof(map);CurrentObject++) { DestroyObject(map[CurrentObject]); } // Destroy's all created Objects on Filterscript unload
  185.     for(new CurrentPickup=0;CurrentPickup<sizeof(pickup);CurrentPickup++) { DestroyPickup(pickup[CurrentPickup]); } // Destroy's all created Pickups on Filterscript unload
  186.     return 1;
  187. }
  188.  
  189. public OnPlayerUpdate(playerid)
  190. {
  191.     if(IsPlayerInRangeOfPoint(playerid,100.0,ChipBuyPickupPos) && (!pPickupCreated[playerid]) && (!bRoundStarted) && (pChip[playerid]<=0))
  192.     {
  193.         pickup[0] = CreatePickup(1935,2,ChipBuyPickupPos,-1);
  194.         pPickupCreated[playerid]=1;
  195.     }
  196.     else if((!IsPlayerInRangeOfPoint(playerid,100.0,ChipBuyPickupPos) && pPickupCreated[playerid]))
  197.     {
  198.         DestroyPickup(pickup[0]);
  199.         pPickupCreated[playerid]=0;
  200.     }
  201.     #if defined ENABLE_BUMPERCAR_INVULNERABLITY
  202.         if(IsPlayerInBumperCar(playerid)) { SetVehicleHealth(GetPlayerVehicleID(playerid),1000); }
  203.     #endif
  204.     return 1;
  205. }
  206.  
  207. public OnPlayerPickUpPickup(playerid, pickupid)
  208. {
  209.     if(pickupid==pickup[0])
  210.     {
  211.         if(pPickupCreated[playerid] && !IsPlayerInAnyVehicle(playerid) && !bRoundStarted)
  212.         {
  213.             new c_str_[128];
  214.             SetPlayerCameraPos(playerid, 230.819687, -1922.545776, 7.701454);
  215.             SetPlayerCameraLookAt(playerid, 230.848038, -1923.123657, 7.718326);
  216.             format(c_str_,sizeof(c_str_),"Willkommen.\nWolltest du etwa einen Fahrchip  für die Autscooter kaufen ?\nEin Fahrchip kostet %d$, und eine Runde dauert 2 Minuten.",CostProChip,RoundTime);
  217.             ShowPlayerDialog(playerid, xD, DIALOG_STYLE_MSGBOX,"Chips",c_str_,"Fahrchip kaufen","Schließen");
  218.         }
  219.     }
  220.     return 1;
  221. }
  222.  
  223. public OnPlayerEnterVehicle(playerid, vehicleid)
  224. {
  225.     if(IsABumperCar(vehicleid))
  226.     {
  227.         new string[128];
  228.         if(!pChip[playerid])
  229.         {
  230.             format(string,sizeof(string),"* Du hast keinen Fahrchip !");
  231.             TogglePlayerControllable(playerid,0);
  232.             ClearAnimations(playerid);
  233.             TogglePlayerControllable(playerid,1);
  234.             SendClientMessage(playerid,0xFFFFFFAA,string);
  235.         }
  236.         if(IsVehicleOccupied(vehicleid))
  237.         {
  238.             format(string,sizeof(string),"* Dieser Autoscooter ist besetzt, nimm einen anderen.");
  239.             TogglePlayerControllable(playerid,0);
  240.             ClearAnimations(playerid);
  241.             TogglePlayerControllable(playerid,1);
  242.             SendClientMessage(playerid,0xFFFFFFAA,string);
  243.         }
  244.     }
  245.     return 1;
  246. }
  247.  
  248. public OnPlayerStateChange(playerid, newstate, oldstate)
  249. {
  250.     if((newstate == PLAYER_STATE_DRIVER) && IsABumperCar(GetPlayerVehicleID(playerid)))
  251.     {
  252.         if(!pChip[playerid] || bRoundStarted) { RemovePlayerFromVehicle(playerid); }
  253.         else
  254.         {
  255.             SendClientMessage(playerid,0xFFFFFFAA,"* Du hast deinen Fahrchip eingeworfen.");
  256.             SendClientMessage(playerid,0xFFFFFFAA,"* Bitte warte auf die naechste Runde.");
  257.             pChip[playerid]=0;
  258.             TogglePlayerControllable(playerid,0);
  259.         }
  260.     }
  261.     return 1;
  262. }
  263.  
  264. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  265. {
  266.     if(dialogid==xD)
  267.     {
  268.         new c_str_[128];
  269.         if(response==0) { format(c_str_,sizeof(c_str_),"Verkäufer: Schönen Tag noch, was ohne diese Autoscooter eigentlich nicht möglich ist!"); }
  270.         if(response==1)
  271.         {
  272.             if(GetPlayerMoney(playerid) < CostProChip) {format(c_str_,sizeof(c_str_),"Verkäufer: Ein Fahrchip kostet %d$! Du hast nicht genug, und jetzt weg hier!",CostProChip); }
  273.             else
  274.             {
  275.                 GivePlayerMoney(playerid,-CostProChip);
  276.                 pChip[playerid]=1;
  277.                 format(c_str_,sizeof(c_str_),"Verkäufer: Du hast dir einen Fahrchip für %d$ gekauft. Steige nun in einen Autoscooter. Viel Spaß!",CostProChip);
  278.             }
  279.         }
  280.         SendClientMessage(playerid,0xFFFFFFAA,c_str_);
  281.         SetCameraBehindPlayer(playerid);
  282.     }
  283.     return 1;
  284. }
  285.  
  286. forward RoundStatusChange();
  287. public RoundStatusChange()
  288. {
  289.     if(bRoundNextStatus) //Round START
  290.     {
  291.         for(new i=0;i<MAX_PLAYERS;i++)
  292.         {
  293.             if(IsPlayerInBumperCar(i))
  294.             {
  295.                 GameTextForPlayer(i,"~>~Autoscooter~<~~n~~w~Runde ~g~getartet",3000,3);
  296.                 TogglePlayerControllable(i,1);
  297.             }
  298.         }
  299.         RoundWaitTimer();
  300.     }
  301.     else if(!bRoundNextStatus)
  302.     {
  303.         for(new i=0;i<MAX_PLAYERS;i++)
  304.         {
  305.             if(IsPlayerInBumperCar(i))
  306.             {
  307.                 GameTextForPlayer(i,"~>~Autoscooter~<~~n~~w~Runde ~r~beendet",3000,3);
  308.                 RemovePlayerFromVehicle(i);
  309.                 RespawnAllBumperCars();
  310.                 TogglePlayerControllable(i,1);
  311.             }
  312.         }
  313.         RoundStartTimer();
  314.     }
  315.     return 1;
  316. }
  317.  
  318. forward IsPlayerInBumperCar(playerid);
  319. public IsPlayerInBumperCar(playerid)
  320. {
  321.     if((GetPlayerState(playerid)==PLAYER_STATE_DRIVER) && IsABumperCar(GetPlayerVehicleID(playerid))) { return 1; }
  322.     return 0;
  323. }
  324.  
  325. forward IsABumperCar(vehicleid);
  326. public IsABumperCar(vehicleid)
  327. {
  328.     if(GetVehicleModel(vehicleid) == 539) { return 1; }
  329.     return 0;
  330. }
  331.  
  332. forward IsVehicleOccupied(vehicleid);
  333. public IsVehicleOccupied(vehicleid)
  334. {
  335.     for(new p=0;p<MAX_PLAYERS;p++) { if(IsPlayerInVehicle(p,vehicleid)) { return 1; } }
  336.     return 0;
  337. }
  338.  
  339. stock RespawnAllBumperCars()
  340. {
  341.     for(new bCar;bCar<sizeof(vortex);bCar++) { DestroyVehicle(vortex[bCar]); }
  342.     vortex[0] = AddStaticVehicle(539,205.6203,-1970.1381,6.7588,269.7800,-1,-1); // vortex 1
  343.     vortex[1] = AddStaticVehicle(539,205.7458,-1966.9297,6.7588,270.2076,-1,-1); // vortex 2
  344.     vortex[2] = AddStaticVehicle(539,205.8162,-1963.8309,6.7588,266.3605,-1,-1); // vortex 3
  345.     vortex[3] = AddStaticVehicle(539,205.9396,-1960.5295,6.7588,267.6601,-1,-1); // vortex 4
  346.     vortex[4] = AddStaticVehicle(539,205.7356,-1957.1178,6.7588,268.6284,-1,-1); // vortex 5
  347.     vortex[5] = AddStaticVehicle(539,205.7949,-1953.8346,6.7532,270.5078,-1,-1); // vortex 6
  348.     vortex[6] = AddStaticVehicle(539,205.7412,-1950.2079,6.7588,273.3279,-1,-1); // vortex 7
  349.     vortex[7] = AddStaticVehicle(539,205.8260,-1946.6357,6.7590,266.7478,-1,-1); // vortex 8
  350.     vortex[8] = AddStaticVehicle(539,205.9477,-1943.0087,6.7589,269.8812,-1,-1); // vortex 9
  351.     vortex[9] = AddStaticVehicle(539,253.3609,-1941.7269,6.7587,89.1423,-1,-1); // vortex 9
  352.     vortex[10] = AddStaticVehicle(539,253.2638,-1945.5585,6.7633,86.3223,-1,-1); // vortex 10
  353.     vortex[11] = AddStaticVehicle(539,252.9221,-1949.2660,6.7587,86.3222,-1,-1); // vortex 11
  354.     vortex[12] = AddStaticVehicle(539,253.0848,-1953.0674,6.7588,87.8890,-1,-1); // vortex 12
  355.     vortex[13] = AddStaticVehicle(539,252.9968,-1956.7673,6.7588,87.7032,-1,-1); // vortex 13
  356.     vortex[14] = AddStaticVehicle(539,253.0719,-1960.3640,6.7584,88.3299,-1,-1); // vortex 14
  357.     vortex[15] = AddStaticVehicle(539,253.0696,-1964.2434,6.7588,88.1933,-1,-1); // vortex 15
  358.     vortex[16] = AddStaticVehicle(539,253.1736,-1968.0837,6.7588,88.2475,-1,-1); // vortex 16
  359. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement