Advertisement
Shiny_

AVC

May 5th, 2013
642
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 31.90 KB | None | 0 0
  1. /* by Shiny */
  2.  
  3. /*
  4. Licencja:
  5.     Copyright (c) 2013, Shiny
  6.     Wszystkie prawa zastrzeżone.
  7.     Redystrybucja i używanie, czy to w formie kodu źródłowego, czy w formie kodu wykonawczego, są dozwolone pod warunkiem spełnienia poniższych warunków:
  8.     Redystrybucja kodu źródłowego musi zawierać powyższą notę dotyczącą praw autorskich, niniejszą listę warunków oraz poniższe oświadczenie o wyłączeniu odpowiedzialności.
  9.     Redystrybucja kodu wykonawczego musi zawierać powyższą notę dotyczącą praw autorskich, niniejszą listę warunków oraz poniższe oświadczenie o wyłączeniu odpowiedzialności w dokumentacji i/lub w w innych materiałach dostarczanych wraz z kopią oprogramowania.
  10.     Ani nazwa AVC, ani nazwa Advanced Vehicle Creator nie mogą być użyte celem sygnowania lub promowania produktów pochodzących od tego oprogramowania, bez szczególnego, wyrażonego na piśmie ich zezwolenia.
  11.     To oprogramowanie jest dostarczone przez użytkownika Shiny “tak, jak jest”. Każda, dorozumiana lub bezpośrednio wyrażona gwarancja, nie wyłączając dorozumianej gwarancji przydatności handlowej i przydatności do określonego zastosowania, jest wyłączona.
  12.     W żadnym wypadku posiadacze praw autorskich nie mogą być odpowiedzialni za jakiekolwiek bezpośrednie, pośrednie, incydentalne, specjalne, uboczne i wtórne szkody (nie wyłączając obowiązku dostarczenia produktu zastępczego lub serwisu, odpowiedzialności z tytułu utraty walorów użytkowych, utraty danych lub korzyści a także przerw w pracy przedsiębiorstwa)
  13.     spowodowane w jakikolwiek sposób i na podstawie istniejącej w torii odpowiedzialności kontraktowej, całkowitej lub deliktowej (wynikłej zarówno z niedbalstwa jak innych postaci winy), powstałe w jakikolwiek sposób w wyniku używania lub mające związek z używaniem oprogramowania, nawet jeśli o możliwości powstania takich szkód ostrzeżono.
  14. */
  15. #define FILTERSCRIPT // Wymagane przez ZCMD
  16.  
  17. #include <a_samp>
  18. #include <mselection>
  19. #include <mysql>
  20. #include <YSI\y_iterate>
  21. #include <zcmd>
  22.  
  23. #undef mS_NEXT_TEXT
  24. #undef mS_PREV_TEXT
  25. #undef mS_CANCEL_TEXT
  26.  
  27. #define SQL_HOST                    "localhost"
  28. #define SQL_USR                     "Twoja nazwa użytkownika"
  29. #define SQL_PSWRD                   "Twoje hasło"
  30. #define SQL_DB                      "Twoja baza danych"
  31.  
  32. #define SQL_TABLE                   "elementy"
  33. #define SQL_TYPE                    "typ"
  34. #define SQL_MODEL                   "model"
  35. #define SQL_CARS                    "pojazd"
  36. #define SQL_SKINS                   "skin"
  37.  
  38. #define mS_NEXT_TEXT                "Dalej"
  39. #define mS_PREV_TEXT                "Wstecz"
  40. #define mS_CANCEL_TEXT              "Anuluj"
  41. #define UNABLE_TO_CONNECT           "Wystąpił problem przy próbie połączenia się z bazą danych!\nW związku z zaistniałą sytuacją serwer zostanie wyłączony!"
  42. #define TABLE_WAS_ADDED             "Tabela `"#SQL_TABLE"` została dodana!"
  43. #define VEHICLE_SELECTION_CANCEL    "Wybór pojazdu został przez Ciebie anulowany!"
  44. #define SKIN_SELECTION_CANCEL       "Wybór skina został przez Ciebie anulowany!"
  45. #define VEHICLE_SELECTED            "Pojazd został wybrany!"
  46. #define SKIN_SELECTED               "Skin został wybrany!"
  47. #define SELECT_SKIN                 "Wybierz skin"
  48. #define VEHICLE_SELECT_METHOD       "Wybierz metodę wyboru pojazdu"
  49. #define SELECT_BY_CLICK             "Wybór poprzez kliknięcie na obrazek pojazdu\n"
  50. #define SELECT_BY_DIALOG            "Wybór poprzez kliknięcie i wybranie pojazdu z listy dialogowej\n"
  51. #define SELECT_BY_INPUT             "Wybór poprzez wpisanie nazwy pojazdu w oknie dialogowym"
  52. #define SELECT                      "Wybierz"
  53. #define CANCEL                      "Anuluj"
  54. #define CLOSE                       "Zamknij"
  55. #define EMPTY                       ""
  56. #define BAD_VEHICLE_NAME            "Zła nazwa pojazdu!"
  57. #define VEHICLE_TYPE_SELECT         "Wybierz kategorię pojazdu"
  58. #define CAR_LIST                    "Samoloty\nHelikoptery\nMotocykle\nRowery\nKabriolety\nPrzemysłowe\nLowridery\nTerenowe\nPubliczne\nSalonowe\nSportowe\nKombi\nŁodzie\nUnikalne"
  59. #define SELECT_VEHICLE              "Wybierz pojazd"
  60. #define BACK                        "Cofnij"
  61. #define ENTERING_NAME               "Wpisywanie nazwy pojazdu"
  62. #define ENTER_NAME_IN_FIELD_BELOW   "Wpisz nazwę pojazdu w polu poniżej"
  63. #define OKAY                        "Okej"
  64. #define COMMAND_IS_ONLY_FOR_ADMIN   "Komenda dostępna tylko i wyłącznie dla administratora!"
  65. #define CARS_CREATED_BY_V           "Auta stworzone za pomocą komendy /V zostały usunięte."
  66. #define SKIN_COMMAND                CMD:skin(playerid)
  67. #define VEHICLE_COMMAND             CMD:v(playerid, params[])
  68. #define RESPAWN_COMMAND             CMD:respawn(playerid)
  69.  
  70. // #define ONLY_FOR_ADMIN
  71.  
  72. #if !defined mysql_format_ex
  73.     #define mysql_format_ex(%1,%2) format(QueryString, sizeof(QueryString), %1, %2), mysql_query(QueryString)
  74. #endif
  75.  
  76. #if !defined function
  77.     #define function%0(%1) forward%0(%1); public%0(%1)
  78. #endif
  79.  
  80. new bool:Commanded[MAX_VEHICLES];
  81. new MySQL:hMYSQL;
  82. new QueryString[500];
  83. new vehiclelist = mS_INVALID_LISTID;
  84. new skinlist = mS_INVALID_LISTID;
  85. new gVehicleNames[212][] =
  86. {
  87.     "Landstalker", "Bravura", "Buffalo", "Linerunner", "Pereniel", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana",
  88.     "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat",
  89.     "Mr Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks",
  90.     "Hotknife", "Trailer", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
  91.     "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy",
  92.     "Solair", "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Harley", "RC Baron", "RC Raider", "Glendale", "Oceanic",
  93.     "Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR3 50", "Walton", "Regina",
  94.     "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher", "FBI Rancher",
  95.     "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking", "Blista Compact", "Police Maverick", "Boxville", "Benson", "Mesa",
  96.     "RC Goblin", "Hotring Racer", "Hotring Racer", "Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike",
  97.     "Mountain Bike", "Beagle", "Cropdust", "Stunt", "Tanker", "RoadTrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
  98.     "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune", "Cadrona", "FBI Truck", "Willard", "Forklift", "Traktor",
  99.     "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent", "Bullet", "Clover", "Sadler",
  100.     "Firetruck", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite", "Windsor",
  101.     "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna",
  102.     "Bandito", "Freight", "Trailer", "Kart", "Mower", "Duneride", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley",
  103.     "Stafford", "BF-400", "Newsvan", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club", "Trailer", "Trailer",
  104.     "Andromeda", "Dodo", "RC Cam", "Launch", "Radiowoz", "Radiowoz", "Radiowoz", "Radiowoz", "Picador", "S.W.A.T. Van",
  105.     "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage Trailer", "Luggage Trailer", "Stair Trailer", "Boxville", "Farm Plow", "Utility Trailer"
  106. };
  107.  
  108. enum
  109. {
  110.     DIALOG_VEHICLES_CATEGORY = 0,
  111.     DIALOG_VEHICLES_PLANES,
  112.     DIALOG_VEHICLES_HELICOPTERS,
  113.     DIALOG_VEHICLES_MOTORCYCLES,
  114.     DIALOG_VEHICLES_BIKES,
  115.     DIALOG_VEHICLES_CABRIOS,
  116.     DIALOG_VEHICLES_INDUSTRIALS,
  117.     DIALOG_VEHICLES_LOWRIDERS,
  118.     DIALOG_VEHICLES_OFF_ROAD,
  119.     DIALOG_VEHICLES_PUBLIC,
  120.     DIALOG_VEHICLES_SALOON,
  121.     DIALOG_VEHICLES_SPORT,
  122.     DIALOG_VEHICLES_WAGONS,
  123.     DIALOG_VEHICLES_BOATS,
  124.     DIALOG_VEHICLES_UNIQUE,
  125.     DIALOG_VEHICLES_SELECTOR,
  126.     DIALOG_VEHICLES_INPUT,
  127. };
  128.  
  129. // Stocki:
  130. function Respawning_Vehicles(vehicleid) // by Maktab
  131. {
  132.     RespawnUnusedVehicles();
  133.     SendClientMessage(vehicleid, -1, "Auta stworzone za pomocą komendy /V zostały usunięte.");
  134.     return 1;
  135. }
  136.  
  137. stock RespawnUnusedVehicles() // by Maktab
  138. {
  139.     new UsedVeh[MAX_VEHICLES] = {false, ...};
  140.    
  141.     foreach(Player, playerid)
  142.     UsedVeh[GetPlayerVehicleID(playerid)] = true;
  143.    
  144.     for(new vehicleid = 1; vehicleid != MAX_VEHICLES; vehicleid++)
  145.     {// Jezeli pojazd jest używany, przechodzimy do następnej iteracji
  146.         if(UsedVeh[vehicleid])
  147.             continue;
  148.        
  149.         // if(Commanded[vehicleid])
  150.         // {
  151.             // DestroyVehicle(vehicleid);
  152.             // Commanded[vehicleid] = false;
  153.         // }
  154.         // else
  155.         if(Commanded[vehicleid]) return DestroyVehicle(vehicleid), Commanded[vehicleid] = false;
  156.         SetVehicleToRespawn(vehicleid);
  157.     }
  158.     return 1;
  159. }
  160.  
  161. stock CreatePlayerVehicle(playerid, modelid)
  162. {
  163.     new vehicle, Float:X, Float:Y, Float:Z, Float:angle;
  164.     if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  165.     {
  166.         vehicle = GetPlayerVehicleID(playerid);
  167.         GetVehiclePos(vehicle, X, Y, Z);
  168.         GetVehicleZAngle(vehicle, angle);
  169.         DestroyVehicle(vehicle);
  170.     }
  171.     else
  172.     {
  173.         GetPlayerPos(playerid, X, Y, Z);
  174.         GetPlayerFacingAngle(playerid, angle);
  175.     }
  176.     vehicle = AddStaticVehicle(modelid, X, Y, Z + 1, angle, -1, -1);
  177.     LinkVehicleToInterior(vehicle, GetPlayerInterior(playerid));
  178.     SetVehicleVirtualWorld(vehicle, GetPlayerVirtualWorld(playerid));
  179.     SetVehicleNumberPlate(vehicle, PlayerName(playerid));
  180.     PutPlayerInVehicle(playerid, vehicle, 0);
  181.     Commanded[vehicle] = true; // respawn aut
  182.     return 1;
  183. }
  184.  
  185. stock GetVehicleModelIdByName(vehiclename[])
  186. {
  187.     for(new i = 0; i < 211; i++)
  188.         if(strfind(gVehicleNames[i], vehiclename, true) != -1) return i + 400;
  189.     return -1;
  190. }
  191.  
  192. stock mysql_fetch_field_int(field[])
  193. {
  194.     new tmp_str[30];
  195.     mysql_fetch_field(field, tmp_str);
  196.     return strval(tmp_str);
  197. }
  198.  
  199. stock Float: mysql_fetch_field_float(field[])
  200. {
  201.     new tmp_str[60];
  202.     mysql_fetch_field(field, tmp_str);
  203.     return floatstr(tmp_str);
  204. }
  205.  
  206. stock LoadModelSelectionMenuEx(base_name[], list_type[])
  207. {
  208.     mysql_format_ex("SELECT * FROM %s WHERE "#SQL_TYPE" = '%s'", base_name, list_type);
  209.     mysql_store_result();
  210.     if(!mysql_num_rows())
  211.     {
  212.         printf("-mSelection- WARNING: Failed to load models with type %s", list_type);
  213.         return mS_INVALID_LISTID;
  214.     }
  215.  
  216.     if(gListAmount >= mS_TOTAL_LISTS)
  217.     {
  218.         printf("-mSelection- WARNING: Reached maximum amount of lists, increase \"mS_TOTAL_LISTS\"");
  219.         return mS_INVALID_LISTID;
  220.     }
  221.     new tmp_ItemAmount = gItemAmount; // copy value if loading fails
  222.    
  223.     for(new i; i < mysql_num_rows(); i++)
  224.     {
  225.         mysql_data_seek(i);
  226.         mysql_fetch_row_data();
  227.         if(tmp_ItemAmount >= mS_TOTAL_ITEMS)
  228.         {
  229.             printf("-mSelection- WARNING: Reached maximum amount of items, increase \"mS_TOTAL_ITEMS\"");
  230.             break;
  231.         }
  232.         new mID = mysql_fetch_field_int(SQL_MODEL);
  233.         if(0 <= mID < 20000)
  234.         {
  235.             gItemList[tmp_ItemAmount][mS_ITEM_MODEL] = mID;
  236.             new Float:mRotation[3], Float:mZoom = 1.0;
  237.             new bool:useRotation = false;
  238.            
  239.             if(useRotation)
  240.             {
  241.                 new bool:foundRotZoom = false;
  242.                 for(new val = 0; val < gRotZoomAmount; val++)
  243.                 {
  244.                     if(gRotZoom[val][0] == mRotation[0] && gRotZoom[val][1] == mRotation[1] && gRotZoom[val][2] == mRotation[2] && gRotZoom[val][3] == mZoom)
  245.                     {
  246.                         foundRotZoom = true;
  247.                         gItemList[tmp_ItemAmount][mS_ITEM_ROT_ZOOM_ID] = val;
  248.                         break;
  249.                     }
  250.                 }
  251.                 if(gRotZoomAmount < mS_TOTAL_ROT_ZOOM)
  252.                 {
  253.                     if(!foundRotZoom)
  254.                     {
  255.                         gRotZoom[gRotZoomAmount][0] = mRotation[0];
  256.                         gRotZoom[gRotZoomAmount][1] = mRotation[1];
  257.                         gRotZoom[gRotZoomAmount][2] = mRotation[2];
  258.                         gRotZoom[gRotZoomAmount][3] = mZoom;
  259.                         gItemList[tmp_ItemAmount][mS_ITEM_ROT_ZOOM_ID] = gRotZoomAmount;
  260.                         gRotZoomAmount++;
  261.                     }
  262.                 }
  263.                 else print("-mSelection- WARNING: Not able to save rotation/zoom information. Reached maximum rotation/zoom information count. Increase '#define mS_TOTAL_ROT_ZOOM' to fix the issue");
  264.             }
  265.             else gItemList[tmp_ItemAmount][mS_ITEM_ROT_ZOOM_ID] = -1;
  266.             tmp_ItemAmount++;
  267.         }
  268.     }
  269.     if(tmp_ItemAmount > gItemAmount) // any models loaded ?
  270.     {
  271.         gLists[gListAmount][mS_LIST_START] = gItemAmount;
  272.         gItemAmount = tmp_ItemAmount; // copy back
  273.         gLists[gListAmount][mS_LIST_END] = (gItemAmount-1);
  274.         gListAmount++;
  275.         return (gListAmount-1);
  276.     }
  277.     return mS_INVALID_LISTID;
  278. }  
  279.  
  280. stock str_del_free_space(string[], _char = ' ')
  281. {
  282.     new len = strlen (string);
  283.     if(len)
  284.     {
  285.         new begin = -1, end = len;
  286.         while(string[++begin] == _char){}
  287.         if(string[begin] == EOS)
  288.         {
  289.              string [0] = 0;
  290.              return 1;
  291.         }
  292.         while(string[--end] == _char){}
  293.         strmid(string, string, begin, end+1, len+1);
  294.     }
  295.     return 1;
  296. }
  297.  
  298. stock PlayerName(p)
  299. {
  300.     new N[MAX_PLAYER_NAME];
  301.     GetPlayerName(p, N, sizeof(N));
  302.     return N;
  303. }
  304.  
  305. public OnFilterScriptInit()
  306. {
  307.     hMYSQL = mysql_init(1);
  308.     new mHandle = mysql_connect(SQL_HOST, SQL_USR, SQL_PSWRD, SQL_DB, hMYSQL, 1);
  309.     if(!mHandle) return printf(#UNABLE_TO_CONNECT), SendRconCommand("exit");
  310.        
  311.     new string_[240];
  312.     strcat(string_, "CREATE TABLE IF NOT EXISTS "#SQL_TABLE"");
  313.     strcat(string_, "(");
  314.     strcat(string_, "`"#SQL_TYPE"` varchar(60) DEFAULT NULL,");
  315.     strcat(string_, "`"#SQL_MODEL"` int(11) NOT NULL");
  316.     strcat(string_, ") ENGINE = MyISAM  DEFAULT CHARSET = latin1;");
  317.     mysql_query(string_), printf(#TABLE_WAS_ADDED);
  318.    
  319.     skinlist = LoadModelSelectionMenuEx(#SQL_TABLE, #SQL_SKINS);
  320.     vehiclelist = LoadModelSelectionMenuEx(#SQL_TABLE, #SQL_CARS);
  321.    
  322.     SetTimer("Respawning_Vehicles", 15 * 60 * 1000, true);
  323.     return 1;
  324. }
  325.  
  326. public OnPlayerModelSelection(playerid, response, listid, modelid)
  327. {
  328.     if(listid == vehiclelist)
  329.     {
  330.         if(!response) return SendClientMessage(playerid, 0xFF0000FF, #VEHICLE_SELECTION_CANCEL);
  331.         SendClientMessage(playerid, 0xFF0000FF, #VEHICLE_SELECTED);
  332.         CreatePlayerVehicle(playerid, modelid);
  333.     }
  334.     else if(listid == skinlist)
  335.     {
  336.         if(!response) return SendClientMessage(playerid, 0xFF0000FF, #SKIN_SELECTION_CANCEL);
  337.         SendClientMessage(playerid, 0xFF0000FF, SKIN_SELECTED);
  338.         SetPlayerSkin(playerid, modelid);
  339.     }
  340.     return 1;
  341. }
  342.  
  343. SKIN_COMMAND
  344. {
  345.     ShowModelSelectionMenu(playerid, skinlist, #SELECT_SKIN);
  346.     return 1;
  347. }
  348.  
  349. VEHICLE_COMMAND
  350. {
  351.     str_del_free_space(params);
  352.     if(isnull(params)) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_SELECTOR, DIALOG_STYLE_LIST, #VEHICLE_SELECT_METHOD, #SELECT_BY_CLICK #SELECT_BY_DIALOG #SELECT_BY_INPUT, #SELECT, #EMPTY);
  353.     if(GetVehicleModelIdByName(params) != -1) CreatePlayerVehicle(playerid, GetVehicleModelIdByName(params));
  354.     else return SendClientMessage(playerid, -1, #BAD_VEHICLE_NAME);
  355.     return 1;
  356. }
  357.  
  358. RESPAWN_COMMAND
  359. {
  360. #if defined ONLY_FOR_ADMIN
  361.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, #COMMAND_IS_ONLY_FOR_ADMIN);
  362. #endif
  363.     SendClientMessage(playerid, -1, #CARS_CREATED_BY_V);
  364.     RespawnUnusedVehicles();
  365.     return 1;
  366. }
  367.  
  368. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  369. {
  370.     switch(dialogid)
  371.     {
  372.         case DIALOG_VEHICLES_PLANES:
  373.         {
  374.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  375.             switch(listitem)
  376.             {
  377.                 case 0: CreatePlayerVehicle(playerid, 460);
  378.                 case 1: CreatePlayerVehicle(playerid, 476);
  379.                 case 2: CreatePlayerVehicle(playerid, 511);
  380.                 case 3: CreatePlayerVehicle(playerid, 512);
  381.                 case 4: CreatePlayerVehicle(playerid, 513);
  382.                 case 5: CreatePlayerVehicle(playerid, 519);
  383.                 case 6: CreatePlayerVehicle(playerid, 520);
  384.                 case 7: CreatePlayerVehicle(playerid, 553);
  385.                 case 8: CreatePlayerVehicle(playerid, 577);
  386.                 case 9: CreatePlayerVehicle(playerid, 592);
  387.                 case 10: CreatePlayerVehicle(playerid, 593);
  388.             }
  389.         }
  390.         case DIALOG_VEHICLES_HELICOPTERS:
  391.         {
  392.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  393.             switch(listitem)
  394.             {
  395.                 case 0: CreatePlayerVehicle(playerid, 417);
  396.                 case 1: CreatePlayerVehicle(playerid, 425);
  397.                 case 2: CreatePlayerVehicle(playerid, 469);
  398.                 case 3: CreatePlayerVehicle(playerid, 447);
  399.                 case 4: CreatePlayerVehicle(playerid, 487);
  400.                 case 5: CreatePlayerVehicle(playerid, 488);
  401.                 case 6: CreatePlayerVehicle(playerid, 497);
  402.                 case 7: CreatePlayerVehicle(playerid, 548);
  403.                 case 8: CreatePlayerVehicle(playerid, 563);
  404.             }
  405.         }
  406.         case DIALOG_VEHICLES_MOTORCYCLES:
  407.         {
  408.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  409.             switch(listitem)
  410.             {
  411.                 case 0: CreatePlayerVehicle(playerid, 448);
  412.                 case 1: CreatePlayerVehicle(playerid, 461);
  413.                 case 2: CreatePlayerVehicle(playerid, 462);
  414.                 case 3: CreatePlayerVehicle(playerid, 463);
  415.                 case 4: CreatePlayerVehicle(playerid, 468);
  416.                 case 5: CreatePlayerVehicle(playerid, 471);
  417.                 case 6: CreatePlayerVehicle(playerid, 521);
  418.                 case 7: CreatePlayerVehicle(playerid, 522);
  419.                 case 8: CreatePlayerVehicle(playerid, 523);
  420.                 case 9: CreatePlayerVehicle(playerid, 581);
  421.                 case 10: CreatePlayerVehicle(playerid, 586);
  422.             }
  423.         }
  424.         case DIALOG_VEHICLES_BIKES:
  425.         {
  426.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  427.             switch(listitem)
  428.             {
  429.                 case 0: CreatePlayerVehicle(playerid, 481);
  430.                 case 1: CreatePlayerVehicle(playerid, 509);
  431.                 case 2: CreatePlayerVehicle(playerid, 510);
  432.             }
  433.         }
  434.         case DIALOG_VEHICLES_CABRIOS:
  435.         {
  436.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  437.             switch(listitem)
  438.             {
  439.                 case 0: CreatePlayerVehicle(playerid, 439);
  440.                 case 1: CreatePlayerVehicle(playerid, 480);
  441.                 case 2: CreatePlayerVehicle(playerid, 533);
  442.                 case 3: CreatePlayerVehicle(playerid, 555);
  443.             }
  444.         }
  445.         case DIALOG_VEHICLES_INDUSTRIALS:
  446.         {
  447.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  448.             switch(listitem)
  449.             {
  450.                 case 0: CreatePlayerVehicle(playerid, 499);
  451.                 case 1: CreatePlayerVehicle(playerid, 422);
  452.                 case 2: CreatePlayerVehicle(playerid, 482);
  453.                 case 3: CreatePlayerVehicle(playerid, 498);
  454.                 case 4: CreatePlayerVehicle(playerid, 609);
  455.                 case 5: CreatePlayerVehicle(playerid, 524);
  456.                 case 6: CreatePlayerVehicle(playerid, 578);
  457.                 case 7: CreatePlayerVehicle(playerid, 455);
  458.                 case 8: CreatePlayerVehicle(playerid, 403);
  459.                 case 9: CreatePlayerVehicle(playerid, 414);
  460.                 case 10: CreatePlayerVehicle(playerid, 582);
  461.                 case 11: CreatePlayerVehicle(playerid, 443);
  462.                 case 12: CreatePlayerVehicle(playerid, 514);
  463.                 case 13: CreatePlayerVehicle(playerid, 600);
  464.                 case 14: CreatePlayerVehicle(playerid, 413);
  465.                 case 15: CreatePlayerVehicle(playerid, 515);
  466.                 case 16: CreatePlayerVehicle(playerid, 440);
  467.                 case 17: CreatePlayerVehicle(playerid, 543);
  468.                 case 18: CreatePlayerVehicle(playerid, 605);
  469.                 case 19: CreatePlayerVehicle(playerid, 459);
  470.                 case 20: CreatePlayerVehicle(playerid, 531);
  471.                 case 21: CreatePlayerVehicle(playerid, 408);
  472.                 case 22: CreatePlayerVehicle(playerid, 552);
  473.                 case 23: CreatePlayerVehicle(playerid, 478);
  474.                 case 24: CreatePlayerVehicle(playerid, 456);
  475.                 case 25: CreatePlayerVehicle(playerid, 554);
  476.             }
  477.         }
  478.         case DIALOG_VEHICLES_LOWRIDERS:
  479.         {
  480.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  481.             switch(listitem)
  482.             {
  483.                 case 0: CreatePlayerVehicle(playerid, 412);
  484.                 case 1: CreatePlayerVehicle(playerid, 534);
  485.                 case 2: CreatePlayerVehicle(playerid, 535);
  486.                 case 3: CreatePlayerVehicle(playerid, 536);
  487.                 case 4: CreatePlayerVehicle(playerid, 566);
  488.                 case 5: CreatePlayerVehicle(playerid, 567);
  489.                 case 6: CreatePlayerVehicle(playerid, 575);
  490.                 case 7: CreatePlayerVehicle(playerid, 576);
  491.             }
  492.         }
  493.         case DIALOG_VEHICLES_OFF_ROAD:
  494.         {
  495.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  496.             switch(listitem)
  497.             {
  498.                 case 0: CreatePlayerVehicle(playerid, 400);
  499.                 case 1: CreatePlayerVehicle(playerid, 424);
  500.                 case 2: CreatePlayerVehicle(playerid, 444);
  501.                 case 3: CreatePlayerVehicle(playerid, 470);
  502.                 case 4: CreatePlayerVehicle(playerid, 489);
  503.                 case 5: CreatePlayerVehicle(playerid, 495);
  504.                 case 6: CreatePlayerVehicle(playerid, 500);
  505.                 case 7: CreatePlayerVehicle(playerid, 505);
  506.                 case 8: CreatePlayerVehicle(playerid, 556);
  507.                 case 9: CreatePlayerVehicle(playerid, 557);
  508.                 case 10: CreatePlayerVehicle(playerid, 568);
  509.                 case 11: CreatePlayerVehicle(playerid, 573);
  510.                 case 12: CreatePlayerVehicle(playerid, 579);
  511.             }
  512.         }
  513.         case DIALOG_VEHICLES_PUBLIC:
  514.         {
  515.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  516.             switch(listitem)
  517.             {
  518.                 case 0: CreatePlayerVehicle(playerid, 407);
  519.                 case 1: CreatePlayerVehicle(playerid, 416);
  520.                 case 2: CreatePlayerVehicle(playerid, 420);
  521.                 case 3: CreatePlayerVehicle(playerid, 427);
  522.                 case 4: CreatePlayerVehicle(playerid, 431);
  523.                 case 5: CreatePlayerVehicle(playerid, 432);
  524.                 case 6: CreatePlayerVehicle(playerid, 433);
  525.                 case 7: CreatePlayerVehicle(playerid, 437);
  526.                 case 8: CreatePlayerVehicle(playerid, 438);
  527.                 case 9: CreatePlayerVehicle(playerid, 490);
  528.                 case 10: CreatePlayerVehicle(playerid, 528);
  529.                 case 11: CreatePlayerVehicle(playerid, 544);
  530.                 case 12: CreatePlayerVehicle(playerid, 596);
  531.                 case 13: CreatePlayerVehicle(playerid, 597);
  532.                 case 14: CreatePlayerVehicle(playerid, 598);
  533.                 case 15: CreatePlayerVehicle(playerid, 599);
  534.                 case 16: CreatePlayerVehicle(playerid, 601);
  535.             }
  536.         }
  537.         case DIALOG_VEHICLES_SALOON:
  538.         {
  539.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  540.             switch(listitem)
  541.             {
  542.                 case 0: CreatePlayerVehicle(playerid, 445);
  543.                 case 1: CreatePlayerVehicle(playerid, 504);
  544.                 case 2: CreatePlayerVehicle(playerid, 401);
  545.                 case 3: CreatePlayerVehicle(playerid, 518);
  546.                 case 4: CreatePlayerVehicle(playerid, 527);
  547.                 case 5: CreatePlayerVehicle(playerid, 542);
  548.                 case 6: CreatePlayerVehicle(playerid, 507);
  549.                 case 7: CreatePlayerVehicle(playerid, 562);
  550.                 case 8: CreatePlayerVehicle(playerid, 585);
  551.                 case 9: CreatePlayerVehicle(playerid, 419);
  552.                 case 10: CreatePlayerVehicle(playerid, 526);
  553.                 case 11: CreatePlayerVehicle(playerid, 604);
  554.                 case 12: CreatePlayerVehicle(playerid, 466);
  555.                 case 13: CreatePlayerVehicle(playerid, 492);
  556.                 case 14: CreatePlayerVehicle(playerid, 474);
  557.                 case 15: CreatePlayerVehicle(playerid, 546);
  558.                 case 16: CreatePlayerVehicle(playerid, 517);
  559.                 case 17: CreatePlayerVehicle(playerid, 410);
  560.                 case 18: CreatePlayerVehicle(playerid, 551);
  561.                 case 19: CreatePlayerVehicle(playerid, 516);
  562.                 case 20: CreatePlayerVehicle(playerid, 467);
  563.                 case 21: CreatePlayerVehicle(playerid, 426);
  564.                 case 22: CreatePlayerVehicle(playerid, 436);
  565.                 case 23: CreatePlayerVehicle(playerid, 547);
  566.                 case 24: CreatePlayerVehicle(playerid, 405);
  567.                 case 25: CreatePlayerVehicle(playerid, 580);
  568.                 case 26: CreatePlayerVehicle(playerid, 560);
  569.                 case 27: CreatePlayerVehicle(playerid, 550);
  570.                 case 28: CreatePlayerVehicle(playerid, 549);
  571.                 case 29: CreatePlayerVehicle(playerid, 540);
  572.                 case 30: CreatePlayerVehicle(playerid, 491);
  573.                 case 31: CreatePlayerVehicle(playerid, 529);
  574.                 case 32: CreatePlayerVehicle(playerid, 421);
  575.             }
  576.         }
  577.         case DIALOG_VEHICLES_SPORT:
  578.         {
  579.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  580.             switch(listitem)
  581.             {
  582.                 case 0: CreatePlayerVehicle(playerid, 402);
  583.                 case 1: CreatePlayerVehicle(playerid, 411);
  584.                 case 2: CreatePlayerVehicle(playerid, 415);
  585.                 case 3: CreatePlayerVehicle(playerid, 429);
  586.                 case 4: CreatePlayerVehicle(playerid, 451);
  587.                 case 5: CreatePlayerVehicle(playerid, 475);
  588.                 case 6: CreatePlayerVehicle(playerid, 477);
  589.                 case 7: CreatePlayerVehicle(playerid, 494);
  590.                 case 8: CreatePlayerVehicle(playerid, 496);
  591.                 case 9: CreatePlayerVehicle(playerid, 502);
  592.                 case 10: CreatePlayerVehicle(playerid, 503);
  593.                 case 11: CreatePlayerVehicle(playerid, 506);
  594.                 case 12: CreatePlayerVehicle(playerid, 541);
  595.                 case 13: CreatePlayerVehicle(playerid, 558);
  596.                 case 14: CreatePlayerVehicle(playerid, 559);
  597.                 case 15: CreatePlayerVehicle(playerid, 565);
  598.                 case 16: CreatePlayerVehicle(playerid, 587);
  599.                 case 17: CreatePlayerVehicle(playerid, 589);
  600.                 case 18: CreatePlayerVehicle(playerid, 602);
  601.                 case 19: CreatePlayerVehicle(playerid, 603);
  602.             }
  603.         }
  604.         case DIALOG_VEHICLES_WAGONS:
  605.         {
  606.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  607.             switch(listitem)
  608.             {
  609.                 case 0: CreatePlayerVehicle(playerid, 404);
  610.                 case 1: CreatePlayerVehicle(playerid, 418);
  611.                 case 2: CreatePlayerVehicle(playerid, 458);
  612.                 case 3: CreatePlayerVehicle(playerid, 479);
  613.                 case 4: CreatePlayerVehicle(playerid, 561);
  614.             }
  615.         }
  616.         case DIALOG_VEHICLES_BOATS:
  617.         {
  618.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  619.             switch(listitem)
  620.             {
  621.                 case 0: CreatePlayerVehicle(playerid, 430);
  622.                 case 1: CreatePlayerVehicle(playerid, 446);
  623.                 case 2: CreatePlayerVehicle(playerid, 452);
  624.                 case 3: CreatePlayerVehicle(playerid, 453);
  625.                 case 4: CreatePlayerVehicle(playerid, 454);
  626.                 case 5: CreatePlayerVehicle(playerid, 472);
  627.                 case 6: CreatePlayerVehicle(playerid, 473);
  628.                 case 7: CreatePlayerVehicle(playerid, 484);
  629.                 case 8: CreatePlayerVehicle(playerid, 493);
  630.                 case 9: CreatePlayerVehicle(playerid, 595);
  631.             }
  632.         }
  633.         case DIALOG_VEHICLES_UNIQUE:
  634.         {
  635.             if(!response) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  636.             switch(listitem)
  637.             {
  638.                 case 0: CreatePlayerVehicle(playerid, 485);
  639.                 case 1: CreatePlayerVehicle(playerid, 457);
  640.                 case 2: CreatePlayerVehicle(playerid, 483);
  641.                 case 3: CreatePlayerVehicle(playerid, 508);
  642.                 case 4: CreatePlayerVehicle(playerid, 532);
  643.                 case 5: CreatePlayerVehicle(playerid, 486);
  644.                 case 6: CreatePlayerVehicle(playerid, 406);
  645.                 case 7: CreatePlayerVehicle(playerid, 530);
  646.                 case 8: CreatePlayerVehicle(playerid, 434);
  647.                 case 9: CreatePlayerVehicle(playerid, 545);
  648.                 case 10: CreatePlayerVehicle(playerid, 588);
  649.                 case 11: CreatePlayerVehicle(playerid, 571);
  650.                 case 12: CreatePlayerVehicle(playerid, 572);
  651.                 case 13: CreatePlayerVehicle(playerid, 423);
  652.                 case 14: CreatePlayerVehicle(playerid, 442);
  653.                 case 15: CreatePlayerVehicle(playerid, 428);
  654.                 case 16: CreatePlayerVehicle(playerid, 409);
  655.                 case 17: CreatePlayerVehicle(playerid, 574);
  656.                 case 18: CreatePlayerVehicle(playerid, 525);
  657.                 case 19: CreatePlayerVehicle(playerid, 583);
  658.                 case 20: CreatePlayerVehicle(playerid, 539);
  659.             }
  660.         }
  661.         case DIALOG_VEHICLES_CATEGORY:
  662.         {
  663.             if(!response) return 0;
  664.             switch(listitem)
  665.             {
  666.                 case 0: ShowPlayerDialog(playerid, DIALOG_VEHICLES_PLANES, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "Skimmer\nRustler\nBeagle\nCropduster\nStuntplane\nShamal\nHydra\nNevada\nAT400\nAndromada\nDodo", #SELECT, #BACK);
  667.                 case 1: ShowPlayerDialog(playerid, DIALOG_VEHICLES_HELICOPTERS, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "Leviathan\nHunter\nSparrow\nSeasparrow\nMaverick\nSAN News Maverick\nPolice Maverick\nCargobob\nRaindance", #SELECT, #BACK);
  668.                 case 2: ShowPlayerDialog(playerid, DIALOG_VEHICLES_MOTORCYCLES, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "Pizzaboy\nPCJ-600\nFaggio\nFreeway\nSanchez\nQuad\nFCR-900\nNRG-500\nHPV1000\nBF-400\nWayfarer", #SELECT, #BACK);
  669.                 case 3: ShowPlayerDialog(playerid, DIALOG_VEHICLES_BIKES, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "BMX\nBike\nMountain Bike", #SELECT, #BACK);
  670.                 case 4: ShowPlayerDialog(playerid, DIALOG_VEHICLES_CABRIOS, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "Stallion\nComet\nFeltzer", #SELECT, #BACK);
  671.                 case 5: ShowPlayerDialog(playerid, DIALOG_VEHICLES_INDUSTRIALS, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "Benson\nBobcat\nBurrito\nBoxville\nBoxburg\nCement Truck\nDFT-30\nFlatbed\nLinerunner\nMule\nNewsvan\nPacker\nTanker\nPicador\nPony\nRoadtrain\nRumpo\nSadler\nSadler Shit\nTopfun\nTractor\nTrashmaster\nUtility Van\nWalton\nYankee\nYosemite", #SELECT, #BACK);
  672.                 case 6: ShowPlayerDialog(playerid, DIALOG_VEHICLES_LOWRIDERS, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "Voodoo\nRemington\nSlamvan\nBlade\nTahoma\nSawanna\nBroadway", #SELECT, #BACK);
  673.                 case 7: ShowPlayerDialog(playerid, DIALOG_VEHICLES_OFF_ROAD, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "Landstalker\nBF Injection\nMonster A\nPatriot\nRancher A\nSandking\nMesa\nRancher B\nMonster B\nMonster C\nBandito\nDune\nHuntley", #SELECT, #BACK);
  674.                 case 8: ShowPlayerDialog(playerid, DIALOG_VEHICLES_PUBLIC, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "Firetruck\nAmbulance\nTaxi\nEnforcer\nBus\nRhino\nBarracks\nCoach\nCabbie\nFBI Rancher\nFBI Truck\nFiretruck LA\nPolice Car (LSPD)\nPolice Car (SFPD)\nPolice Car (LVPD)\nPolice Ranger\nS.W.A.T", #SELECT, #BACK);
  675.                 case 9: ShowPlayerDialog(playerid, DIALOG_VEHICLES_SALOON, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "Admiral\nBloodring Banger\nBravura\nBuccaneer\nCadrona\nClover\nElegant\nElegy\nEmperor\nEsperanto\nFortune\nGlendale Shit\nGlendale\nGreendwood\nHermes\nIntruder\nMajestic\nManana\nMerit\nNebula\nOceanic\nPremier\nPrevion\nPrimo\nSentinel\nStafford\nSultan\nSunrise\nTampa\nVincent\nVirgo\nWillard\nWashington", #SELECT, #BACK);
  676.                 case 10: ShowPlayerDialog(playerid, DIALOG_VEHICLES_SPORT, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "Buffalo\nInfernus\nCheetah\nBanshee\nTurismo\nSabre\nZR-350\nHotring Racer A\nBlista Compact\nHotring Racer B\nHotring Racer C\nSuper GT\nBullet\nUranus\nJester\nFlash\nEuros\nClub\nAlpha\nPhoenix", #SELECT, #BACK);
  677.                 case 11: ShowPlayerDialog(playerid, DIALOG_VEHICLES_WAGONS, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "Perenniel\nMoonbeam\nSolair\nRegina\nStratum", #SELECT, #BACK);
  678.                 case 12: ShowPlayerDialog(playerid, DIALOG_VEHICLES_BOATS, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "Predator\nSquallo\nSpeeder\nReefer\nTropic\nCoastguard\nDinghy\nMarquis\nJetmax\nLaunch", #SELECT, #BACK);
  679.                 case 13: ShowPlayerDialog(playerid, DIALOG_VEHICLES_UNIQUE, DIALOG_STYLE_LIST, #SELECT_VEHICLE, "Baggage\nCaddy\nCamper A\nCamper B\nCombine Harvester\nDozer\nDumper\nForklift\nHotknife\nHustler\nHotdog\nKart\nMower\nMr.Whoopee\nRomero\nSecuricar\nStretch\nSweeper\nTowtruck\nTug\nVortex", #SELECT, #BACK);
  680.             }
  681.         }
  682.         case DIALOG_VEHICLES_SELECTOR:
  683.         {
  684.             if(!response) return 0;
  685.             switch(listitem)
  686.             {
  687.                 case 0: ShowModelSelectionMenu(playerid, vehiclelist, #SELECT_VEHICLE);
  688.                 case 1: ShowPlayerDialog(playerid, DIALOG_VEHICLES_CATEGORY, DIALOG_STYLE_LIST, #VEHICLE_TYPE_SELECT, #CAR_LIST, #SELECT, #CLOSE);
  689.                 case 2: ShowPlayerDialog(playerid, DIALOG_VEHICLES_INPUT, DIALOG_STYLE_INPUT, #ENTERING_NAME, #ENTER_NAME_IN_FIELD_BELOW, #OKAY, #CLOSE);
  690.             }
  691.         }
  692.         case DIALOG_VEHICLES_INPUT:
  693.         {
  694.             str_del_free_space(inputtext);
  695.             if(isnull(inputtext)) return ShowPlayerDialog(playerid, DIALOG_VEHICLES_SELECTOR, DIALOG_STYLE_LIST, #VEHICLE_SELECT_METHOD, #SELECT_BY_CLICK #SELECT_BY_DIALOG #SELECT_BY_INPUT, #SELECT, #EMPTY);
  696.             else if(GetVehicleModelIdByName(inputtext) != -1) CreatePlayerVehicle(playerid, GetVehicleModelIdByName(inputtext));
  697.             else return SendClientMessage(playerid, -1, #BAD_VEHICLE_NAME);
  698.         }
  699.     }
  700.     return 1;
  701. }
  702.  
  703. public OnFilterScriptExit()
  704. {
  705.     mysql_close(hMYSQL);
  706.     return 1;
  707. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement