sscanf.inc 21 KB

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