Advertisement
Guest User

sscanf2.inc

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