func.inc 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185
  1. #include <a_samp>
  2. /*
  3. native ReturnComponentSlot(componentid);
  4. native GetVehicle2DZone(vehicleid, zone[], len);
  5. native split(const strsrc[], strdest[][], delim);
  6. native strtok(const string[], &index);
  7. native GetVehicleName(vehicleid);
  8. native GetVehicleNameByModel(modelid);
  9. native sscanf(string[], format[], {Float,_}:...);
  10. native PlayerName(playerid);
  11. */
  12. new spoiler[20][0] = {1000, 1001, 1002, 1003, 1014, 1015, 1016, 1023, 1058, 1060, 1049, 1050, 1138, 1139, 1146, 1147, 1158, 1162, 1163, 1164};
  13. new nitro[3][0] = {1008, 1009, 1010};
  14. new front_bumper[23][0] = {1117, 1152, 1153, 1155, 1157, 1160, 1165, 1167, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1179, 1181, 1182, 1185, 1188, 1189, 1192, 1193};
  15. new rear_bumper[22][0] = {1140, 1141, 1148, 1149, 1150, 1151, 1154, 1156, 1159, 1161, 1166, 1168, 1176, 1177, 1178, 1180, 1183, 1184, 1186, 1187, 1190, 1191};
  16. new exhaust[28][0] = {1018, 1019, 1020, 1021, 1022, 1028, 1029, 1037, 1043, 1044, 1045, 1046, 1059, 1064, 1065, 1066, 1089, 1092, 1104, 1105, 1113, 1114, 1126, 1127, 1129, 1132, 1135, 1136};
  17. new bventr[2][0] = {1042, 1044};
  18. new bventl[2][0] = {1043, 1045};
  19. new bscoop[4][0] = {1004, 1005, 1011, 1012};
  20. new rscoop[13][0] = {1006, 1032, 1033, 1035, 1038, 1053, 1054, 1055, 1061, 1067, 1068, 1088, 1091};
  21. new left_sideskirt[21][0] = {1007, 1026, 1031, 1036, 1039, 1042, 1047, 1048, 1056, 1057, 1069, 1070, 1090, 1093, 1106, 1108, 1118, 1119, 1133, 1122, 1134};
  22. new right_sideskirt[21][0] = {1017, 1027, 1030, 1040, 1041, 1051, 1052, 1062, 1063, 1071, 1072, 1094, 1095, 1099, 1101, 1102, 1107, 1120, 1121, 1124, 1137};
  23. new hydraulics[1][0] = {1087};
  24. new bass[1][0] = {1086};
  25. new rbbars[2][0] = {1109, 1110};
  26. new fbbars[2][0] = {1115, 1116};
  27. new wheels[17][0] = {1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1096, 1097, 1098};
  28. new lights[2][0] = {1013, 1024};
  29. stock ReturnComponentSlot(componentid)
  30. {
  31. new i = 0;
  32. for(i = 0; i < 20; i ++) { if(spoiler[i][0] == componentid) { return 1; } }
  33. for(i = 0; i < 3; i ++) { if(nitro[i][0] == componentid) { return 2; } }
  34. for(i = 0; i < 23; i ++) { if(front_bumper[i][0] == componentid) { return 3; } }
  35. for(i = 0; i < 22; i ++) { if(rear_bumper[i][0] == componentid) { return 4; } }
  36. for(i = 0; i < 28; i ++) { if(exhaust[i][0] == componentid) { return 5; } }
  37. for(i = 0; i < 2; i ++) { if(bventr[i][0] == componentid) { return 6; } }
  38. for(i = 0; i < 2; i ++) { if(bventl[i][0] == componentid) { return 7; } }
  39. for(i = 0; i < 4; i ++) { if(bscoop[i][0] == componentid) { return 8; } }
  40. for(i = 0; i < 13; i ++) { if(rscoop[i][0] == componentid) { return 9; } }
  41. for(i = 0; i < 21; i ++) { if(left_sideskirt[i][0] == componentid) { return 10; } }
  42. for(i = 0; i < 21; i ++) { if(right_sideskirt[i][0] == componentid) { return 11; } }
  43. if(hydraulics[0][0] == componentid) { return 12; }
  44. if(bass[0][0] == componentid) { return 13; }
  45. for(i = 0; i < 2; i ++) { if(rbbars[i][0] == componentid) { return 14; } }
  46. for(i = 0; i < 2; i ++) { if(fbbars[i][0] == componentid) { return 15; } }
  47. for(i = 0; i < 17; i ++) { if(wheels[i][0] == componentid) { return 16; } }
  48. for(i = 0; i < 2; i ++) { if(lights[i][0] == componentid) { return 17; } }
  49. return 0;
  50. }
  51. enum SAZONE_MAIN
  52. {
  53. SAZONE_NAME[28],
  54. Float:SAZONE_AREA[6]
  55. };
  56. static const gSAZones[][SAZONE_MAIN] =
  57. {
  58. {"The Big Ear", {-410.00,1403.30,-3.00,-137.90,1681.20,200.00}},
  59. {"Aldea Malvada", {-1372.10,2498.50,0.00,-1277.50,2615.30,200.00}},
  60. {"Angel Pine", {-2324.90,-2584.20,-6.10,-1964.20,-2212.10,200.00}},
  61. {"Arco del Oeste", {-901.10,2221.80,0.00,-592.00,2571.90,200.00}},
  62. {"Avispa Country Club", {-2646.40,-355.40,0.00,-2270.00,-222.50,200.00}},
  63. {"Avispa Country Club", {-2831.80,-430.20,-6.10,-2646.40,-222.50,200.00}},
  64. {"Avispa Country Club", {-2361.50,-417.10,0.00,-2270.00,-355.40,200.00}},
  65. {"Avispa Country Club", {-2667.80,-302.10,-28.80,-2646.40,-262.30,71.10}},
  66. {"Avispa Country Club", {-2470.00,-355.40,0.00,-2270.00,-318.40,46.10}},
  67. {"Avispa Country Club", {-2550.00,-355.40,0.00,-2470.00,-318.40,39.70}},
  68. {"Back o Beyond", {-1166.90,-2641.10,0.00,-321.70,-1856.00,200.00}},
  69. {"Battery Point", {-2741.00,1268.40,-4.50,-2533.00,1490.40,200.00}},
  70. {"Bayside", {-2741.00,2175.10,0.00,-2353.10,2722.70,200.00}},
  71. {"Bayside Marina", {-2353.10,2275.70,0.00,-2153.10,2475.70,200.00}},
  72. {"Beacon Hill", {-399.60,-1075.50,-1.40,-319.00,-977.50,198.50}},
  73. {"Blackfield", {964.30,1203.20,-89.00,1197.30,1403.20,110.90}},
  74. {"Blackfield", {964.30,1403.20,-89.00,1197.30,1726.20,110.90}},
  75. {"Blackfield Chapel", {1375.60,596.30,-89.00,1558.00,823.20,110.90}},
  76. {"Blackfield Chapel", {1325.60,596.30,-89.00,1375.60,795.00,110.90}},
  77. {"Blackfield Intersection", {1197.30,1044.60,-89.00,1277.00,1163.30,110.90}},
  78. {"Blackfield Intersection", {1166.50,795.00,-89.00,1375.60,1044.60,110.90}},
  79. {"Blackfield Intersection", {1277.00,1044.60,-89.00,1315.30,1087.60,110.90}},
  80. {"Blackfield Intersection", {1375.60,823.20,-89.00,1457.30,919.40,110.90}},
  81. {"Blueberry", {104.50,-220.10,2.30,349.60,152.20,200.00}},
  82. {"Blueberry", {19.60,-404.10,3.80,349.60,-220.10,200.00}},
  83. {"Blueberry Acres", {-319.60,-220.10,0.00,104.50,293.30,200.00}},
  84. {"Caligula's Palace", {2087.30,1543.20,-89.00,2437.30,1703.20,110.90}},
  85. {"Caligula's Palace", {2137.40,1703.20,-89.00,2437.30,1783.20,110.90}},
  86. {"Calton Heights", {-2274.10,744.10,-6.10,-1982.30,1358.90,200.00}},
  87. {"Chinatown", {-2274.10,578.30,-7.60,-2078.60,744.10,200.00}},
  88. {"City Hall", {-2867.80,277.40,-9.10,-2593.40,458.40,200.00}},
  89. {"Come-A-Lot", {2087.30,943.20,-89.00,2623.10,1203.20,110.90}},
  90. {"Commerce", {1323.90,-1842.20,-89.00,1701.90,-1722.20,110.90}},
  91. {"Commerce", {1323.90,-1722.20,-89.00,1440.90,-1577.50,110.90}},
  92. {"Commerce", {1370.80,-1577.50,-89.00,1463.90,-1384.90,110.90}},
  93. {"Commerce", {1463.90,-1577.50,-89.00,1667.90,-1430.80,110.90}},
  94. {"Commerce", {1583.50,-1722.20,-89.00,1758.90,-1577.50,110.90}},
  95. {"Commerce", {1667.90,-1577.50,-89.00,1812.60,-1430.80,110.90}},
  96. {"Conference Center", {1046.10,-1804.20,-89.00,1323.90,-1722.20,110.90}},
  97. {"Conference Center", {1073.20,-1842.20,-89.00,1323.90,-1804.20,110.90}},
  98. {"Cranberry Station", {-2007.80,56.30,0.00,-1922.00,224.70,100.00}},
  99. {"Creek", {2749.90,1937.20,-89.00,2921.60,2669.70,110.90}},
  100. {"Dillimore", {580.70,-674.80,-9.50,861.00,-404.70,200.00}},
  101. {"Doherty", {-2270.00,-324.10,-0.00,-1794.90,-222.50,200.00}},
  102. {"Doherty", {-2173.00,-222.50,-0.00,-1794.90,265.20,200.00}},
  103. {"Downtown", {-1982.30,744.10,-6.10,-1871.70,1274.20,200.00}},
  104. {"Downtown", {-1871.70,1176.40,-4.50,-1620.30,1274.20,200.00}},
  105. {"Downtown", {-1700.00,744.20,-6.10,-1580.00,1176.50,200.00}},
  106. {"Downtown", {-1580.00,744.20,-6.10,-1499.80,1025.90,200.00}},
  107. {"Downtown", {-2078.60,578.30,-7.60,-1499.80,744.20,200.00}},
  108. {"Downtown", {-1993.20,265.20,-9.10,-1794.90,578.30,200.00}},
  109. {"Downtown Los Santos", {1463.90,-1430.80,-89.00,1724.70,-1290.80,110.90}},
  110. {"Downtown Los Santos", {1724.70,-1430.80,-89.00,1812.60,-1250.90,110.90}},
  111. {"Downtown Los Santos", {1463.90,-1290.80,-89.00,1724.70,-1150.80,110.90}},
  112. {"Downtown Los Santos", {1370.80,-1384.90,-89.00,1463.90,-1170.80,110.90}},
  113. {"Downtown Los Santos", {1724.70,-1250.90,-89.00,1812.60,-1150.80,110.90}},
  114. {"Downtown Los Santos", {1370.80,-1170.80,-89.00,1463.90,-1130.80,110.90}},
  115. {"Downtown Los Santos", {1378.30,-1130.80,-89.00,1463.90,-1026.30,110.90}},
  116. {"Downtown Los Santos", {1391.00,-1026.30,-89.00,1463.90,-926.90,110.90}},
  117. {"Downtown Los Santos", {1507.50,-1385.20,110.90,1582.50,-1325.30,335.90}},
  118. {"East Beach", {2632.80,-1852.80,-89.00,2959.30,-1668.10,110.90}},
  119. {"East Beach", {2632.80,-1668.10,-89.00,2747.70,-1393.40,110.90}},
  120. {"East Beach", {2747.70,-1668.10,-89.00,2959.30,-1498.60,110.90}},
  121. {"East Beach", {2747.70,-1498.60,-89.00,2959.30,-1120.00,110.90}},
  122. {"East Los Santos", {2421.00,-1628.50,-89.00,2632.80,-1454.30,110.90}},
  123. {"East Los Santos", {2222.50,-1628.50,-89.00,2421.00,-1494.00,110.90}},
  124. {"East Los Santos", {2266.20,-1494.00,-89.00,2381.60,-1372.00,110.90}},
  125. {"East Los Santos", {2381.60,-1494.00,-89.00,2421.00,-1454.30,110.90}},
  126. {"East Los Santos", {2281.40,-1372.00,-89.00,2381.60,-1135.00,110.90}},
  127. {"East Los Santos", {2381.60,-1454.30,-89.00,2462.10,-1135.00,110.90}},
  128. {"East Los Santos", {2462.10,-1454.30,-89.00,2581.70,-1135.00,110.90}},
  129. {"Easter Basin", {-1794.90,249.90,-9.10,-1242.90,578.30,200.00}},
  130. {"Easter Basin", {-1794.90,-50.00,-0.00,-1499.80,249.90,200.00}},
  131. {"Easter Bay Airport", {-1499.80,-50.00,-0.00,-1242.90,249.90,200.00}},
  132. {"Easter Bay Airport", {-1794.90,-730.10,-3.00,-1213.90,-50.00,200.00}},
  133. {"Easter Bay Airport", {-1213.90,-730.10,0.00,-1132.80,-50.00,200.00}},
  134. {"Easter Bay Airport", {-1242.90,-50.00,0.00,-1213.90,578.30,200.00}},
  135. {"Easter Bay Airport", {-1213.90,-50.00,-4.50,-947.90,578.30,200.00}},
  136. {"Easter Bay Airport", {-1315.40,-405.30,15.40,-1264.40,-209.50,25.40}},
  137. {"Easter Bay Airport", {-1354.30,-287.30,15.40,-1315.40,-209.50,25.40}},
  138. {"Easter Bay Airport", {-1490.30,-209.50,15.40,-1264.40,-148.30,25.40}},
  139. {"Easter Bay Chemicals", {-1132.80,-768.00,0.00,-956.40,-578.10,200.00}},
  140. {"Easter Bay Chemicals", {-1132.80,-787.30,0.00,-956.40,-768.00,200.00}},
  141. {"El Castillo del Diablo", {-464.50,2217.60,0.00,-208.50,2580.30,200.00}},
  142. {"El Castillo del Diablo", {-208.50,2123.00,-7.60,114.00,2337.10,200.00}},
  143. {"El Castillo del Diablo", {-208.50,2337.10,0.00,8.40,2487.10,200.00}},
  144. {"El Corona", {1812.60,-2179.20,-89.00,1970.60,-1852.80,110.90}},
  145. {"El Corona", {1692.60,-2179.20,-89.00,1812.60,-1842.20,110.90}},
  146. {"El Quebrados", {-1645.20,2498.50,0.00,-1372.10,2777.80,200.00}},
  147. {"Esplanade East", {-1620.30,1176.50,-4.50,-1580.00,1274.20,200.00}},
  148. {"Esplanade East", {-1580.00,1025.90,-6.10,-1499.80,1274.20,200.00}},
  149. {"Esplanade East", {-1499.80,578.30,-79.60,-1339.80,1274.20,20.30}},
  150. {"Esplanade North", {-2533.00,1358.90,-4.50,-1996.60,1501.20,200.00}},
  151. {"Esplanade North", {-1996.60,1358.90,-4.50,-1524.20,1592.50,200.00}},
  152. {"Esplanade North", {-1982.30,1274.20,-4.50,-1524.20,1358.90,200.00}},
  153. {"Fallen Tree", {-792.20,-698.50,-5.30,-452.40,-380.00,200.00}},
  154. {"Fallow Bridge", {434.30,366.50,0.00,603.00,555.60,200.00}},
  155. {"Fern Ridge", {508.10,-139.20,0.00,1306.60,119.50,200.00}},
  156. {"Financial", {-1871.70,744.10,-6.10,-1701.30,1176.40,300.00}},
  157. {"Fisher's Lagoon", {1916.90,-233.30,-100.00,2131.70,13.80,200.00}},
  158. {"Flint Intersection", {-187.70,-1596.70,-89.00,17.00,-1276.60,110.90}},
  159. {"Flint Range", {-594.10,-1648.50,0.00,-187.70,-1276.60,200.00}},
  160. {"Fort Carson", {-376.20,826.30,-3.00,123.70,1220.40,200.00}},
  161. {"Foster Valley", {-2270.00,-430.20,-0.00,-2178.60,-324.10,200.00}},
  162. {"Foster Valley", {-2178.60,-599.80,-0.00,-1794.90,-324.10,200.00}},
  163. {"Foster Valley", {-2178.60,-1115.50,0.00,-1794.90,-599.80,200.00}},
  164. {"Foster Valley", {-2178.60,-1250.90,0.00,-1794.90,-1115.50,200.00}},
  165. {"Frederick Bridge", {2759.20,296.50,0.00,2774.20,594.70,200.00}},
  166. {"Gant Bridge", {-2741.40,1659.60,-6.10,-2616.40,2175.10,200.00}},
  167. {"Gant Bridge", {-2741.00,1490.40,-6.10,-2616.40,1659.60,200.00}},
  168. {"Ganton", {2222.50,-1852.80,-89.00,2632.80,-1722.30,110.90}},
  169. {"Ganton", {2222.50,-1722.30,-89.00,2632.80,-1628.50,110.90}},
  170. {"Garcia", {-2411.20,-222.50,-0.00,-2173.00,265.20,200.00}},
  171. {"Garcia", {-2395.10,-222.50,-5.30,-2354.00,-204.70,200.00}},
  172. {"Garver Bridge", {-1339.80,828.10,-89.00,-1213.90,1057.00,110.90}},
  173. {"Garver Bridge", {-1213.90,950.00,-89.00,-1087.90,1178.90,110.90}},
  174. {"Garver Bridge", {-1499.80,696.40,-179.60,-1339.80,925.30,20.30}},
  175. {"Glen Park", {1812.60,-1449.60,-89.00,1996.90,-1350.70,110.90}},
  176. {"Glen Park", {1812.60,-1100.80,-89.00,1994.30,-973.30,110.90}},
  177. {"Glen Park", {1812.60,-1350.70,-89.00,2056.80,-1100.80,110.90}},
  178. {"Green Palms", {176.50,1305.40,-3.00,338.60,1520.70,200.00}},
  179. {"Greenglass College", {964.30,1044.60,-89.00,1197.30,1203.20,110.90}},
  180. {"Greenglass College", {964.30,930.80,-89.00,1166.50,1044.60,110.90}},
  181. {"Hampton Barns", {603.00,264.30,0.00,761.90,366.50,200.00}},
  182. {"Hankypanky Point", {2576.90,62.10,0.00,2759.20,385.50,200.00}},
  183. {"Harry Gold Parkway", {1777.30,863.20,-89.00,1817.30,2342.80,110.90}},
  184. {"Hashbury", {-2593.40,-222.50,-0.00,-2411.20,54.70,200.00}},
  185. {"Hilltop Farm", {967.30,-450.30,-3.00,1176.70,-217.90,200.00}},
  186. {"Hunter Quarry", {337.20,710.80,-115.20,860.50,1031.70,203.70}},
  187. {"Idlewood", {1812.60,-1852.80,-89.00,1971.60,-1742.30,110.90}},
  188. {"Idlewood", {1812.60,-1742.30,-89.00,1951.60,-1602.30,110.90}},
  189. {"Idlewood", {1951.60,-1742.30,-89.00,2124.60,-1602.30,110.90}},
  190. {"Idlewood", {1812.60,-1602.30,-89.00,2124.60,-1449.60,110.90}},
  191. {"Idlewood", {2124.60,-1742.30,-89.00,2222.50,-1494.00,110.90}},
  192. {"Idlewood", {1971.60,-1852.80,-89.00,2222.50,-1742.30,110.90}},
  193. {"Jefferson", {1996.90,-1449.60,-89.00,2056.80,-1350.70,110.90}},
  194. {"Jefferson", {2124.60,-1494.00,-89.00,2266.20,-1449.60,110.90}},
  195. {"Jefferson", {2056.80,-1372.00,-89.00,2281.40,-1210.70,110.90}},
  196. {"Jefferson", {2056.80,-1210.70,-89.00,2185.30,-1126.30,110.90}},
  197. {"Jefferson", {2185.30,-1210.70,-89.00,2281.40,-1154.50,110.90}},
  198. {"Jefferson", {2056.80,-1449.60,-89.00,2266.20,-1372.00,110.90}},
  199. {"Julius Thruway East", {2623.10,943.20,-89.00,2749.90,1055.90,110.90}},
  200. {"Julius Thruway East", {2685.10,1055.90,-89.00,2749.90,2626.50,110.90}},
  201. {"Julius Thruway East", {2536.40,2442.50,-89.00,2685.10,2542.50,110.90}},
  202. {"Julius Thruway East", {2625.10,2202.70,-89.00,2685.10,2442.50,110.90}},
  203. {"Julius Thruway North", {2498.20,2542.50,-89.00,2685.10,2626.50,110.90}},
  204. {"Julius Thruway North", {2237.40,2542.50,-89.00,2498.20,2663.10,110.90}},
  205. {"Julius Thruway North", {2121.40,2508.20,-89.00,2237.40,2663.10,110.90}},
  206. {"Julius Thruway North", {1938.80,2508.20,-89.00,2121.40,2624.20,110.90}},
  207. {"Julius Thruway North", {1534.50,2433.20,-89.00,1848.40,2583.20,110.90}},
  208. {"Julius Thruway North", {1848.40,2478.40,-89.00,1938.80,2553.40,110.90}},
  209. {"Julius Thruway North", {1704.50,2342.80,-89.00,1848.40,2433.20,110.90}},
  210. {"Julius Thruway North", {1377.30,2433.20,-89.00,1534.50,2507.20,110.90}},
  211. {"Julius Thruway South", {1457.30,823.20,-89.00,2377.30,863.20,110.90}},
  212. {"Julius Thruway South", {2377.30,788.80,-89.00,2537.30,897.90,110.90}},
  213. {"Julius Thruway West", {1197.30,1163.30,-89.00,1236.60,2243.20,110.90}},
  214. {"Julius Thruway West", {1236.60,2142.80,-89.00,1297.40,2243.20,110.90}},
  215. {"Juniper Hill", {-2533.00,578.30,-7.60,-2274.10,968.30,200.00}},
  216. {"Juniper Hollow", {-2533.00,968.30,-6.10,-2274.10,1358.90,200.00}},
  217. {"K.A.C.C. Military Fuels", {2498.20,2626.50,-89.00,2749.90,2861.50,110.90}},
  218. {"Kincaid Bridge", {-1339.80,599.20,-89.00,-1213.90,828.10,110.90}},
  219. {"Kincaid Bridge", {-1213.90,721.10,-89.00,-1087.90,950.00,110.90}},
  220. {"Kincaid Bridge", {-1087.90,855.30,-89.00,-961.90,986.20,110.90}},
  221. {"King's", {-2329.30,458.40,-7.60,-1993.20,578.30,200.00}},
  222. {"King's", {-2411.20,265.20,-9.10,-1993.20,373.50,200.00}},
  223. {"King's", {-2253.50,373.50,-9.10,-1993.20,458.40,200.00}},
  224. {"LVA Freight Depot", {1457.30,863.20,-89.00,1777.40,1143.20,110.90}},
  225. {"LVA Freight Depot", {1375.60,919.40,-89.00,1457.30,1203.20,110.90}},
  226. {"LVA Freight Depot", {1277.00,1087.60,-89.00,1375.60,1203.20,110.90}},
  227. {"LVA Freight Depot", {1315.30,1044.60,-89.00,1375.60,1087.60,110.90}},
  228. {"LVA Freight Depot", {1236.60,1163.40,-89.00,1277.00,1203.20,110.90}},
  229. {"Las Barrancas", {-926.10,1398.70,-3.00,-719.20,1634.60,200.00}},
  230. {"Las Brujas", {-365.10,2123.00,-3.00,-208.50,2217.60,200.00}},
  231. {"Las Colinas", {1994.30,-1100.80,-89.00,2056.80,-920.80,110.90}},
  232. {"Las Colinas", {2056.80,-1126.30,-89.00,2126.80,-920.80,110.90}},
  233. {"Las Colinas", {2185.30,-1154.50,-89.00,2281.40,-934.40,110.90}},
  234. {"Las Colinas", {2126.80,-1126.30,-89.00,2185.30,-934.40,110.90}},
  235. {"Las Colinas", {2747.70,-1120.00,-89.00,2959.30,-945.00,110.90}},
  236. {"Las Colinas", {2632.70,-1135.00,-89.00,2747.70,-945.00,110.90}},
  237. {"Las Colinas", {2281.40,-1135.00,-89.00,2632.70,-945.00,110.90}},
  238. {"Las Payasadas", {-354.30,2580.30,2.00,-133.60,2816.80,200.00}},
  239. {"Las Venturas Airport", {1236.60,1203.20,-89.00,1457.30,1883.10,110.90}},
  240. {"Las Venturas Airport", {1457.30,1203.20,-89.00,1777.30,1883.10,110.90}},
  241. {"Las Venturas Airport", {1457.30,1143.20,-89.00,1777.40,1203.20,110.90}},
  242. {"Las Venturas Airport", {1515.80,1586.40,-12.50,1729.90,1714.50,87.50}},
  243. {"Last Dime Motel", {1823.00,596.30,-89.00,1997.20,823.20,110.90}},
  244. {"Leafy Hollow", {-1166.90,-1856.00,0.00,-815.60,-1602.00,200.00}},
  245. {"Liberty City", {-1000.00,400.00,1300.00,-700.00,600.00,1400.00}},
  246. {"Lil' Probe Inn", {-90.20,1286.80,-3.00,153.80,1554.10,200.00}},
  247. {"Linden Side", {2749.90,943.20,-89.00,2923.30,1198.90,110.90}},
  248. {"Linden Station", {2749.90,1198.90,-89.00,2923.30,1548.90,110.90}},
  249. {"Linden Station", {2811.20,1229.50,-39.50,2861.20,1407.50,60.40}},
  250. {"Little Mexico", {1701.90,-1842.20,-89.00,1812.60,-1722.20,110.90}},
  251. {"Little Mexico", {1758.90,-1722.20,-89.00,1812.60,-1577.50,110.90}},
  252. {"Los Flores", {2581.70,-1454.30,-89.00,2632.80,-1393.40,110.90}},
  253. {"Los Flores", {2581.70,-1393.40,-89.00,2747.70,-1135.00,110.90}},
  254. {"Los Santos International", {1249.60,-2394.30,-89.00,1852.00,-2179.20,110.90}},
  255. {"Los Santos International", {1852.00,-2394.30,-89.00,2089.00,-2179.20,110.90}},
  256. {"Los Santos International", {1382.70,-2730.80,-89.00,2201.80,-2394.30,110.90}},
  257. {"Los Santos International", {1974.60,-2394.30,-39.00,2089.00,-2256.50,60.90}},
  258. {"Los Santos International", {1400.90,-2669.20,-39.00,2189.80,-2597.20,60.90}},
  259. {"Los Santos International", {2051.60,-2597.20,-39.00,2152.40,-2394.30,60.90}},
  260. {"Marina", {647.70,-1804.20,-89.00,851.40,-1577.50,110.90}},
  261. {"Marina", {647.70,-1577.50,-89.00,807.90,-1416.20,110.90}},
  262. {"Marina", {807.90,-1577.50,-89.00,926.90,-1416.20,110.90}},
  263. {"Market", {787.40,-1416.20,-89.00,1072.60,-1310.20,110.90}},
  264. {"Market", {952.60,-1310.20,-89.00,1072.60,-1130.80,110.90}},
  265. {"Market", {1072.60,-1416.20,-89.00,1370.80,-1130.80,110.90}},
  266. {"Market", {926.90,-1577.50,-89.00,1370.80,-1416.20,110.90}},
  267. {"Market Station", {787.40,-1410.90,-34.10,866.00,-1310.20,65.80}},
  268. {"Martin Bridge", {-222.10,293.30,0.00,-122.10,476.40,200.00}},
  269. {"Missionary Hill", {-2994.40,-811.20,0.00,-2178.60,-430.20,200.00}},
  270. {"Montgomery", {1119.50,119.50,-3.00,1451.40,493.30,200.00}},
  271. {"Montgomery", {1451.40,347.40,-6.10,1582.40,420.80,200.00}},
  272. {"Montgomery Intersection", {1546.60,208.10,0.00,1745.80,347.40,200.00}},
  273. {"Montgomery Intersection", {1582.40,347.40,0.00,1664.60,401.70,200.00}},
  274. {"Mulholland", {1414.00,-768.00,-89.00,1667.60,-452.40,110.90}},
  275. {"Mulholland", {1281.10,-452.40,-89.00,1641.10,-290.90,110.90}},
  276. {"Mulholland", {1269.10,-768.00,-89.00,1414.00,-452.40,110.90}},
  277. {"Mulholland", {1357.00,-926.90,-89.00,1463.90,-768.00,110.90}},
  278. {"Mulholland", {1318.10,-910.10,-89.00,1357.00,-768.00,110.90}},
  279. {"Mulholland", {1169.10,-910.10,-89.00,1318.10,-768.00,110.90}},
  280. {"Mulholland", {768.60,-954.60,-89.00,952.60,-860.60,110.90}},
  281. {"Mulholland", {687.80,-860.60,-89.00,911.80,-768.00,110.90}},
  282. {"Mulholland", {737.50,-768.00,-89.00,1142.20,-674.80,110.90}},
  283. {"Mulholland", {1096.40,-910.10,-89.00,1169.10,-768.00,110.90}},
  284. {"Mulholland", {952.60,-937.10,-89.00,1096.40,-860.60,110.90}},
  285. {"Mulholland", {911.80,-860.60,-89.00,1096.40,-768.00,110.90}},
  286. {"Mulholland", {861.00,-674.80,-89.00,1156.50,-600.80,110.90}},
  287. {"Mulholland Intersection", {1463.90,-1150.80,-89.00,1812.60,-768.00,110.90}},
  288. {"North Rock", {2285.30,-768.00,0.00,2770.50,-269.70,200.00}},
  289. {"Ocean Docks", {2373.70,-2697.00,-89.00,2809.20,-2330.40,110.90}},
  290. {"Ocean Docks", {2201.80,-2418.30,-89.00,2324.00,-2095.00,110.90}},
  291. {"Ocean Docks", {2324.00,-2302.30,-89.00,2703.50,-2145.10,110.90}},
  292. {"Ocean Docks", {2089.00,-2394.30,-89.00,2201.80,-2235.80,110.90}},
  293. {"Ocean Docks", {2201.80,-2730.80,-89.00,2324.00,-2418.30,110.90}},
  294. {"Ocean Docks", {2703.50,-2302.30,-89.00,2959.30,-2126.90,110.90}},
  295. {"Ocean Docks", {2324.00,-2145.10,-89.00,2703.50,-2059.20,110.90}},
  296. {"Ocean Flats", {-2994.40,277.40,-9.10,-2867.80,458.40,200.00}},
  297. {"Ocean Flats", {-2994.40,-222.50,-0.00,-2593.40,277.40,200.00}},
  298. {"Ocean Flats", {-2994.40,-430.20,-0.00,-2831.80,-222.50,200.00}},
  299. {"Octane Springs", {338.60,1228.50,0.00,664.30,1655.00,200.00}},
  300. {"Old Venturas Strip", {2162.30,2012.10,-89.00,2685.10,2202.70,110.90}},
  301. {"Palisades", {-2994.40,458.40,-6.10,-2741.00,1339.60,200.00}},
  302. {"Palomino Creek", {2160.20,-149.00,0.00,2576.90,228.30,200.00}},
  303. {"Paradiso", {-2741.00,793.40,-6.10,-2533.00,1268.40,200.00}},
  304. {"Pershing Square", {1440.90,-1722.20,-89.00,1583.50,-1577.50,110.90}},
  305. {"Pilgrim", {2437.30,1383.20,-89.00,2624.40,1783.20,110.90}},
  306. {"Pilgrim", {2624.40,1383.20,-89.00,2685.10,1783.20,110.90}},
  307. {"Pilson Intersection", {1098.30,2243.20,-89.00,1377.30,2507.20,110.90}},
  308. {"Pirates in Men's Pants", {1817.30,1469.20,-89.00,2027.40,1703.20,110.90}},
  309. {"Playa del Seville", {2703.50,-2126.90,-89.00,2959.30,-1852.80,110.90}},
  310. {"Prickle Pine", {1534.50,2583.20,-89.00,1848.40,2863.20,110.90}},
  311. {"Prickle Pine", {1117.40,2507.20,-89.00,1534.50,2723.20,110.90}},
  312. {"Prickle Pine", {1848.40,2553.40,-89.00,1938.80,2863.20,110.90}},
  313. {"Prickle Pine", {1938.80,2624.20,-89.00,2121.40,2861.50,110.90}},
  314. {"Queens", {-2533.00,458.40,0.00,-2329.30,578.30,200.00}},
  315. {"Queens", {-2593.40,54.70,0.00,-2411.20,458.40,200.00}},
  316. {"Queens", {-2411.20,373.50,0.00,-2253.50,458.40,200.00}},
  317. {"Randolph Industrial Estate", {1558.00,596.30,-89.00,1823.00,823.20,110.90}},
  318. {"Redsands East", {1817.30,2011.80,-89.00,2106.70,2202.70,110.90}},
  319. {"Redsands East", {1817.30,2202.70,-89.00,2011.90,2342.80,110.90}},
  320. {"Redsands East", {1848.40,2342.80,-89.00,2011.90,2478.40,110.90}},
  321. {"Redsands West", {1236.60,1883.10,-89.00,1777.30,2142.80,110.90}},
  322. {"Redsands West", {1297.40,2142.80,-89.00,1777.30,2243.20,110.90}},
  323. {"Redsands West", {1377.30,2243.20,-89.00,1704.50,2433.20,110.90}},
  324. {"Redsands West", {1704.50,2243.20,-89.00,1777.30,2342.80,110.90}},
  325. {"Regular Tom", {-405.70,1712.80,-3.00,-276.70,1892.70,200.00}},
  326. {"Richman", {647.50,-1118.20,-89.00,787.40,-954.60,110.90}},
  327. {"Richman", {647.50,-954.60,-89.00,768.60,-860.60,110.90}},
  328. {"Richman", {225.10,-1369.60,-89.00,334.50,-1292.00,110.90}},
  329. {"Richman", {225.10,-1292.00,-89.00,466.20,-1235.00,110.90}},
  330. {"Richman", {72.60,-1404.90,-89.00,225.10,-1235.00,110.90}},
  331. {"Richman", {72.60,-1235.00,-89.00,321.30,-1008.10,110.90}},
  332. {"Richman", {321.30,-1235.00,-89.00,647.50,-1044.00,110.90}},
  333. {"Richman", {321.30,-1044.00,-89.00,647.50,-860.60,110.90}},
  334. {"Richman", {321.30,-860.60,-89.00,687.80,-768.00,110.90}},
  335. {"Richman", {321.30,-768.00,-89.00,700.70,-674.80,110.90}},
  336. {"Robada Intersection", {-1119.00,1178.90,-89.00,-862.00,1351.40,110.90}},
  337. {"Roca Escalante", {2237.40,2202.70,-89.00,2536.40,2542.50,110.90}},
  338. {"Roca Escalante", {2536.40,2202.70,-89.00,2625.10,2442.50,110.90}},
  339. {"Rockshore East", {2537.30,676.50,-89.00,2902.30,943.20,110.90}},
  340. {"Rockshore West", {1997.20,596.30,-89.00,2377.30,823.20,110.90}},
  341. {"Rockshore West", {2377.30,596.30,-89.00,2537.30,788.80,110.90}},
  342. {"Rodeo", {72.60,-1684.60,-89.00,225.10,-1544.10,110.90}},
  343. {"Rodeo", {72.60,-1544.10,-89.00,225.10,-1404.90,110.90}},
  344. {"Rodeo", {225.10,-1684.60,-89.00,312.80,-1501.90,110.90}},
  345. {"Rodeo", {225.10,-1501.90,-89.00,334.50,-1369.60,110.90}},
  346. {"Rodeo", {334.50,-1501.90,-89.00,422.60,-1406.00,110.90}},
  347. {"Rodeo", {312.80,-1684.60,-89.00,422.60,-1501.90,110.90}},
  348. {"Rodeo", {422.60,-1684.60,-89.00,558.00,-1570.20,110.90}},
  349. {"Rodeo", {558.00,-1684.60,-89.00,647.50,-1384.90,110.90}},
  350. {"Rodeo", {466.20,-1570.20,-89.00,558.00,-1385.00,110.90}},
  351. {"Rodeo", {422.60,-1570.20,-89.00,466.20,-1406.00,110.90}},
  352. {"Rodeo", {466.20,-1385.00,-89.00,647.50,-1235.00,110.90}},
  353. {"Rodeo", {334.50,-1406.00,-89.00,466.20,-1292.00,110.90}},
  354. {"Royal Casino", {2087.30,1383.20,-89.00,2437.30,1543.20,110.90}},
  355. {"San Andreas Sound", {2450.30,385.50,-100.00,2759.20,562.30,200.00}},
  356. {"Santa Flora", {-2741.00,458.40,-7.60,-2533.00,793.40,200.00}},
  357. {"Santa Maria Beach", {342.60,-2173.20,-89.00,647.70,-1684.60,110.90}},
  358. {"Santa Maria Beach", {72.60,-2173.20,-89.00,342.60,-1684.60,110.90}},
  359. {"Shady Cabin", {-1632.80,-2263.40,-3.00,-1601.30,-2231.70,200.00}},
  360. {"Shady Creeks", {-1820.60,-2643.60,-8.00,-1226.70,-1771.60,200.00}},
  361. {"Shady Creeks", {-2030.10,-2174.80,-6.10,-1820.60,-1771.60,200.00}},
  362. {"Sobell Rail Yards", {2749.90,1548.90,-89.00,2923.30,1937.20,110.90}},
  363. {"Spinybed", {2121.40,2663.10,-89.00,2498.20,2861.50,110.90}},
  364. {"Starfish Casino", {2437.30,1783.20,-89.00,2685.10,2012.10,110.90}},
  365. {"Starfish Casino", {2437.30,1858.10,-39.00,2495.00,1970.80,60.90}},
  366. {"Starfish Casino", {2162.30,1883.20,-89.00,2437.30,2012.10,110.90}},
  367. {"Temple", {1252.30,-1130.80,-89.00,1378.30,-1026.30,110.90}},
  368. {"Temple", {1252.30,-1026.30,-89.00,1391.00,-926.90,110.90}},
  369. {"Temple", {1252.30,-926.90,-89.00,1357.00,-910.10,110.90}},
  370. {"Temple", {952.60,-1130.80,-89.00,1096.40,-937.10,110.90}},
  371. {"Temple", {1096.40,-1130.80,-89.00,1252.30,-1026.30,110.90}},
  372. {"Temple", {1096.40,-1026.30,-89.00,1252.30,-910.10,110.90}},
  373. {"The Camel's Toe", {2087.30,1203.20,-89.00,2640.40,1383.20,110.90}},
  374. {"The Clown's Pocket", {2162.30,1783.20,-89.00,2437.30,1883.20,110.90}},
  375. {"The Emerald Isle", {2011.90,2202.70,-89.00,2237.40,2508.20,110.90}},
  376. {"The Farm", {-1209.60,-1317.10,114.90,-908.10,-787.30,251.90}},
  377. {"The Four Dragons Casino", {1817.30,863.20,-89.00,2027.30,1083.20,110.90}},
  378. {"The High Roller", {1817.30,1283.20,-89.00,2027.30,1469.20,110.90}},
  379. {"The Mako Span", {1664.60,401.70,0.00,1785.10,567.20,200.00}},
  380. {"The Panopticon", {-947.90,-304.30,-1.10,-319.60,327.00,200.00}},
  381. {"The Pink Swan", {1817.30,1083.20,-89.00,2027.30,1283.20,110.90}},
  382. {"The Sherman Dam", {-968.70,1929.40,-3.00,-481.10,2155.20,200.00}},
  383. {"The Strip", {2027.40,863.20,-89.00,2087.30,1703.20,110.90}},
  384. {"The Strip", {2106.70,1863.20,-89.00,2162.30,2202.70,110.90}},
  385. {"The Strip", {2027.40,1783.20,-89.00,2162.30,1863.20,110.90}},
  386. {"The Strip", {2027.40,1703.20,-89.00,2137.40,1783.20,110.90}},
  387. {"The Visage", {1817.30,1863.20,-89.00,2106.70,2011.80,110.90}},
  388. {"The Visage", {1817.30,1703.20,-89.00,2027.40,1863.20,110.90}},
  389. {"Unity Station", {1692.60,-1971.80,-20.40,1812.60,-1932.80,79.50}},
  390. {"Valle Ocultado", {-936.60,2611.40,2.00,-715.90,2847.90,200.00}},
  391. {"Verdant Bluffs", {930.20,-2488.40,-89.00,1249.60,-2006.70,110.90}},
  392. {"Verdant Bluffs", {1073.20,-2006.70,-89.00,1249.60,-1842.20,110.90}},
  393. {"Verdant Bluffs", {1249.60,-2179.20,-89.00,1692.60,-1842.20,110.90}},
  394. {"Verdant Meadows", {37.00,2337.10,-3.00,435.90,2677.90,200.00}},
  395. {"Verona Beach", {647.70,-2173.20,-89.00,930.20,-1804.20,110.90}},
  396. {"Verona Beach", {930.20,-2006.70,-89.00,1073.20,-1804.20,110.90}},
  397. {"Verona Beach", {851.40,-1804.20,-89.00,1046.10,-1577.50,110.90}},
  398. {"Verona Beach", {1161.50,-1722.20,-89.00,1323.90,-1577.50,110.90}},
  399. {"Verona Beach", {1046.10,-1722.20,-89.00,1161.50,-1577.50,110.90}},
  400. {"Vinewood", {787.40,-1310.20,-89.00,952.60,-1130.80,110.90}},
  401. {"Vinewood", {787.40,-1130.80,-89.00,952.60,-954.60,110.90}},
  402. {"Vinewood", {647.50,-1227.20,-89.00,787.40,-1118.20,110.90}},
  403. {"Vinewood", {647.70,-1416.20,-89.00,787.40,-1227.20,110.90}},
  404. {"Whitewood Estates", {883.30,1726.20,-89.00,1098.30,2507.20,110.90}},
  405. {"Whitewood Estates", {1098.30,1726.20,-89.00,1197.30,2243.20,110.90}},
  406. {"Willowfield", {1970.60,-2179.20,-89.00,2089.00,-1852.80,110.90}},
  407. {"Willowfield", {2089.00,-2235.80,-89.00,2201.80,-1989.90,110.90}},
  408. {"Willowfield", {2089.00,-1989.90,-89.00,2324.00,-1852.80,110.90}},
  409. {"Willowfield", {2201.80,-2095.00,-89.00,2324.00,-1989.90,110.90}},
  410. {"Willowfield", {2541.70,-1941.40,-89.00,2703.50,-1852.80,110.90}},
  411. {"Willowfield", {2324.00,-2059.20,-89.00,2541.70,-1852.80,110.90}},
  412. {"Willowfield", {2541.70,-2059.20,-89.00,2703.50,-1941.40,110.90}},
  413. {"Yellow Bell Station", {1377.40,2600.40,-21.90,1492.40,2687.30,78.00}},
  414. {"Los Santos", {44.60,-2892.90,-242.90,2997.00,-768.00,900.00}},
  415. {"Las Venturas", {869.40,596.30,-242.90,2997.00,2993.80,900.00}},
  416. {"Bone County", {-480.50,596.30,-242.90,869.40,2993.80,900.00}},
  417. {"Tierra Robada", {-2997.40,1659.60,-242.90,-480.50,2993.80,900.00}},
  418. {"Tierra Robada", {-1213.90,596.30,-242.90,-480.50,1659.60,900.00}},
  419. {"San Fierro", {-2997.40,-1115.50,-242.90,-1213.90,1659.60,900.00}},
  420. {"Red County", {-1213.90,-768.00,-242.90,2997.00,596.30,900.00}},
  421. {"Flint County", {-1213.90,-2892.90,-242.90,44.60,-768.00,900.00}},
  422. {"Whetstone", {-2997.40,-2892.90,-242.90,-1213.90,-1115.50,900.00}}
  423. };
  424. stock GetVehicle2DZone(vehicleid, zone[], len)
  425. {
  426. new Float:x, Float:y, Float:z;
  427. GetVehiclePos(vehicleid, x, y, z);
  428. for(new i = 0; i != sizeof(gSAZones); i++ )
  429. {
  430. if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
  431. {
  432. return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
  433. }
  434. }
  435. return 0;
  436. }
  437. stock split(const strsrc[], strdest[][], delim)
  438. {
  439. new i;
  440. new li;
  441. new aNum;
  442. new len;
  443. while(i <= strlen(strsrc))
  444. {
  445. if(strsrc[i] == delim || i == strlen(strsrc))
  446. {
  447. len = strmid(strdest[aNum], strsrc, li, i, 128);
  448. strdest[aNum][len] = 0;
  449. li = (i + 1);
  450. aNum++;
  451. }
  452. i++;
  453. }
  454. return 1;
  455. }
  456. stock strtok(const string[], &index)
  457. {
  458. new length = strlen(string);
  459. while ((index < length) && (string[index] <= ' '))
  460. {
  461. index++;
  462. }
  463. new offset = index;
  464. new result[20];
  465. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  466. {
  467. result[index - offset] = string[index];
  468. index++;
  469. }
  470. result[index - offset] = EOS;
  471. return result;
  472. }
  473. stock GetVehicleName(vehicleid)
  474. {
  475. new
  476. vehicle_name[32] = "None";
  477. if((vehicleid == INVALID_VEHICLE_ID) || (vehicleid < 1 || (vehicleid > MAX_VEHICLES - 1))) return vehicle_name;
  478. switch (GetVehicleModel(vehicleid))
  479. {
  480. case 400: vehicle_name = "Landstalker";
  481. case 401: vehicle_name = "Bravura";
  482. case 402: vehicle_name = "Buffalo";
  483. case 403: vehicle_name = "Linerunner";
  484. case 404: vehicle_name = "Perennial";
  485. case 405: vehicle_name = "Sentinel";
  486. case 406: vehicle_name = "Dumper";
  487. case 407: vehicle_name = "Firetruck";
  488. case 408: vehicle_name = "Trashmaster";
  489. case 409: vehicle_name = "Stretch";
  490. case 410: vehicle_name = "Manana";
  491. case 411: vehicle_name = "Infernus";
  492. case 412: vehicle_name = "Voodoo";
  493. case 413: vehicle_name = "Pony";
  494. case 414: vehicle_name = "Mule";
  495. case 415: vehicle_name = "Cheetah";
  496. case 416: vehicle_name = "Ambulance";
  497. case 417: vehicle_name = "Leviathan";
  498. case 418: vehicle_name = "Moonbeam";
  499. case 419: vehicle_name = "Esperanto";
  500. case 420: vehicle_name = "Taxi";
  501. case 421: vehicle_name = "Washington";
  502. case 422: vehicle_name = "Bobcat";
  503. case 423: vehicle_name = "Mr Whoopee";
  504. case 424: vehicle_name = "BF Injection";
  505. case 425: vehicle_name = "Hunter";
  506. case 426: vehicle_name = "Premier";
  507. case 427: vehicle_name = "Enforcer";
  508. case 428: vehicle_name = "Securicar";
  509. case 429: vehicle_name = "Banshee";
  510. case 430: vehicle_name = "Predator";
  511. case 431: vehicle_name = "Bus";
  512. case 432: vehicle_name = "Rhino";
  513. case 433: vehicle_name = "Barracks";
  514. case 434: vehicle_name = "Hotknife";
  515. case 435: vehicle_name = "Article Trailer";
  516. case 436: vehicle_name = "Previon";
  517. case 437: vehicle_name = "Coach";
  518. case 438: vehicle_name = "Cabbie";
  519. case 439: vehicle_name = "Stallion";
  520. case 440: vehicle_name = "Rumpo";
  521. case 441: vehicle_name = "RC Bandit";
  522. case 442: vehicle_name = "Romero";
  523. case 443: vehicle_name = "Packer";
  524. case 444: vehicle_name = "Monster";
  525. case 445: vehicle_name = "Admiral";
  526. case 446: vehicle_name = "Squalo";
  527. case 447: vehicle_name = "Seasparrow";
  528. case 448: vehicle_name = "Pizzaboy";
  529. case 449: vehicle_name = "Tram";
  530. case 450: vehicle_name = "Article Trailer 2";
  531. case 451: vehicle_name = "Turismo";
  532. case 452: vehicle_name = "Speeder";
  533. case 453: vehicle_name = "Reefer";
  534. case 454: vehicle_name = "Tropic";
  535. case 455: vehicle_name = "Flatbed";
  536. case 456: vehicle_name = "Yankee";
  537. case 457: vehicle_name = "Caddy";
  538. case 458: vehicle_name = "Solair";
  539. case 459: vehicle_name = "Berkley's RC Van";
  540. case 460: vehicle_name = "Skimmer";
  541. case 461: vehicle_name = "PCJ-600";
  542. case 462: vehicle_name = "Faggio";
  543. case 463: vehicle_name = "Freeway";
  544. case 464: vehicle_name = "RC Baron";
  545. case 465: vehicle_name = "RC Raider";
  546. case 466: vehicle_name = "Glendale";
  547. case 467: vehicle_name = "Oceanic";
  548. case 468: vehicle_name = "Sanchez";
  549. case 469: vehicle_name = "Sparrow";
  550. case 470: vehicle_name = "Patriot";
  551. case 471: vehicle_name = "Quad";
  552. case 472: vehicle_name = "Coastguard";
  553. case 473: vehicle_name = "Dinghy";
  554. case 474: vehicle_name = "Hermes";
  555. case 475: vehicle_name = "Sabre";
  556. case 476: vehicle_name = "Rustler";
  557. case 477: vehicle_name = "ZR-350";
  558. case 478: vehicle_name = "Walton";
  559. case 479: vehicle_name = "Regina";
  560. case 480: vehicle_name = "Comet";
  561. case 481: vehicle_name = "BMX";
  562. case 482: vehicle_name = "Burrito";
  563. case 483: vehicle_name = "Camper";
  564. case 484: vehicle_name = "Marquis";
  565. case 485: vehicle_name = "Baggage";
  566. case 486: vehicle_name = "Dozer";
  567. case 487: vehicle_name = "Maverick";
  568. case 488: vehicle_name = "SAN News Maverick";
  569. case 489, 505: vehicle_name = "Rancher";
  570. case 490: vehicle_name = "FBI Rancher";
  571. case 491: vehicle_name = "Virgo";
  572. case 492: vehicle_name = "Greenwood";
  573. case 493: vehicle_name = "Jetmax";
  574. case 494: vehicle_name = "Hotring Racer A";
  575. case 495: vehicle_name = "Sandking";
  576. case 496: vehicle_name = "Blista Compact";
  577. case 497: vehicle_name = "Police Maverick";
  578. case 498: vehicle_name = "Boxville";
  579. case 499: vehicle_name = "Benson";
  580. case 500: vehicle_name = "Mesa";
  581. case 501: vehicle_name = "RC Goblin";
  582. case 502: vehicle_name = "Hotring Racer B";
  583. case 503: vehicle_name = "Hotring Racer C";
  584. case 504: vehicle_name = "Bloodring Banger";
  585. case 506: vehicle_name = "Super GT";
  586. case 507: vehicle_name = "Elegant";
  587. case 508: vehicle_name = "Journey";
  588. case 509: vehicle_name = "Bike";
  589. case 510: vehicle_name = "Mountain Bike";
  590. case 511: vehicle_name = "Beagle";
  591. case 512: vehicle_name = "Cropduster";
  592. case 513: vehicle_name = "Stuntplane";
  593. case 514: vehicle_name = "Tanker";
  594. case 515: vehicle_name = "Roadtrain";
  595. case 516: vehicle_name = "Nebula";
  596. case 517: vehicle_name = "Majestic";
  597. case 518: vehicle_name = "Buccaneer";
  598. case 519: vehicle_name = "Shamal";
  599. case 520: vehicle_name = "Hydra";
  600. case 521: vehicle_name = "FCR-900";
  601. case 522: vehicle_name = "NRG-500";
  602. case 523: vehicle_name = "HPV1000";
  603. case 524: vehicle_name = "Cement Truck";
  604. case 525: vehicle_name = "Towtruck";
  605. case 526: vehicle_name = "Fortune";
  606. case 527: vehicle_name = "Cadrona";
  607. case 528: vehicle_name = "FBI Trucker";
  608. case 529: vehicle_name = "Willard";
  609. case 530: vehicle_name = "Forklift";
  610. case 531: vehicle_name = "Tractor";
  611. case 532: vehicle_name = "Combine Harvester";
  612. case 533: vehicle_name = "Feltzer";
  613. case 534: vehicle_name = "Remington";
  614. case 535: vehicle_name = "Slamvan";
  615. case 536: vehicle_name = "Blade";
  616. case 537: vehicle_name = "Freight";
  617. case 538: vehicle_name = "Brownstreak";
  618. case 539: vehicle_name = "Vortex";
  619. case 540: vehicle_name = "Vincent";
  620. case 541: vehicle_name = "Bullet";
  621. case 542: vehicle_name = "Clover";
  622. case 543: vehicle_name = "Sadler";
  623. case 544: vehicle_name = "Firetruck LA";
  624. case 545: vehicle_name = "Hustler";
  625. case 546: vehicle_name = "Intruder";
  626. case 547: vehicle_name = "Primo";
  627. case 548: vehicle_name = "Cargobob";
  628. case 549: vehicle_name = "Tampa";
  629. case 550: vehicle_name = "Sunrise";
  630. case 551: vehicle_name = "Merit";
  631. case 552: vehicle_name = "Utility Van";
  632. case 553: vehicle_name = "Nevada";
  633. case 554: vehicle_name = "Yosemite";
  634. case 555: vehicle_name = "Windsor";
  635. case 556: vehicle_name = "Monster A";
  636. case 557: vehicle_name = "Monster B";
  637. case 558: vehicle_name = "Uranus";
  638. case 559: vehicle_name = "Jester";
  639. case 560: vehicle_name = "Sultan";
  640. case 561: vehicle_name = "Stratum";
  641. case 562: vehicle_name = "Elegy";
  642. case 563: vehicle_name = "Raindance";
  643. case 564: vehicle_name = "RC Tiger";
  644. case 565: vehicle_name = "Flash";
  645. case 566: vehicle_name = "Tahoma";
  646. case 567: vehicle_name = "Savanna";
  647. case 568: vehicle_name = "Bandito";
  648. case 569: vehicle_name = "Freight Flat Trailer";
  649. case 570: vehicle_name = "Streak Trailer";
  650. case 571: vehicle_name = "Kart";
  651. case 572: vehicle_name = "Mower";
  652. case 573: vehicle_name = "Dune";
  653. case 574: vehicle_name = "Sweeper";
  654. case 575: vehicle_name = "Broadway";
  655. case 576: vehicle_name = "Tornado";
  656. case 577: vehicle_name = "AT-400";
  657. case 578: vehicle_name = "DFT-30";
  658. case 579: vehicle_name = "Huntley";
  659. case 580: vehicle_name = "Stafford";
  660. case 581: vehicle_name = "BF-400";
  661. case 582: vehicle_name = "Newsvan";
  662. case 583: vehicle_name = "Tug";
  663. case 584: vehicle_name = "Petrol Trailer";
  664. case 585: vehicle_name = "Emperor";
  665. case 586: vehicle_name = "Wayfarer";
  666. case 587: vehicle_name = "Euros";
  667. case 588: vehicle_name = "Hotdog";
  668. case 589: vehicle_name = "Club";
  669. case 590: vehicle_name = "Freight Box Trailer";
  670. case 591: vehicle_name = "Article Trailer 3";
  671. case 592: vehicle_name = "Andromada";
  672. case 593: vehicle_name = "Dodo";
  673. case 594: vehicle_name = "RC Cam";
  674. case 595: vehicle_name = "Launch";
  675. case 596: vehicle_name = "LSPD Cruiser";
  676. case 597: vehicle_name = "SFPD Cruiser";
  677. case 598: vehicle_name = "LVPD Cruiser";
  678. case 599: vehicle_name = "Police Ranger";
  679. case 600: vehicle_name = "Picador";
  680. case 601: vehicle_name = "S.W.A.T.";
  681. case 602: vehicle_name = "Alpha";
  682. case 603: vehicle_name = "Phoenix";
  683. case 604: vehicle_name = "Glendale Shit";
  684. case 605: vehicle_name = "Sadler Shit";
  685. case 606: vehicle_name = "Baggage Trailer A";
  686. case 607: vehicle_name = "Baggage Trailer B";
  687. case 608: vehicle_name = "Tug Stairs";
  688. case 609: vehicle_name = "Boxville";
  689. case 610: vehicle_name = "Farm Trailer";
  690. case 611: vehicle_name = "Utility Trailer";
  691. default: vehicle_name = "None";
  692. }
  693. return vehicle_name;
  694. }
  695. stock GetVehicleNameByModel(modelid)
  696. {
  697. new
  698. vehicle_name[32] = "None";
  699. if(!modelid) return vehicle_name;
  700. switch (modelid)
  701. {
  702. case 400: vehicle_name = "Landstalker";
  703. case 401: vehicle_name = "Bravura";
  704. case 402: vehicle_name = "Buffalo";
  705. case 403: vehicle_name = "Linerunner";
  706. case 404: vehicle_name = "Perennial";
  707. case 405: vehicle_name = "Sentinel";
  708. case 406: vehicle_name = "Dumper";
  709. case 407: vehicle_name = "Firetruck";
  710. case 408: vehicle_name = "Trashmaster";
  711. case 409: vehicle_name = "Stretch";
  712. case 410: vehicle_name = "Manana";
  713. case 411: vehicle_name = "Infernus";
  714. case 412: vehicle_name = "Voodoo";
  715. case 413: vehicle_name = "Pony";
  716. case 414: vehicle_name = "Mule";
  717. case 415: vehicle_name = "Cheetah";
  718. case 416: vehicle_name = "Ambulance";
  719. case 417: vehicle_name = "Leviathan";
  720. case 418: vehicle_name = "Moonbeam";
  721. case 419: vehicle_name = "Esperanto";
  722. case 420: vehicle_name = "Taxi";
  723. case 421: vehicle_name = "Washington";
  724. case 422: vehicle_name = "Bobcat";
  725. case 423: vehicle_name = "Mr Whoopee";
  726. case 424: vehicle_name = "BF Injection";
  727. case 425: vehicle_name = "Hunter";
  728. case 426: vehicle_name = "Premier";
  729. case 427: vehicle_name = "Enforcer";
  730. case 428: vehicle_name = "Securicar";
  731. case 429: vehicle_name = "Banshee";
  732. case 430: vehicle_name = "Predator";
  733. case 431: vehicle_name = "Bus";
  734. case 432: vehicle_name = "Rhino";
  735. case 433: vehicle_name = "Barracks";
  736. case 434: vehicle_name = "Hotknife";
  737. case 435: vehicle_name = "Article Trailer";
  738. case 436: vehicle_name = "Previon";
  739. case 437: vehicle_name = "Coach";
  740. case 438: vehicle_name = "Cabbie";
  741. case 439: vehicle_name = "Stallion";
  742. case 440: vehicle_name = "Rumpo";
  743. case 441: vehicle_name = "RC Bandit";
  744. case 442: vehicle_name = "Romero";
  745. case 443: vehicle_name = "Packer";
  746. case 444: vehicle_name = "Monster";
  747. case 445: vehicle_name = "Admiral";
  748. case 446: vehicle_name = "Squalo";
  749. case 447: vehicle_name = "Seasparrow";
  750. case 448: vehicle_name = "Pizzaboy";
  751. case 449: vehicle_name = "Tram";
  752. case 450: vehicle_name = "Article Trailer 2";
  753. case 451: vehicle_name = "Turismo";
  754. case 452: vehicle_name = "Speeder";
  755. case 453: vehicle_name = "Reefer";
  756. case 454: vehicle_name = "Tropic";
  757. case 455: vehicle_name = "Flatbed";
  758. case 456: vehicle_name = "Yankee";
  759. case 457: vehicle_name = "Caddy";
  760. case 458: vehicle_name = "Solair";
  761. case 459: vehicle_name = "Berkley's RC Van";
  762. case 460: vehicle_name = "Skimmer";
  763. case 461: vehicle_name = "PCJ-600";
  764. case 462: vehicle_name = "Faggio";
  765. case 463: vehicle_name = "Freeway";
  766. case 464: vehicle_name = "RC Baron";
  767. case 465: vehicle_name = "RC Raider";
  768. case 466: vehicle_name = "Glendale";
  769. case 467: vehicle_name = "Oceanic";
  770. case 468: vehicle_name = "Sanchez";
  771. case 469: vehicle_name = "Sparrow";
  772. case 470: vehicle_name = "Patriot";
  773. case 471: vehicle_name = "Quad";
  774. case 472: vehicle_name = "Coastguard";
  775. case 473: vehicle_name = "Dinghy";
  776. case 474: vehicle_name = "Hermes";
  777. case 475: vehicle_name = "Sabre";
  778. case 476: vehicle_name = "Rustler";
  779. case 477: vehicle_name = "ZR-350";
  780. case 478: vehicle_name = "Walton";
  781. case 479: vehicle_name = "Regina";
  782. case 480: vehicle_name = "Comet";
  783. case 481: vehicle_name = "BMX";
  784. case 482: vehicle_name = "Burrito";
  785. case 483: vehicle_name = "Camper";
  786. case 484: vehicle_name = "Marquis";
  787. case 485: vehicle_name = "Baggage";
  788. case 486: vehicle_name = "Dozer";
  789. case 487: vehicle_name = "Maverick";
  790. case 488: vehicle_name = "SAN News Maverick";
  791. case 489, 505: vehicle_name = "Rancher";
  792. case 490: vehicle_name = "FBI Rancher";
  793. case 491: vehicle_name = "Virgo";
  794. case 492: vehicle_name = "Greenwood";
  795. case 493: vehicle_name = "Jetmax";
  796. case 494: vehicle_name = "Hotring Racer A";
  797. case 495: vehicle_name = "Sandking";
  798. case 496: vehicle_name = "Blista Compact";
  799. case 497: vehicle_name = "Police Maverick";
  800. case 498: vehicle_name = "Boxville";
  801. case 499: vehicle_name = "Benson";
  802. case 500: vehicle_name = "Mesa";
  803. case 501: vehicle_name = "RC Goblin";
  804. case 502: vehicle_name = "Hotring Racer B";
  805. case 503: vehicle_name = "Hotring Racer C";
  806. case 504: vehicle_name = "Bloodring Banger";
  807. case 506: vehicle_name = "Super GT";
  808. case 507: vehicle_name = "Elegant";
  809. case 508: vehicle_name = "Journey";
  810. case 509: vehicle_name = "Bike";
  811. case 510: vehicle_name = "Mountain Bike";
  812. case 511: vehicle_name = "Beagle";
  813. case 512: vehicle_name = "Cropduster";
  814. case 513: vehicle_name = "Stuntplane";
  815. case 514: vehicle_name = "Tanker";
  816. case 515: vehicle_name = "Roadtrain";
  817. case 516: vehicle_name = "Nebula";
  818. case 517: vehicle_name = "Majestic";
  819. case 518: vehicle_name = "Buccaneer";
  820. case 519: vehicle_name = "Shamal";
  821. case 520: vehicle_name = "Hydra";
  822. case 521: vehicle_name = "FCR-900";
  823. case 522: vehicle_name = "NRG-500";
  824. case 523: vehicle_name = "HPV1000";
  825. case 524: vehicle_name = "Cement Truck";
  826. case 525: vehicle_name = "Towtruck";
  827. case 526: vehicle_name = "Fortune";
  828. case 527: vehicle_name = "Cadrona";
  829. case 528: vehicle_name = "FBI Trucker";
  830. case 529: vehicle_name = "Willard";
  831. case 530: vehicle_name = "Forklift";
  832. case 531: vehicle_name = "Tractor";
  833. case 532: vehicle_name = "Combine Harvester";
  834. case 533: vehicle_name = "Feltzer";
  835. case 534: vehicle_name = "Remington";
  836. case 535: vehicle_name = "Slamvan";
  837. case 536: vehicle_name = "Blade";
  838. case 537: vehicle_name = "Freight";
  839. case 538: vehicle_name = "Brownstreak";
  840. case 539: vehicle_name = "Vortex";
  841. case 540: vehicle_name = "Vincent";
  842. case 541: vehicle_name = "Bullet";
  843. case 542: vehicle_name = "Clover";
  844. case 543: vehicle_name = "Sadler";
  845. case 544: vehicle_name = "Firetruck LA";
  846. case 545: vehicle_name = "Hustler";
  847. case 546: vehicle_name = "Intruder";
  848. case 547: vehicle_name = "Primo";
  849. case 548: vehicle_name = "Cargobob";
  850. case 549: vehicle_name = "Tampa";
  851. case 550: vehicle_name = "Sunrise";
  852. case 551: vehicle_name = "Merit";
  853. case 552: vehicle_name = "Utility Van";
  854. case 553: vehicle_name = "Nevada";
  855. case 554: vehicle_name = "Yosemite";
  856. case 555: vehicle_name = "Windsor";
  857. case 556: vehicle_name = "Monster A";
  858. case 557: vehicle_name = "Monster B";
  859. case 558: vehicle_name = "Uranus";
  860. case 559: vehicle_name = "Jester";
  861. case 560: vehicle_name = "Sultan";
  862. case 561: vehicle_name = "Stratum";
  863. case 562: vehicle_name = "Elegy";
  864. case 563: vehicle_name = "Raindance";
  865. case 564: vehicle_name = "RC Tiger";
  866. case 565: vehicle_name = "Flash";
  867. case 566: vehicle_name = "Tahoma";
  868. case 567: vehicle_name = "Savanna";
  869. case 568: vehicle_name = "Bandito";
  870. case 569: vehicle_name = "Freight Flat Trailer";
  871. case 570: vehicle_name = "Streak Trailer";
  872. case 571: vehicle_name = "Kart";
  873. case 572: vehicle_name = "Mower";
  874. case 573: vehicle_name = "Dune";
  875. case 574: vehicle_name = "Sweeper";
  876. case 575: vehicle_name = "Broadway";
  877. case 576: vehicle_name = "Tornado";
  878. case 577: vehicle_name = "AT-400";
  879. case 578: vehicle_name = "DFT-30";
  880. case 579: vehicle_name = "Huntley";
  881. case 580: vehicle_name = "Stafford";
  882. case 581: vehicle_name = "BF-400";
  883. case 582: vehicle_name = "Newsvan";
  884. case 583: vehicle_name = "Tug";
  885. case 584: vehicle_name = "Petrol Trailer";
  886. case 585: vehicle_name = "Emperor";
  887. case 586: vehicle_name = "Wayfarer";
  888. case 587: vehicle_name = "Euros";
  889. case 588: vehicle_name = "Hotdog";
  890. case 589: vehicle_name = "Club";
  891. case 590: vehicle_name = "Freight Box Trailer";
  892. case 591: vehicle_name = "Article Trailer 3";
  893. case 592: vehicle_name = "Andromada";
  894. case 593: vehicle_name = "Dodo";
  895. case 594: vehicle_name = "RC Cam";
  896. case 595: vehicle_name = "Launch";
  897. case 596: vehicle_name = "LSPD Cruiser";
  898. case 597: vehicle_name = "SFPD Cruiser";
  899. case 598: vehicle_name = "LVPD Cruiser";
  900. case 599: vehicle_name = "Police Ranger";
  901. case 600: vehicle_name = "Picador";
  902. case 601: vehicle_name = "S.W.A.T.";
  903. case 602: vehicle_name = "Alpha";
  904. case 603: vehicle_name = "Phoenix";
  905. case 604: vehicle_name = "Glendale Shit";
  906. case 605: vehicle_name = "Sadler Shit";
  907. case 606: vehicle_name = "Baggage Trailer A";
  908. case 607: vehicle_name = "Baggage Trailer B";
  909. case 608: vehicle_name = "Tug Stairs";
  910. case 609: vehicle_name = "Boxville";
  911. case 610: vehicle_name = "Farm Trailer";
  912. case 611: vehicle_name = "Utility Trailer";
  913. default: vehicle_name = "None";
  914. }
  915. return vehicle_name;
  916. }
  917. stock sscanf(string[], format[], {Float,_}:...)
  918. {
  919. #if defined isnull
  920. if(isnull(string))
  921. #else
  922. if(string[0] == 0 || (string[0] == 1 && string[1] == 0))
  923. #endif
  924. {
  925. return format[0];
  926. }
  927. #pragma tabsize 4
  928. new
  929. formatPos = 0,
  930. stringPos = 0,
  931. paramPos = 2,
  932. paramCount = numargs(),
  933. delim = ' ';
  934. while (string[stringPos] && string[stringPos] <= ' ')
  935. {
  936. stringPos++;
  937. }
  938. while (paramPos < paramCount && string[stringPos])
  939. {
  940. switch (format[formatPos++])
  941. {
  942. case '\0':
  943. {
  944. return 0;
  945. }
  946. case 'i', 'd':
  947. {
  948. new
  949. neg = 1,
  950. num = 0,
  951. ch = string[stringPos];
  952. if(ch == '-')
  953. {
  954. neg = -1;
  955. ch = string[++stringPos];
  956. }
  957. do
  958. {
  959. stringPos++;
  960. if('0' <= ch <= '9')
  961. {
  962. num = (num * 10) + (ch - '0');
  963. }
  964. else
  965. {
  966. return -1;
  967. }
  968. }
  969. while ((ch = string[stringPos]) > ' ' && ch != delim);
  970. setarg(paramPos, 0, num * neg);
  971. }
  972. case 'h', 'x':
  973. {
  974. new
  975. num = 0,
  976. ch = string[stringPos];
  977. do
  978. {
  979. stringPos++;
  980. switch (ch)
  981. {
  982. case 'x', 'X':
  983. {
  984. num = 0;
  985. continue;
  986. }
  987. case '0' .. '9':
  988. {
  989. num = (num << 4) | (ch - '0');
  990. }
  991. case 'a' .. 'f':
  992. {
  993. num = (num << 4) | (ch - ('a' - 10));
  994. }
  995. case 'A' .. 'F':
  996. {
  997. num = (num << 4) | (ch - ('A' - 10));
  998. }
  999. default:
  1000. {
  1001. return -1;
  1002. }
  1003. }
  1004. }
  1005. while ((ch = string[stringPos]) > ' ' && ch != delim);
  1006. setarg(paramPos, 0, num);
  1007. }
  1008. case 'c':
  1009. {
  1010. setarg(paramPos, 0, string[stringPos++]);
  1011. }
  1012. case 'f':
  1013. {
  1014. new changestr[16], changepos = 0, strpos = stringPos;
  1015. while(changepos < 16 && string[strpos] && string[strpos] != delim)
  1016. {
  1017. changestr[changepos++] = string[strpos++];
  1018. }
  1019. changestr[changepos] = '\0';
  1020. setarg(paramPos,0,_:floatstr(changestr));
  1021. }
  1022. case 'p':
  1023. {
  1024. delim = format[formatPos++];
  1025. continue;
  1026. }
  1027. case '\'':
  1028. {
  1029. new
  1030. end = formatPos - 1,
  1031. ch;
  1032. while ((ch = format[++end]) && ch != '\'') {}
  1033. if(!ch)
  1034. {
  1035. return -1;
  1036. }
  1037. format[end] = '\0';
  1038. if((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
  1039. {
  1040. if(format[end + 1])
  1041. {
  1042. return -1;
  1043. }
  1044. return 0;
  1045. }
  1046. format[end] = '\'';
  1047. stringPos = ch + (end - formatPos);
  1048. formatPos = end + 1;
  1049. }
  1050. case 'u':
  1051. {
  1052. new
  1053. end = stringPos - 1,
  1054. id = 0,
  1055. bool:num = true,
  1056. ch;
  1057. while ((ch = string[++end]) && ch != delim)
  1058. {
  1059. if(num)
  1060. {
  1061. if('0' <= ch <= '9')
  1062. {
  1063. id = (id * 10) + (ch - '0');
  1064. }
  1065. else
  1066. {
  1067. num = false;
  1068. }
  1069. }
  1070. }
  1071. if(num && IsPlayerConnected(id))
  1072. {
  1073. setarg(paramPos, 0, id);
  1074. }
  1075. else
  1076. {
  1077. #if !defined foreach
  1078. #define foreach(%1,%2) for(new %2 = 0; %2 < MAX_PLAYERS; %2++) if(IsPlayerConnected(%2))
  1079. #define __SSCANF_FOREACH__
  1080. #endif
  1081. string[end] = '\0';
  1082. num = false;
  1083. new
  1084. name[MAX_PLAYER_NAME];
  1085. id = end - stringPos;
  1086. foreach (Player, playerid)
  1087. {
  1088. GetPlayerName(playerid, name, sizeof (name));
  1089. if(!strcmp(name, string[stringPos], true, id))
  1090. {
  1091. setarg(paramPos, 0, playerid);
  1092. num = true;
  1093. break;
  1094. }
  1095. }
  1096. if(!num)
  1097. {
  1098. setarg(paramPos, 0, INVALID_PLAYER_ID);
  1099. }
  1100. string[end] = ch;
  1101. #if defined __SSCANF_FOREACH__
  1102. #undef foreach
  1103. #undef __SSCANF_FOREACH__
  1104. #endif
  1105. }
  1106. stringPos = end;
  1107. }
  1108. case 's', 'z':
  1109. {
  1110. new
  1111. i = 0,
  1112. ch;
  1113. if(format[formatPos])
  1114. {
  1115. while ((ch = string[stringPos++]) && ch != delim)
  1116. {
  1117. setarg(paramPos, i++, ch);
  1118. }
  1119. if(!i)
  1120. {
  1121. return -1;
  1122. }
  1123. }
  1124. else
  1125. {
  1126. while ((ch = string[stringPos++]))
  1127. {
  1128. setarg(paramPos, i++, ch);
  1129. }
  1130. }
  1131. stringPos--;
  1132. setarg(paramPos, i, '\0');
  1133. }
  1134. default:
  1135. {
  1136. continue;
  1137. }
  1138. }
  1139. while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
  1140. {
  1141. stringPos++;
  1142. }
  1143. while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
  1144. {
  1145. stringPos++;
  1146. }
  1147. paramPos++;
  1148. }
  1149. do
  1150. {
  1151. if((delim = format[formatPos++]) > ' ')
  1152. {
  1153. if(delim == '\'')
  1154. {
  1155. while ((delim = format[formatPos++]) && delim != '\'') {}
  1156. }
  1157. else if(delim != 'z')
  1158. {
  1159. return delim;
  1160. }
  1161. }
  1162. }
  1163. while (delim > ' ');
  1164. return 0;
  1165. }
  1166. stock PlayerName(playerid)
  1167. {
  1168. new name[MAX_PLAYER_NAME];
  1169. GetPlayerName(playerid, name, sizeof(name));
  1170. return name;
  1171. }