Advertisement
Guest User

MDC System

a guest
Feb 6th, 2014
1,460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 23.87 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define DIALOG_MDC_PlayerI           9991
  4. #define DIALOG_MDC_PlayerR           9992
  5. #define DIALOG_MDC_VehicleI          9910
  6. #define DIALOG_MDC_VehicleR          9915
  7. #define DIALOG_MDC_UNIFORMS          9995
  8.  
  9. new PlayerText:MDC[16][MAX_PLAYERS];
  10. new MDCShowing[MAX_PLAYERS];
  11. new String[1000];
  12. new VehicleNames[][] =
  13. {
  14.     "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
  15.     "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
  16.     "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
  17.     "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
  18.     "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
  19.     "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
  20.     "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
  21.     "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
  22.     "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van",
  23.     "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
  24.     "Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
  25.     "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
  26.     "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",
  27.     "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
  28.     "Blista Compact", "Police Maverick", "Boxville", "Benson", "Mesa", "RC Goblin",
  29.     "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
  30.     "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",
  31.     "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
  32.     "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
  33.     "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
  34.     "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
  35.     "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
  36.     "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
  37.     "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
  38.     "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
  39.     "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
  40.     "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
  41.     "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
  42.     "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
  43.     "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
  44.     "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
  45.     "Tiller", "Utility Trailer"
  46. };
  47.  
  48. public OnFilterScriptInit()
  49. {
  50.     print("\n----------------------------------------");
  51.     print(" MDC System by Rehasher Successfully loaded");
  52.     print("-----------------------------------------\n");
  53.     for(new i = 0; i < MAX_PLAYERS; i++)
  54.     {
  55.         CreatePlayerTextdraws(i);
  56.     }
  57.     return 1;
  58. }
  59.  
  60. public OnFilterScriptExit()
  61. {
  62.     return 1;
  63. }
  64.  
  65. public OnPlayerRequestClass(playerid, classid)
  66. {
  67.     return 1;
  68. }
  69.  
  70. public OnPlayerConnect(playerid)
  71. {
  72.     MDCShowing[playerid] = 0;
  73.     // Creating the textdraws
  74.     CreatePlayerTextdraws(playerid);
  75.     return 1;
  76. }
  77.  
  78. stock CreatePlayerTextdraws(playerid)
  79. {
  80.     MDC[0][playerid] = CreatePlayerTextDraw(playerid, 135.000000, 121.000000, "                                                    ");
  81.     PlayerTextDrawBackgroundColor(playerid, MDC[0][playerid], 255);
  82.     PlayerTextDrawFont(playerid, MDC[0][playerid], 1);
  83.     PlayerTextDrawLetterSize(playerid, MDC[0][playerid], 0.500000, 29.000000);
  84.     PlayerTextDrawColor(playerid, MDC[0][playerid], -1);
  85.     PlayerTextDrawSetOutline(playerid, MDC[0][playerid], 0);
  86.     PlayerTextDrawSetProportional(playerid, MDC[0][playerid], 1);
  87.     PlayerTextDrawSetShadow(playerid, MDC[0][playerid], 1);
  88.     PlayerTextDrawUseBox(playerid, MDC[0][playerid], 1);
  89.     PlayerTextDrawBoxColor(playerid, MDC[0][playerid], 148);
  90.     PlayerTextDrawTextSize(playerid, MDC[0][playerid], 491.000000, 1.000000);
  91.     PlayerTextDrawSetSelectable(playerid, MDC[0][playerid], 0);
  92.  
  93.     MDC[1][playerid] = CreatePlayerTextDraw(playerid, 223.000000, 122.000000, "LOS SANTOS POLICE DEPARTMENT");
  94.     PlayerTextDrawBackgroundColor(playerid, MDC[1][playerid], 255);
  95.     PlayerTextDrawFont(playerid, MDC[1][playerid], 2);
  96.     PlayerTextDrawLetterSize(playerid, MDC[1][playerid], 0.280000, 1.699999);
  97.     PlayerTextDrawColor(playerid, MDC[1][playerid], -1);
  98.     PlayerTextDrawSetOutline(playerid, MDC[1][playerid], 0);
  99.     PlayerTextDrawSetProportional(playerid, MDC[1][playerid], 1);
  100.     PlayerTextDrawSetShadow(playerid, MDC[1][playerid], 1);
  101.     PlayerTextDrawSetSelectable(playerid, MDC[1][playerid], 0);
  102.  
  103.     MDC[2][playerid] = CreatePlayerTextDraw(playerid, 135.000000, 142.000000, " ");
  104.     PlayerTextDrawBackgroundColor(playerid, MDC[2][playerid], 255);
  105.     PlayerTextDrawFont(playerid, MDC[2][playerid], 1);
  106.     PlayerTextDrawLetterSize(playerid, MDC[2][playerid], 0.509999, 1.000000);
  107.     PlayerTextDrawColor(playerid, MDC[2][playerid], 8454143);
  108.     PlayerTextDrawSetOutline(playerid, MDC[2][playerid], 0);
  109.     PlayerTextDrawSetProportional(playerid, MDC[2][playerid], 1);
  110.     PlayerTextDrawSetShadow(playerid, MDC[2][playerid], 1);
  111.     PlayerTextDrawUseBox(playerid, MDC[2][playerid], 1);
  112.     PlayerTextDrawBoxColor(playerid, MDC[2][playerid], 8454143);
  113.     PlayerTextDrawTextSize(playerid, MDC[2][playerid], 491.000000, 1.000000);
  114.     PlayerTextDrawSetSelectable(playerid, MDC[2][playerid], 0);
  115.  
  116.     MDC[3][playerid] = CreatePlayerTextDraw(playerid, 255.000000, 169.000000, "                                              ");
  117.     PlayerTextDrawBackgroundColor(playerid, MDC[3][playerid], 255);
  118.     PlayerTextDrawFont(playerid, MDC[3][playerid], 1);
  119.     PlayerTextDrawLetterSize(playerid, MDC[3][playerid], 0.890000, 3.599994);
  120.     PlayerTextDrawColor(playerid, MDC[3][playerid], -1);
  121.     PlayerTextDrawSetOutline(playerid, MDC[3][playerid], 0);
  122.     PlayerTextDrawSetProportional(playerid, MDC[3][playerid], 1);
  123.     PlayerTextDrawSetShadow(playerid, MDC[3][playerid], 1);
  124.     PlayerTextDrawUseBox(playerid, MDC[3][playerid], 1);
  125.     PlayerTextDrawBoxColor(playerid, MDC[3][playerid], -206);
  126.     PlayerTextDrawTextSize(playerid, MDC[3][playerid], 374.000000, 1.000000);
  127.     PlayerTextDrawSetSelectable(playerid, MDC[3][playerid], 0);
  128.  
  129.     MDC[4][playerid] = CreatePlayerTextDraw(playerid, 135.000000, 365.000000, " ");
  130.     PlayerTextDrawBackgroundColor(playerid, MDC[4][playerid], 255);
  131.     PlayerTextDrawFont(playerid, MDC[4][playerid], 1);
  132.     PlayerTextDrawLetterSize(playerid, MDC[4][playerid], 0.509999, 1.000000);
  133.     PlayerTextDrawColor(playerid, MDC[4][playerid], 8454143);
  134.     PlayerTextDrawSetOutline(playerid, MDC[4][playerid], 0);
  135.     PlayerTextDrawSetProportional(playerid, MDC[4][playerid], 1);
  136.     PlayerTextDrawSetShadow(playerid, MDC[4][playerid], 1);
  137.     PlayerTextDrawUseBox(playerid, MDC[4][playerid], 1);
  138.     PlayerTextDrawBoxColor(playerid, MDC[4][playerid], 8454143);
  139.     PlayerTextDrawTextSize(playerid, MDC[4][playerid], 491.000000, 1.000000);
  140.     PlayerTextDrawSetSelectable(playerid, MDC[4][playerid], 0);
  141.  
  142.     MDC[5][playerid] = CreatePlayerTextDraw(playerid, 261.000000, 171.000000, "ld_otb2:butnc");
  143.     PlayerTextDrawBackgroundColor(playerid, MDC[5][playerid], 0);
  144.     PlayerTextDrawFont(playerid, MDC[5][playerid], 4);
  145.     PlayerTextDrawLetterSize(playerid, MDC[5][playerid], 0.810000, 1.000000);
  146.     PlayerTextDrawColor(playerid, MDC[5][playerid], -1);
  147.     PlayerTextDrawSetOutline(playerid, MDC[5][playerid], 0);
  148.     PlayerTextDrawSetProportional(playerid, MDC[5][playerid], 1);
  149.     PlayerTextDrawSetShadow(playerid, MDC[5][playerid], 1);
  150.     PlayerTextDrawUseBox(playerid, MDC[5][playerid], 1);
  151.     PlayerTextDrawBoxColor(playerid, MDC[5][playerid], 255);
  152.     PlayerTextDrawTextSize(playerid, MDC[5][playerid], 107.000000, 28.000000);
  153.     PlayerTextDrawSetSelectable(playerid, MDC[5][playerid], 1);
  154.  
  155.     MDC[6][playerid] = CreatePlayerTextDraw(playerid, 261.000000, 203.000000, "ld_otb2:butnc");
  156.     PlayerTextDrawBackgroundColor(playerid, MDC[6][playerid], 0);
  157.     PlayerTextDrawFont(playerid, MDC[6][playerid], 4);
  158.     PlayerTextDrawLetterSize(playerid, MDC[6][playerid], 0.810000, 1.000000);
  159.     PlayerTextDrawColor(playerid, MDC[6][playerid], -1);
  160.     PlayerTextDrawSetOutline(playerid, MDC[6][playerid], 0);
  161.     PlayerTextDrawSetProportional(playerid, MDC[6][playerid], 1);
  162.     PlayerTextDrawSetShadow(playerid, MDC[6][playerid], 1);
  163.     PlayerTextDrawUseBox(playerid, MDC[6][playerid], 1);
  164.     PlayerTextDrawBoxColor(playerid, MDC[6][playerid], 255);
  165.     PlayerTextDrawTextSize(playerid, MDC[6][playerid], 107.000000, 28.000000);
  166.     PlayerTextDrawSetSelectable(playerid, MDC[6][playerid], 1);
  167.  
  168.     MDC[7][playerid] = CreatePlayerTextDraw(playerid, 261.000000, 236.000000, "ld_otb2:butnc");
  169.     PlayerTextDrawBackgroundColor(playerid, MDC[7][playerid], 0);
  170.     PlayerTextDrawFont(playerid, MDC[7][playerid], 4);
  171.     PlayerTextDrawLetterSize(playerid, MDC[7][playerid], 0.810000, 1.000000);
  172.     PlayerTextDrawColor(playerid, MDC[7][playerid], -1);
  173.     PlayerTextDrawSetOutline(playerid, MDC[7][playerid], 0);
  174.     PlayerTextDrawSetProportional(playerid, MDC[7][playerid], 1);
  175.     PlayerTextDrawSetShadow(playerid, MDC[7][playerid], 1);
  176.     PlayerTextDrawUseBox(playerid, MDC[7][playerid], 1);
  177.     PlayerTextDrawBoxColor(playerid, MDC[7][playerid], 255);
  178.     PlayerTextDrawTextSize(playerid, MDC[7][playerid], 107.000000, 28.000000);
  179.     PlayerTextDrawSetSelectable(playerid, MDC[7][playerid], 1);
  180.  
  181.     MDC[8][playerid] = CreatePlayerTextDraw(playerid, 261.000000, 271.000000, "ld_otb2:butnc");
  182.     PlayerTextDrawBackgroundColor(playerid, MDC[8][playerid], 0);
  183.     PlayerTextDrawFont(playerid, MDC[8][playerid], 4);
  184.     PlayerTextDrawLetterSize(playerid, MDC[8][playerid], 0.810000, 1.000000);
  185.     PlayerTextDrawColor(playerid, MDC[8][playerid], -1);
  186.     PlayerTextDrawSetOutline(playerid, MDC[8][playerid], 0);
  187.     PlayerTextDrawSetProportional(playerid, MDC[8][playerid], 1);
  188.     PlayerTextDrawSetShadow(playerid, MDC[8][playerid], 1);
  189.     PlayerTextDrawUseBox(playerid, MDC[8][playerid], 1);
  190.     PlayerTextDrawBoxColor(playerid, MDC[8][playerid], 255);
  191.     PlayerTextDrawTextSize(playerid, MDC[8][playerid], 107.000000, 28.000000);
  192.     PlayerTextDrawSetSelectable(playerid, MDC[8][playerid], 1);
  193.  
  194.     MDC[9][playerid] = CreatePlayerTextDraw(playerid, 287.000000, 174.000000, "PLAYER SEARCH");
  195.     PlayerTextDrawBackgroundColor(playerid, MDC[9][playerid], 255);
  196.     PlayerTextDrawFont(playerid, MDC[9][playerid], 1);
  197.     PlayerTextDrawLetterSize(playerid, MDC[9][playerid], 0.230000, 1.000000);
  198.     PlayerTextDrawColor(playerid, MDC[9][playerid], 8454143);
  199.     PlayerTextDrawSetOutline(playerid, MDC[9][playerid], 1);
  200.     PlayerTextDrawSetProportional(playerid, MDC[9][playerid], 1);
  201.     PlayerTextDrawSetSelectable(playerid, MDC[9][playerid], 0);
  202.  
  203.     MDC[10][playerid] = CreatePlayerTextDraw(playerid, 286.000000, 206.000000, "VEHICLE SEARCH");
  204.     PlayerTextDrawBackgroundColor(playerid, MDC[10][playerid], 255);
  205.     PlayerTextDrawFont(playerid, MDC[10][playerid], 1);
  206.     PlayerTextDrawLetterSize(playerid, MDC[10][playerid], 0.230000, 1.000000);
  207.     PlayerTextDrawColor(playerid, MDC[10][playerid], 8454143);
  208.     PlayerTextDrawSetOutline(playerid, MDC[10][playerid], 1);
  209.     PlayerTextDrawSetProportional(playerid, MDC[10][playerid], 1);
  210.     PlayerTextDrawSetSelectable(playerid, MDC[10][playerid], 0);
  211.  
  212.     MDC[11][playerid] = CreatePlayerTextDraw(playerid, 283.000000, 239.000000, "REQUEST BACKUP");
  213.     PlayerTextDrawBackgroundColor(playerid, MDC[11][playerid], 255);
  214.     PlayerTextDrawFont(playerid, MDC[11][playerid], 1);
  215.     PlayerTextDrawLetterSize(playerid, MDC[11][playerid], 0.230000, 1.000000);
  216.     PlayerTextDrawColor(playerid, MDC[11][playerid], 8454143);
  217.     PlayerTextDrawSetOutline(playerid, MDC[11][playerid], 1);
  218.     PlayerTextDrawSetProportional(playerid, MDC[11][playerid], 1);
  219.     PlayerTextDrawSetSelectable(playerid, MDC[11][playerid], 0);
  220.  
  221.     MDC[12][playerid] = CreatePlayerTextDraw(playerid, 294.000000, 274.000000, "UNIFORMS");
  222.     PlayerTextDrawBackgroundColor(playerid, MDC[12][playerid], 255);
  223.     PlayerTextDrawFont(playerid, MDC[12][playerid], 1);
  224.     PlayerTextDrawLetterSize(playerid, MDC[12][playerid], 0.230000, 1.000000);
  225.     PlayerTextDrawColor(playerid, MDC[12][playerid], 8454143);
  226.     PlayerTextDrawSetOutline(playerid, MDC[12][playerid], 1);
  227.     PlayerTextDrawSetProportional(playerid, MDC[12][playerid], 1);
  228.     PlayerTextDrawSetSelectable(playerid, MDC[12][playerid], 0);
  229.  
  230.     MDC[13][playerid] = CreatePlayerTextDraw(playerid, 261.000000, 306.000000, "ld_otb2:butnc");
  231.     PlayerTextDrawBackgroundColor(playerid, MDC[13][playerid], 0);
  232.     PlayerTextDrawFont(playerid, MDC[13][playerid], 4);
  233.     PlayerTextDrawLetterSize(playerid, MDC[13][playerid], 0.810000, 1.000000);
  234.     PlayerTextDrawColor(playerid, MDC[13][playerid], -1);
  235.     PlayerTextDrawSetOutline(playerid, MDC[13][playerid], 0);
  236.     PlayerTextDrawSetProportional(playerid, MDC[13][playerid], 1);
  237.     PlayerTextDrawSetShadow(playerid, MDC[13][playerid], 1);
  238.     PlayerTextDrawUseBox(playerid, MDC[13][playerid], 1);
  239.     PlayerTextDrawBoxColor(playerid, MDC[13][playerid], 255);
  240.     PlayerTextDrawTextSize(playerid, MDC[13][playerid], 107.000000, 28.000000);
  241.     PlayerTextDrawSetSelectable(playerid, MDC[13][playerid], 1);
  242.  
  243.     MDC[14][playerid] = CreatePlayerTextDraw(playerid, 294.000000, 309.000000, "CLOSE MDC");
  244.     PlayerTextDrawBackgroundColor(playerid, MDC[14][playerid], 255);
  245.     PlayerTextDrawFont(playerid, MDC[14][playerid], 1);
  246.     PlayerTextDrawLetterSize(playerid, MDC[14][playerid], 0.230000, 1.000000);
  247.     PlayerTextDrawColor(playerid, MDC[14][playerid], -16776961);
  248.     PlayerTextDrawSetOutline(playerid, MDC[14][playerid], 1);
  249.     PlayerTextDrawSetProportional(playerid, MDC[14][playerid], 1);
  250.     PlayerTextDrawSetSelectable(playerid, MDC[14][playerid], 0);
  251.  
  252.     MDC[15][playerid] = CreatePlayerTextDraw(playerid, 394.000000, 366.000000, "TECHBYTE DATA");
  253.     PlayerTextDrawBackgroundColor(playerid, MDC[15][playerid], 255);
  254.     PlayerTextDrawFont(playerid, MDC[15][playerid], 2);
  255.     PlayerTextDrawLetterSize(playerid, MDC[15][playerid], 0.280000, 1.699999);
  256.     PlayerTextDrawColor(playerid, MDC[15][playerid], -1);
  257.     PlayerTextDrawSetOutline(playerid, MDC[15][playerid], 0);
  258.     PlayerTextDrawSetProportional(playerid, MDC[15][playerid], 1);
  259.     PlayerTextDrawSetShadow(playerid, MDC[15][playerid], 1);
  260.     PlayerTextDrawSetSelectable(playerid, MDC[15][playerid], 0);
  261.     return 1;
  262. }
  263. stock ShowMDCMenu(playerid)
  264. {
  265.     PlayerTextDrawShow(playerid, MDC[0][playerid]);
  266.     PlayerTextDrawShow(playerid, MDC[1][playerid]);
  267.     PlayerTextDrawShow(playerid, MDC[2][playerid]);
  268.     PlayerTextDrawShow(playerid, MDC[3][playerid]);
  269.     PlayerTextDrawShow(playerid, MDC[4][playerid]);
  270.     PlayerTextDrawShow(playerid, MDC[5][playerid]);
  271.     PlayerTextDrawShow(playerid, MDC[6][playerid]);
  272.     PlayerTextDrawShow(playerid, MDC[7][playerid]);
  273.     PlayerTextDrawShow(playerid, MDC[8][playerid]);
  274.     PlayerTextDrawShow(playerid, MDC[9][playerid]);
  275.     PlayerTextDrawShow(playerid, MDC[10][playerid]);
  276.     PlayerTextDrawShow(playerid, MDC[11][playerid]);
  277.     PlayerTextDrawShow(playerid, MDC[12][playerid]);
  278.     PlayerTextDrawShow(playerid, MDC[13][playerid]);
  279.     PlayerTextDrawShow(playerid, MDC[14][playerid]);
  280.     PlayerTextDrawShow(playerid, MDC[15][playerid]);
  281.     SelectTextDraw(playerid, 0x0080FF);
  282.     MDCShowing[playerid] = 1;
  283.     return 1;
  284. }
  285. stock HideMDCMenu(playerid)
  286. {
  287.     PlayerTextDrawHide(playerid, MDC[0][playerid]);
  288.     PlayerTextDrawHide(playerid, MDC[1][playerid]);
  289.     PlayerTextDrawHide(playerid, MDC[2][playerid]);
  290.     PlayerTextDrawHide(playerid, MDC[3][playerid]);
  291.     PlayerTextDrawHide(playerid, MDC[4][playerid]);
  292.     PlayerTextDrawHide(playerid, MDC[5][playerid]);
  293.     PlayerTextDrawHide(playerid, MDC[6][playerid]);
  294.     PlayerTextDrawHide(playerid, MDC[7][playerid]);
  295.     PlayerTextDrawHide(playerid, MDC[8][playerid]);
  296.     PlayerTextDrawHide(playerid, MDC[9][playerid]);
  297.     PlayerTextDrawHide(playerid, MDC[10][playerid]);
  298.     PlayerTextDrawHide(playerid, MDC[11][playerid]);
  299.     PlayerTextDrawHide(playerid, MDC[12][playerid]);
  300.     PlayerTextDrawHide(playerid, MDC[13][playerid]);
  301.     PlayerTextDrawHide(playerid, MDC[14][playerid]);
  302.     PlayerTextDrawHide(playerid, MDC[15][playerid]);   
  303.     CancelSelectTextDraw(playerid);
  304.     MDCShowing[playerid] = 0;
  305.     return 1;
  306. }
  307. public OnPlayerDisconnect(playerid, reason)
  308. {
  309.     return 1;
  310. }
  311.  
  312. public OnPlayerSpawn(playerid)
  313. {
  314.     return 1;
  315. }
  316.  
  317. public OnPlayerDeath(playerid, killerid, reason)
  318. {
  319.     return 1;
  320. }
  321.  
  322. public OnVehicleSpawn(vehicleid)
  323. {
  324.     return 1;
  325. }
  326.  
  327. public OnVehicleDeath(vehicleid, killerid)
  328. {
  329.     return 1;
  330. }
  331.  
  332. public OnPlayerText(playerid, text[])
  333. {
  334.     return 1;
  335. }
  336.  
  337. public OnPlayerCommandText(playerid, cmdtext[])
  338. {
  339.     if(strcmp("/mdc", cmdtext, true, 10) == 0)
  340.     {
  341.         if(MDCShowing[playerid] == 0)
  342.         {
  343.             ShowMDCMenu(playerid);
  344.         }
  345.         else if(MDCShowing[playerid] == 1)
  346.         {
  347.             HideMDCMenu(playerid);
  348.         }
  349.         return 1;
  350.     }
  351.     return 0;
  352. }
  353.  
  354. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  355. {
  356.     if(playertextid == MDC[13][playerid]) // Close MDC
  357.     {
  358.         HideMDCMenu(playerid);
  359.     }
  360.     if(playertextid == MDC[8][playerid]) // Uniforms
  361.     {
  362.         HideMDCMenu(playerid);
  363.         ShowPlayerDialog(playerid, DIALOG_MDC_UNIFORMS, DIALOG_STYLE_LIST, "MDC || Uniform Selection", "Uniform 1\nUniform 2\nUniform 3\nUniform 4\nUniform 5\nUniform 6\nUniform 7", "Choose", "Close");
  364.     }
  365.     if(playertextid == MDC[7][playerid])
  366.     {
  367.         new Float:X, Float:Y, Float:Z;
  368.         GetPlayerPos(playerid, X, Y, Z);
  369.         for(new i = 0; i < MAX_PLAYERS; i++)
  370.         {
  371.             format(String, sizeof(String), "(POLICE RADIO) %s[%d] has requested backup at his position, GPS marked on your radar.", PlayerName(playerid), playerid);
  372.             SendClientMessage(i, 0x0080FFFF, String);
  373.             SetPlayerCheckpoint(i, X, Y, Z, 2.0);
  374.         }
  375.         HideMDCMenu(playerid);
  376.     }
  377.     if(playertextid == MDC[5][playerid])
  378.     {
  379.         ShowPlayerDialog(playerid, DIALOG_MDC_PlayerI, DIALOG_STYLE_INPUT, "MDC || Player Lookup", "=====================================================\nPOLICE MDC\n\nINPUT THE PLAYER NAME TO SEARCH\n\n=====================================================\n", "SEARCH", "");
  380.         HideMDCMenu(playerid);  
  381.     }
  382.     if(playertextid == MDC[6][playerid])
  383.     {
  384.         ShowPlayerDialog(playerid, DIALOG_MDC_VehicleI, DIALOG_STYLE_INPUT, "MDC || Vehicle Lookup", "=====================================================\nPOLICE MDC\n\nINPUT THE VEHICLEID TO SEARCH (/dl to get ID)\n\n=====================================================\n", "SEARCH", "");
  385.         HideMDCMenu(playerid);
  386.     }
  387.     return 1;
  388. }
  389. stock PlayerName(playerid)
  390. {
  391.     new name[MAX_PLAYER_NAME];
  392.     GetPlayerName(playerid,name,sizeof(name));
  393.     for(new i = 0; i < MAX_PLAYER_NAME; i++) {
  394.         if(name[i] == '_') name[i] = ' ';
  395.     }
  396.     return name;
  397. }
  398. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  399. {
  400.     return 1;
  401. }
  402.  
  403. public OnPlayerExitVehicle(playerid, vehicleid)
  404. {
  405.     return 1;
  406. }
  407.  
  408. public OnPlayerStateChange(playerid, newstate, oldstate)
  409. {
  410.     return 1;
  411. }
  412.  
  413. public OnPlayerEnterCheckpoint(playerid)
  414. {
  415.     DisablePlayerCheckpoint(playerid);
  416.     return 1;
  417. }
  418.  
  419. public OnPlayerLeaveCheckpoint(playerid)
  420. {
  421.     return 1;
  422. }
  423.  
  424. public OnPlayerEnterRaceCheckpoint(playerid)
  425. {
  426.     return 1;
  427. }
  428.  
  429. public OnPlayerLeaveRaceCheckpoint(playerid)
  430. {
  431.     return 1;
  432. }
  433.  
  434. public OnRconCommand(cmd[])
  435. {
  436.     return 1;
  437. }
  438.  
  439. public OnPlayerSelectedMenuRow(playerid, row)
  440. {
  441.     return 1;
  442. }
  443.  
  444. public OnPlayerExitedMenu(playerid)
  445. {
  446.     return 1;
  447. }
  448.  
  449. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  450. {
  451.     return 1;
  452. }
  453.  
  454. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  455. {
  456.     return 1;
  457. }
  458.  
  459. public OnRconLoginAttempt(ip[], password[], success)
  460. {
  461.     return 1;
  462. }
  463.  
  464. public OnPlayerUpdate(playerid)
  465. {
  466.     return 1;
  467. }
  468. new dialog_message[1500];
  469. new Message[1000];
  470. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  471. {
  472.     if(dialogid == DIALOG_MDC_PlayerI)
  473.     {
  474.         new pid = GetPlayerIdFromName(inputtext);
  475.         if(pid == INVALID_PLAYER_ID)
  476.         {
  477.             SendClientMessage(playerid, 0xFFFFFFFF, "Invalid player.");
  478.             return 1;
  479.         }
  480.  
  481.         format(dialog_message, sizeof(dialog_message), ""); // Reset the string
  482.         new Float:health;
  483.         GetPlayerHealth(pid,health);
  484.         // DIALOG RESULT MESSAGE
  485.         format(Message, sizeof(Message), "{FFFFFF}LSPD || MOBILE DATA COMPUTER\n");
  486.         strcat(dialog_message, Message);
  487.         format(Message, sizeof(Message), "{0080FF}===========================================================\n");
  488.         strcat(dialog_message, Message);
  489.         format(Message, sizeof(Message), "{0080FF}Full Name {FFFFFF}- %s [%d]\n", PlayerName(pid), pid);
  490.         strcat(dialog_message, Message);
  491.         format(Message, sizeof(Message), "{0080FF}Skin {FFFFFF}- %d\n", GetPlayerSkin(pid));
  492.         strcat(dialog_message, Message);
  493.         format(Message, sizeof(Message), "{0080FF}Health{FFFFFF}- %f\n", health);
  494.         strcat(dialog_message, Message);
  495.         format(Message, sizeof(Message), "{0080FF}Cash {FFFFFF}- %d\n", GetPlayerMoney(pid));
  496.         strcat(dialog_message, Message);
  497.         format(Message, sizeof(Message), "{0080FF}===========================================================\n");
  498.         strcat(dialog_message, Message);
  499.         ShowPlayerDialog(playerid, DIALOG_MDC_PlayerR, DIALOG_STYLE_MSGBOX, "MDC || Player Lookup", dialog_message, "Close", "");
  500.     }
  501.     if(dialogid == DIALOG_MDC_PlayerR)
  502.     {
  503.         if(!response)
  504.         {
  505.             ShowMDCMenu(playerid);
  506.         }
  507.         ShowMDCMenu(playerid);
  508.     }
  509.     if(dialogid == DIALOG_MDC_VehicleR)
  510.     {
  511.         if(!response)
  512.         {
  513.             ShowMDCMenu(playerid);
  514.         }
  515.         ShowMDCMenu(playerid);
  516.     }
  517.     if(dialogid == DIALOG_MDC_VehicleI)
  518.     {
  519.         format(dialog_message, sizeof(dialog_message), ""); // Reset the string
  520.         new panels,doors,lights,tires;
  521.         GetVehicleDamageStatus(strval(inputtext),panels,doors,lights,tires);
  522.         // DIALOG RESULT MESSAGE
  523.         format(Message, sizeof(Message), "{FFFFFF}LSPD || MOBILE DATA COMPUTER\n");
  524.         strcat(dialog_message, Message);
  525.         format(Message, sizeof(Message), "{0080FF}===========================================================\n");
  526.         strcat(dialog_message, Message);
  527.         format(Message, sizeof(Message), "{0080FF}Vehicle Type {FFFFFF}- %s\n", GetVehicleName(strval(inputtext)));
  528.         strcat(dialog_message, Message);
  529.         format(Message, sizeof(Message), "{0080FF}Vehicle Damage {FFFFFF}- [Panels] : %d - [Doors] : %d - [Lights] : %d - [Tires] : %d\n", panels, doors, lights, tires);
  530.         strcat(dialog_message, Message);
  531.         format(Message, sizeof(Message), "{0080FF}===========================================================\n");
  532.         strcat(dialog_message, Message);
  533.         ShowPlayerDialog(playerid, DIALOG_MDC_VehicleR, DIALOG_STYLE_MSGBOX, "MDC || Vehicle Lookup", dialog_message, "Close", "");
  534.     }
  535.     if(dialogid == DIALOG_MDC_UNIFORMS)
  536.     {
  537.         if(!response)
  538.         {
  539.             return 1;
  540.         }
  541.         else
  542.         {
  543.             //The player has pressed "Choose".
  544.             switch(listitem)
  545.             {
  546.                 case 0:
  547.                 {
  548.                     //Selected Item: "Uniform 1"
  549.                     SetPlayerSkin(playerid, 280);
  550.                 }
  551.                 case 1:
  552.                 {
  553.                     //Selected Item: "Uniform 2"
  554.                     SetPlayerSkin(playerid, 281);
  555.                 }
  556.                 case 2:
  557.                 {
  558.                     //Selected Item: "Uniform 3"
  559.                     SetPlayerSkin(playerid, 282);
  560.                 }
  561.                 case 3:
  562.                 {
  563.                     //Selected Item: "Uniform 4"
  564.                     SetPlayerSkin(playerid, 283);
  565.                 }
  566.                 case 4:
  567.                 {
  568.                     //Selected Item: "Uniform 5"
  569.                     SetPlayerSkin(playerid, 288);
  570.                 }
  571.                 case 5:
  572.                 {
  573.                     //Selected Item: "Uniform 6"
  574.                     SetPlayerSkin(playerid, 284);
  575.                 }
  576.                 case 6:
  577.                 {
  578.                     //Selected Item: "Uniform 7"
  579.                     SetPlayerSkin(playerid, 285);
  580.                 }
  581.             }
  582.         }
  583.     }
  584.     return 1;
  585. }
  586. stock GetVehicleName(vehicleid)
  587. {
  588.     format(String,sizeof(String),"%s",VehicleNames[GetVehicleModel(vehicleid) - 400]);
  589.     return String;
  590. }
  591. stock GetPlayerIdFromName(playername[])
  592. {
  593.   for(new i = 0; i <= MAX_PLAYERS; i++)
  594.   {
  595.     if(IsPlayerConnected(i))
  596.     {
  597.       new playername2[MAX_PLAYER_NAME];
  598.       GetPlayerName(i, playername2, sizeof(playername2));
  599.       if(strcmp(playername2, playername, true, strlen(playername)) == 0)
  600.       {
  601.         return i;
  602.       }
  603.     }
  604.   }
  605.   return INVALID_PLAYER_ID;
  606. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement