1
0

sscanf2.inc 24 KB

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