1
0

sscanf2.inc 25 KB

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