Advertisement
Guest User

Sscanf2

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