sscanf2.inc 21 KB

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