1
0

sscanf2.inc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. /*
  2. * Version: MPL 1.1
  3. *
  4. * The contents of this file are subject to the Mozilla Public License Version
  5. * 1.1 (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. * http://www.mozilla.org/MPL/
  8. *
  9. * Software distributed under the License is distributed on an "AS IS" basis,
  10. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. * for the specific language governing rights and limitations under the
  12. * License.
  13. *
  14. * The Original Code is the sscanf 2.0 SA:MP plugin.
  15. *
  16. * The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  17. * Portions created by the Initial Developer are Copyright (C) 2010
  18. * the Initial Developer. All Rights Reserved.
  19. *
  20. * Contributor(s):
  21. *
  22. * Special Thanks to:
  23. *
  24. * SA:MP Team past, present and future
  25. */
  26. #define SSCANF:%0(%1) sscanf_%0(%1);public sscanf_%0(%1)
  27. #if defined sscanf
  28. #error sscanf (possibly the PAWN version) already defined.
  29. #endif
  30. native sscanf(const data[], const format[], {Float,_}:...);
  31. native unformat(const data[], const format[], {Float,_}:...) = sscanf;
  32. native SSCANF_Init(players, invalid, len);
  33. native SSCANF_Join(playerid, const name[], npc);
  34. native SSCANF_Leave(playerid);
  35. static stock
  36. SSCANF_gInit = 0xFFFFFFFF,
  37. SSCANF_gOPC,
  38. SSCANF_gOPDC;
  39. public OnFilterScriptInit()
  40. {
  41. printf("OnFilter");
  42. SSCANF_Init(GetMaxPlayers(), INVALID_PLAYER_ID, MAX_PLAYER_NAME);
  43. SSCANF_gInit = funcidx("SSCANF_OnGameModeInit") != -1;
  44. SSCANF_gOPC = funcidx("SSCANF_OnPlayerConnect") != -1;
  45. SSCANF_gOPDC = funcidx("SSCANF_OnPlayerDisconnect") != -1;
  46. return CallLocalFunction("SSCANF_OnFilterScriptInit", "");
  47. }
  48. #if defined _ALS_OnFilterScriptInit
  49. #undef OnFilterScriptInit
  50. #else
  51. #define _ALS_OnFilterScriptInit
  52. #endif
  53. #define OnFilterScriptInit SSCANF_OnFilterScriptInit
  54. forward OnFilterScriptInit();
  55. public OnGameModeInit()
  56. {
  57. printf("OnGameo");
  58. if (SSCANF_gInit == -1)
  59. {
  60. SSCANF_Init(GetMaxPlayers(), INVALID_PLAYER_ID, MAX_PLAYER_NAME);
  61. SSCANF_gInit = funcidx("SSCANF_OnGameModeInit") != -1;
  62. SSCANF_gOPC = funcidx("SSCANF_OnPlayerConnect") != -1;
  63. SSCANF_gOPDC = funcidx("SSCANF_OnPlayerDisconnect") != -1;
  64. }
  65. if (SSCANF_gInit)
  66. {
  67. // Can't do the clever assembly version without y_amx.
  68. /*#emit PUSH.S reason
  69. #emit PUSH.S playerid
  70. #emit PUSH.C 8
  71. #emit LCTRL 6
  72. #emit ADD.C 28
  73. #emit PUSH.pri
  74. #emit LOAD.pri SSCANF_gOPDC
  75. #emit SCTRL 6
  76. #emit RETN*/
  77. return CallLocalFunction("SSCANF_OnGameModeInit", "");
  78. }
  79. return 1;
  80. }
  81. #if defined _ALS_OnGameModeInit
  82. #undef OnGameModeInit
  83. #else
  84. #define _ALS_OnGameModeInit
  85. #endif
  86. #define OnGameModeInit SSCANF_OnGameModeInit
  87. forward OnGameModeInit();
  88. public OnPlayerConnect(playerid)
  89. {
  90. new
  91. name[MAX_PLAYER_NAME];
  92. GetPlayerName(playerid, name, sizeof (name));
  93. SSCANF_Join(playerid, name, IsPlayerNPC(playerid));
  94. if (SSCANF_gOPDC)
  95. {
  96. /*#emit PUSH.S playerid
  97. #emit PUSH.C 4
  98. #emit LCTRL 6
  99. #emit ADD.C 28
  100. #emit PUSH.pri
  101. #emit LOAD.pri SSCANF_gOPC
  102. #emit SCTRL 6
  103. #emit RETN*/
  104. return CallLocalFunction("SSCANF_OnPlayerConnect", "i", playerid);
  105. }
  106. return 1;
  107. }
  108. #if defined _ALS_OnPlayerConnect
  109. #undef OnPlayerConnect
  110. #else
  111. #define _ALS_OnPlayerConnect
  112. #endif
  113. #define OnPlayerConnect SSCANF_OnPlayerConnect
  114. forward OnPlayerConnect(playerid);
  115. public OnPlayerDisconnect(playerid, reason)
  116. {
  117. new
  118. ret = 1;
  119. if (SSCANF_gOPDC)
  120. {
  121. /*#emit PUSH.S reason
  122. #emit PUSH.S playerid
  123. #emit PUSH.C 8
  124. #emit LCTRL 6
  125. #emit ADD.C 28
  126. #emit PUSH.pri
  127. #emit LOAD.pri SSCANF_gOPDC
  128. #emit SCTRL 6
  129. #emit RETN*/
  130. ret = CallLocalFunction("SSCANF_OnPlayerDisconnect", "ii", playerid, reason);
  131. }
  132. SSCANF_Leave(playerid);
  133. return ret;
  134. }
  135. #if defined _ALS_OnPlayerDisconnect
  136. #undef OnPlayerDisconnect
  137. #else
  138. #define _ALS_OnPlayerDisconnect
  139. #endif
  140. #define OnPlayerDisconnect SSCANF_OnPlayerDisconnect
  141. forward OnPlayerDisconnect(playerid, reason);
  142. #define SSCANF_Init
  143. #define SSCANF_Join
  144. #define SSCANF_Leave
  145. #define extract%0->%1; EXTRN%1;unformat(_:EXTRZ:EXTRX:%0,##,%1,,);
  146. #define unformat(_:EXTRZ:EXTRX:%0,##,%1);%2else%3; if (unformat(_:EXTRX:%0,##,%1))%3;
  147. #define EXTRX:%0##,%9new%1,%2) EXTRY:%0##,|||%1|||%2)
  148. #define EXTRY: EXTR8:EXTR9:EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:
  149. #define EXTR8:EXTR9:EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:%0##%1,%2|||%6:%3=%9|||%4) %6_EXTRO:%0##%1,%2|||%3=%9|||%4)
  150. #define EXTR9:EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:%0##%1,%2|||%3=%9|||%4) __EXTRO:%0##%1,%2|||%3=%9|||%4)
  151. #define EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:%0##%1,%2|||%6:%3[%7]|||%4) %6_EXTRW:%0##%1,%2|||%3[%7]|||%4)
  152. #define EXTR1:EXTR2:EXTR3:EXTR4:%0##%1,%2|||%3[%7]|||%4) __EXTRW:%0##%1,%2|||%3|||%4)
  153. #define EXTR2:EXTR3:EXTR4:%0##%1,%2|||%6:%3|||%4) %6_EXTRN:%0##%1,%2|||%3|||%4)
  154. #define EXTR3:EXTR4:%0##%1,,%2||||||%4) %0##%1,%2)
  155. #define EXTR4:%0##%1,%2|||%3|||%4) __EXTRN:%0##%1,%2|||%3|||%4)
  156. // Optional specifiers.
  157. #define __EXTRO:%0##%1,%2|||%3=%9|||%4,%5) EXTRY:%0##%1I"("#%9")"#,%2,%3|||%4|||%5)
  158. #define Float_EXTRO:%0##%1,%2|||%3=%9|||%4,%5) EXTRY:%0##%1F"("#%9")"#,%2,%3|||%4|||%5)
  159. #define player_EXTRO:%0##%1,%2|||%3=%9|||%4,%5) EXTRY:%0##%1U"("#%9")"#,%2,%3|||%4|||%5)
  160. #define string_EXTRO:%0##%1,%2|||%3[%7]=%9|||%4,%5) EXTRY:%0##%1S"("#%9")"#[%7],%2,%3|||%4|||%5)
  161. // Normal specifiers (the double underscore is to work for "_:".
  162. #define __EXTRN:%0##%1,%2|||%3|||%4,%5) EXTRY:%0##%1i,%2,%3|||%4|||%5)
  163. #define Float_EXTRN:%0##%1,%2|||%3|||%4,%5) EXTRY:%0##%1f,%2,%3|||%4|||%5)
  164. #define player_EXTRN:%0##%1,%2|||%3|||%4,%5) EXTRY:%0##%1u,%2,%3|||%4|||%5)
  165. //#define string_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1s[%7],%2,%3|||%4|||%5)
  166. // Array versions of normal specifiers.
  167. #define __EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1a<i>[%7],%2,%3|||%4|||%5)
  168. #define Float_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1a<f>[%7],%2,%3|||%4|||%5)
  169. #define player_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1a<u>[%7],%2,%3|||%4|||%5)
  170. #define string_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1s[%7],%2,%3|||%4|||%5)
  171. // Get rid of excess leading space which causes warnings.
  172. #define EXTRN%0new%1; new%1;
  173. #if !defined string
  174. #define string:
  175. #endif
  176. #define player:
  177. #define hex:
  178. #define hex_EXTRO:%0##%1,%2|||%3=%9|||%4,%5) EXTRY:%0##%1H"("#%9")"#,%2,%3|||%4|||%5)
  179. #define hex_EXTRN:%0##%1,%2|||%3|||%4,%5) EXTRY:%0##%1h,%2,%3|||%4|||%5)
  180. #define hex_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1a<h>[%7],%2,%3|||%4|||%5)
  181. #define bin:
  182. #define bin_EXTRO:%0##%1,%2|||%3=%9|||%4,%5) EXTRY:%0##%1B"("#%9")"#,%2,%3|||%4|||%5)
  183. #define bin_EXTRN:%0##%1,%2|||%3|||%4,%5) EXTRY:%0##%1b,%2,%3|||%4|||%5)
  184. #define bin_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1a<b>[%7],%2,%3|||%4|||%5)
  185. #define kustom:%0<%1> %0
  186. #define kustom_EXTRO:%0##%1,%2|||%3<%8>=%9|||%4,%5) EXTRY:%0##%1K<%8>"("#%9")"#,%2,%3|||%4|||%5)
  187. #define kustom_EXTRN:%0##%1,%2|||%3<%8>|||%4,%5) EXTRY:%0##%1k<%8>,%2,%3|||%4|||%5)
  188. //#define bin_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1a<b>[%7],%2,%3|||%4|||%5)
  189. SSCANF:weapon(string[])
  190. {
  191. // This function is VERY basic, needs VASTLY improving to detect variations.
  192. if ('0' <= string[0] <= '9')
  193. {
  194. new
  195. ret = strval(string);
  196. if (0 <= ret <= 18 || 22 <= ret <= 46)
  197. {
  198. return ret;
  199. }
  200. }
  201. else if (!strcmp(string, "Unarmed")) return 0;
  202. else if (!strcmp(string, "Brass Knuckles")) return 1;
  203. else if (!strcmp(string, "Golf Club")) return 2;
  204. else if (!strcmp(string, "Night Stick")) return 3;
  205. else if (!strcmp(string, "Knife")) return 4;
  206. else if (!strcmp(string, "Baseball Bat")) return 5;
  207. else if (!strcmp(string, "Shovel")) return 6;
  208. else if (!strcmp(string, "Pool cue")) return 7;
  209. else if (!strcmp(string, "Katana")) return 8;
  210. else if (!strcmp(string, "Chainsaw")) return 9;
  211. else if (!strcmp(string, "Purple Dildo")) return 10;
  212. else if (!strcmp(string, "White Dildo")) return 11;
  213. else if (!strcmp(string, "Long White Dildo")) return 12;
  214. else if (!strcmp(string, "White Dildo 2")) return 13;
  215. else if (!strcmp(string, "Flowers")) return 14;
  216. else if (!strcmp(string, "Cane")) return 15;
  217. else if (!strcmp(string, "Grenades")) return 16;
  218. else if (!strcmp(string, "Tear Gas")) return 17;
  219. else if (!strcmp(string, "Molotovs")) return 18;
  220. else if (!strcmp(string, "Pistol")) return 22;
  221. else if (!strcmp(string, "Silenced Pistol")) return 23;
  222. else if (!strcmp(string, "Desert Eagle")) return 24;
  223. else if (!strcmp(string, "Shotgun")) return 25;
  224. else if (!strcmp(string, "Sawn Off Shotgun")) return 26;
  225. else if (!strcmp(string, "Combat Shotgun")) return 27;
  226. else if (!strcmp(string, "Micro Uzi")) return 28;
  227. else if (!strcmp(string, "Mac 10")) return 28;
  228. else if (!strcmp(string, "MP5")) return 29;
  229. else if (!strcmp(string, "AK47")) return 30;
  230. else if (!strcmp(string, "M4")) return 31;
  231. else if (!strcmp(string, "Tec9")) return 32;
  232. else if (!strcmp(string, "Rifle")) return 33;
  233. else if (!strcmp(string, "Sniper Rifle")) return 34;
  234. else if (!strcmp(string, "RPG")) return 35;
  235. else if (!strcmp(string, "Missile Launcher")) return 36;
  236. else if (!strcmp(string, "Flame Thrower")) return 37;
  237. else if (!strcmp(string, "Minigun")) return 38;
  238. else if (!strcmp(string, "Sachel Charges")) return 39;
  239. else if (!strcmp(string, "Detonator")) return 40;
  240. else if (!strcmp(string, "Spray Paint")) return 41;
  241. else if (!strcmp(string, "Fire Extinguisher")) return 42;
  242. else if (!strcmp(string, "Camera")) return 43;
  243. else if (!strcmp(string, "Nightvision Goggles")) return 44;
  244. else if (!strcmp(string, "Thermal Goggles")) return 45;
  245. else if (!strcmp(string, "Parachute")) return 46;
  246. return -1;
  247. }
  248. SSCANF:vehicle(string[])
  249. {
  250. // This function is VERY basic, needs VASTLY improving to detect variations.
  251. if ('0' <= string[0] <= '9')
  252. {
  253. new
  254. ret = strval(string);
  255. if (400 <= ret <= 611)
  256. {
  257. return ret;
  258. }
  259. }
  260. else if (!strcmp(string, "Landstalker")) return 400;
  261. else if (!strcmp(string, "Bravura")) return 401;
  262. else if (!strcmp(string, "Buffalo")) return 402;
  263. else if (!strcmp(string, "Linerunner")) return 403;
  264. else if (!strcmp(string, "Perenniel")) return 404;
  265. else if (!strcmp(string, "Sentinel")) return 405;
  266. else if (!strcmp(string, "Dumper")) return 406;
  267. else if (!strcmp(string, "Firetruck")) return 407;
  268. else if (!strcmp(string, "Trashmaster")) return 408;
  269. else if (!strcmp(string, "Stretch")) return 409;
  270. else if (!strcmp(string, "Manana")) return 410;
  271. else if (!strcmp(string, "Infernus")) return 411;
  272. else if (!strcmp(string, "Voodoo")) return 412;
  273. else if (!strcmp(string, "Pony")) return 413;
  274. else if (!strcmp(string, "Mule")) return 414;
  275. else if (!strcmp(string, "Cheetah")) return 415;
  276. else if (!strcmp(string, "Ambulance")) return 416;
  277. else if (!strcmp(string, "Leviathan")) return 417;
  278. else if (!strcmp(string, "Moonbeam")) return 418;
  279. else if (!strcmp(string, "Esperanto")) return 419;
  280. else if (!strcmp(string, "Taxi")) return 420;
  281. else if (!strcmp(string, "Washington")) return 421;
  282. else if (!strcmp(string, "Bobcat")) return 422;
  283. else if (!strcmp(string, "Mr Whoopee")) return 423;
  284. else if (!strcmp(string, "BF Injection")) return 424;
  285. else if (!strcmp(string, "Hunter")) return 425;
  286. else if (!strcmp(string, "Premier")) return 426;
  287. else if (!strcmp(string, "Enforcer")) return 427;
  288. else if (!strcmp(string, "Securicar")) return 428;
  289. else if (!strcmp(string, "Banshee")) return 429;
  290. else if (!strcmp(string, "Predator")) return 430;
  291. else if (!strcmp(string, "Bus")) return 431;
  292. else if (!strcmp(string, "Rhino")) return 432;
  293. else if (!strcmp(string, "Barracks")) return 433;
  294. else if (!strcmp(string, "Hotknife")) return 434;
  295. else if (!strcmp(string, "Article Trailer")) return 435;
  296. else if (!strcmp(string, "Previon")) return 436;
  297. else if (!strcmp(string, "Coach")) return 437;
  298. else if (!strcmp(string, "Cabbie")) return 438;
  299. else if (!strcmp(string, "Stallion")) return 439;
  300. else if (!strcmp(string, "Rumpo")) return 440;
  301. else if (!strcmp(string, "RC Bandit")) return 441;
  302. else if (!strcmp(string, "Romero")) return 442;
  303. else if (!strcmp(string, "Packer")) return 443;
  304. else if (!strcmp(string, "Monster")) return 444;
  305. else if (!strcmp(string, "Admiral")) return 445;
  306. else if (!strcmp(string, "Squallo")) return 446;
  307. else if (!strcmp(string, "Seasparrow")) return 447;
  308. else if (!strcmp(string, "Pizzaboy")) return 448;
  309. else if (!strcmp(string, "Tram")) return 449;
  310. else if (!strcmp(string, "Article Trailer 2")) return 450;
  311. else if (!strcmp(string, "Turismo")) return 451;
  312. else if (!strcmp(string, "Speeder")) return 452;
  313. else if (!strcmp(string, "Reefer")) return 453;
  314. else if (!strcmp(string, "Tropic")) return 454;
  315. else if (!strcmp(string, "Flatbed")) return 455;
  316. else if (!strcmp(string, "Yankee")) return 456;
  317. else if (!strcmp(string, "Caddy")) return 457;
  318. else if (!strcmp(string, "Solair")) return 458;
  319. else if (!strcmp(string, "Berkley's RC Van")) return 459;
  320. else if (!strcmp(string, "Skimmer")) return 460;
  321. else if (!strcmp(string, "PCJ-600")) return 461;
  322. else if (!strcmp(string, "Faggio")) return 462;
  323. else if (!strcmp(string, "Freeway")) return 463;
  324. else if (!strcmp(string, "RC Baron")) return 464;
  325. else if (!strcmp(string, "RC Raider")) return 465;
  326. else if (!strcmp(string, "Glendale")) return 466;
  327. else if (!strcmp(string, "Oceanic")) return 467;
  328. else if (!strcmp(string, "Sanchez")) return 468;
  329. else if (!strcmp(string, "Sparrow")) return 469;
  330. else if (!strcmp(string, "Patriot")) return 470;
  331. else if (!strcmp(string, "Quad")) return 471;
  332. else if (!strcmp(string, "Coastguard")) return 472;
  333. else if (!strcmp(string, "Dinghy")) return 473;
  334. else if (!strcmp(string, "Hermes")) return 474;
  335. else if (!strcmp(string, "Sabre")) return 475;
  336. else if (!strcmp(string, "Rustler")) return 476;
  337. else if (!strcmp(string, "ZR-350")) return 477;
  338. else if (!strcmp(string, "Walton")) return 478;
  339. else if (!strcmp(string, "Regina")) return 479;
  340. else if (!strcmp(string, "Comet")) return 480;
  341. else if (!strcmp(string, "BMX")) return 481;
  342. else if (!strcmp(string, "Burrito")) return 482;
  343. else if (!strcmp(string, "Camper")) return 483;
  344. else if (!strcmp(string, "Marquis")) return 484;
  345. else if (!strcmp(string, "Baggage")) return 485;
  346. else if (!strcmp(string, "Dozer")) return 486;
  347. else if (!strcmp(string, "Maverick")) return 487;
  348. else if (!strcmp(string, "SAN News Maverick")) return 488;
  349. else if (!strcmp(string, "Rancher")) return 489;
  350. else if (!strcmp(string, "FBI Rancher")) return 490;
  351. else if (!strcmp(string, "Virgo")) return 491;
  352. else if (!strcmp(string, "Greenwood")) return 492;
  353. else if (!strcmp(string, "Jetmax")) return 493;
  354. else if (!strcmp(string, "Hotring Racer")) return 494;
  355. else if (!strcmp(string, "Sandking")) return 495;
  356. else if (!strcmp(string, "Blista Compact")) return 496;
  357. else if (!strcmp(string, "Police Maverick")) return 497;
  358. else if (!strcmp(string, "Boxville")) return 498;
  359. else if (!strcmp(string, "Benson")) return 499;
  360. else if (!strcmp(string, "Mesa")) return 500;
  361. else if (!strcmp(string, "RC Goblin")) return 501;
  362. else if (!strcmp(string, "Hotring Racer")) return 502;
  363. else if (!strcmp(string, "Hotring Racer")) return 503;
  364. else if (!strcmp(string, "Bloodring Banger")) return 504;
  365. else if (!strcmp(string, "Rancher")) return 505;
  366. else if (!strcmp(string, "Super GT")) return 506;
  367. else if (!strcmp(string, "Elegant")) return 507;
  368. else if (!strcmp(string, "Journey")) return 508;
  369. else if (!strcmp(string, "Bike")) return 509;
  370. else if (!strcmp(string, "Mountain Bike")) return 510;
  371. else if (!strcmp(string, "Beagle")) return 511;
  372. else if (!strcmp(string, "Cropduster")) return 512;
  373. else if (!strcmp(string, "Stuntplane")) return 513;
  374. else if (!strcmp(string, "Tanker")) return 514;
  375. else if (!strcmp(string, "Roadtrain")) return 515;
  376. else if (!strcmp(string, "Nebula")) return 516;
  377. else if (!strcmp(string, "Majestic")) return 517;
  378. else if (!strcmp(string, "Buccaneer")) return 518;
  379. else if (!strcmp(string, "Shamal")) return 519;
  380. else if (!strcmp(string, "Hydra")) return 520;
  381. else if (!strcmp(string, "FCR-900")) return 521;
  382. else if (!strcmp(string, "NRG-500")) return 522;
  383. else if (!strcmp(string, "HPV1000")) return 523;
  384. else if (!strcmp(string, "Cement Truck")) return 524;
  385. else if (!strcmp(string, "Towtruck")) return 525;
  386. else if (!strcmp(string, "Fortune")) return 526;
  387. else if (!strcmp(string, "Cadrona")) return 527;
  388. else if (!strcmp(string, "FBI Truck")) return 528;
  389. else if (!strcmp(string, "Willard")) return 529;
  390. else if (!strcmp(string, "Forklift")) return 530;
  391. else if (!strcmp(string, "Tractor")) return 531;
  392. else if (!strcmp(string, "Combine Harvester")) return 532;
  393. else if (!strcmp(string, "Feltzer")) return 533;
  394. else if (!strcmp(string, "Remington")) return 534;
  395. else if (!strcmp(string, "Slamvan")) return 535;
  396. else if (!strcmp(string, "Blade")) return 536;
  397. else if (!strcmp(string, "Freight (Train)")) return 537;
  398. else if (!strcmp(string, "Brownstreak (Train)")) return 538;
  399. else if (!strcmp(string, "Vortex")) return 539;
  400. else if (!strcmp(string, "Vincent")) return 540;
  401. else if (!strcmp(string, "Bullet")) return 541;
  402. else if (!strcmp(string, "Clover")) return 542;
  403. else if (!strcmp(string, "Sadler")) return 543;
  404. else if (!strcmp(string, "Firetruck LA")) return 544;
  405. else if (!strcmp(string, "Hustler")) return 545;
  406. else if (!strcmp(string, "Intruder")) return 546;
  407. else if (!strcmp(string, "Primo")) return 547;
  408. else if (!strcmp(string, "Cargobob")) return 548;
  409. else if (!strcmp(string, "Tampa")) return 549;
  410. else if (!strcmp(string, "Sunrise")) return 550;
  411. else if (!strcmp(string, "Merit")) return 551;
  412. else if (!strcmp(string, "Utility Van")) return 552;
  413. else if (!strcmp(string, "Nevada")) return 553;
  414. else if (!strcmp(string, "Yosemite")) return 554;
  415. else if (!strcmp(string, "Windsor")) return 555;
  416. else if (!strcmp(string, "Monster \"A\"")) return 556;
  417. else if (!strcmp(string, "Monster \"B\"")) return 557;
  418. else if (!strcmp(string, "Uranus")) return 558;
  419. else if (!strcmp(string, "Jester")) return 559;
  420. else if (!strcmp(string, "Sultan")) return 560;
  421. else if (!strcmp(string, "Stratum")) return 561;
  422. else if (!strcmp(string, "Elegy")) return 562;
  423. else if (!strcmp(string, "Raindance")) return 563;
  424. else if (!strcmp(string, "RC Tiger")) return 564;
  425. else if (!strcmp(string, "Flash")) return 565;
  426. else if (!strcmp(string, "Tahoma")) return 566;
  427. else if (!strcmp(string, "Savanna")) return 567;
  428. else if (!strcmp(string, "Bandito")) return 568;
  429. else if (!strcmp(string, "Freight Flat Trailer (Train)")) return 569;
  430. else if (!strcmp(string, "Streak Trailer (Train)")) return 570;
  431. else if (!strcmp(string, "Kart")) return 571;
  432. else if (!strcmp(string, "Mower")) return 572;
  433. else if (!strcmp(string, "Dune")) return 573;
  434. else if (!strcmp(string, "Sweeper")) return 574;
  435. else if (!strcmp(string, "Broadway")) return 575;
  436. else if (!strcmp(string, "Tornado")) return 576;
  437. else if (!strcmp(string, "AT400")) return 577;
  438. else if (!strcmp(string, "DFT-30")) return 578;
  439. else if (!strcmp(string, "Huntley")) return 579;
  440. else if (!strcmp(string, "Stafford")) return 580;
  441. else if (!strcmp(string, "BF-400")) return 581;
  442. else if (!strcmp(string, "Newsvan")) return 582;
  443. else if (!strcmp(string, "Tug")) return 583;
  444. else if (!strcmp(string, "Petrol Trailer")) return 584;
  445. else if (!strcmp(string, "Emperor")) return 585;
  446. else if (!strcmp(string, "Wayfarer")) return 586;
  447. else if (!strcmp(string, "Euros")) return 587;
  448. else if (!strcmp(string, "Hotdog")) return 588;
  449. else if (!strcmp(string, "Club")) return 589;
  450. else if (!strcmp(string, "Freight Box Trailer (Train)")) return 590;
  451. else if (!strcmp(string, "Article Trailer 3")) return 591;
  452. else if (!strcmp(string, "Andromada")) return 592;
  453. else if (!strcmp(string, "Dodo")) return 593;
  454. else if (!strcmp(string, "RC Cam")) return 594;
  455. else if (!strcmp(string, "Launch")) return 595;
  456. else if (!strcmp(string, "Police Car (LSPD)")) return 596;
  457. else if (!strcmp(string, "Police Car (SFPD)")) return 597;
  458. else if (!strcmp(string, "Police Car (LVPD)")) return 598;
  459. else if (!strcmp(string, "Police Ranger")) return 599;
  460. else if (!strcmp(string, "Picador")) return 600;
  461. else if (!strcmp(string, "S.W.A.T.")) return 601;
  462. else if (!strcmp(string, "Alpha")) return 602;
  463. else if (!strcmp(string, "Phoenix")) return 603;
  464. else if (!strcmp(string, "Glendale Shit")) return 604;
  465. else if (!strcmp(string, "Sadler Shit")) return 605;
  466. else if (!strcmp(string, "Baggage Trailer \"A\"")) return 606;
  467. else if (!strcmp(string, "Baggage Trailer \"B\"")) return 607;
  468. else if (!strcmp(string, "Tug Stairs Trailer")) return 608;
  469. else if (!strcmp(string, "Boxville")) return 609;
  470. else if (!strcmp(string, "Farm Trailer")) return 610;
  471. else if (!strcmp(string, "Utility Trailer")) return 611;
  472. return -1;
  473. }
  474. #define sscanf(%0:...) old_sscanf(%0:...)