OKStyle

Map-Radar

Oct 17th, 2011
1,285
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2. // Map-radar of players by O.K.Style™
  3. new Text:Map[5], Text:Player[MAX_PLAYERS], Text:Stats[MAX_PLAYERS];
  4. new Text:Test;
  5. new PlayerRainbowColors[511] = {
  6. /*OKStyle*/ 0x000022FF, 0x000044FF, 0x000066FF, 0x000088FF, 0x0000AAFF, 0x0000CCFF, 0x0000EEFF,
  7. 0x002200FF, 0x002222FF, 0x002244FF, 0x002266FF, 0x002288FF, 0x0022AAFF, 0x0022CCFF, 0x0022EEFF,
  8. 0x004400FF, 0x004422FF, 0x004444FF, 0x004466FF, 0x004488FF, 0x0044AAFF, 0x0044CCFF, 0x0044EEFF,
  9. 0x006600FF, 0x006622FF, 0x006644FF, 0x006666FF, 0x006688FF, 0x0066AAFF, 0x0066CCFF, 0x0066EEFF,
  10. 0x008800FF, 0x008822FF, 0x008844FF, 0x008866FF, 0x008888FF, 0x0088AAFF, 0x0088CCFF, 0x0088EEFF,
  11. 0x00AA00FF, 0x00AA22FF, 0x00AA44FF, 0x00AA66FF, 0x00AA88FF, 0x00AAAAFF, 0x00AACCFF, 0x00AAEEFF,
  12. 0x00CC00FF, 0x00CC22FF, 0x00CC44FF, 0x00CC66FF, 0x00CC88FF, 0x00CCAAFF, 0x00CCCCFF, 0x00CCEEFF,
  13. 0x00EE00FF, 0x00EE22FF, 0x00EE44FF, 0x00EE66FF, 0x00EE88FF, 0x00EEAAFF, 0x00EECCFF, 0x00EEEEFF,
  14.  
  15. 0x220000FF, 0x220022FF, 0x220044FF, 0x220066FF, 0x220088FF, 0x2200AAFF, 0x2200CCFF, 0x2200FFFF,
  16. 0x222200FF, 0x222222FF, 0x222244FF, 0x222266FF, 0x222288FF, 0x2222AAFF, 0x2222CCFF, 0x2222EEFF,
  17. 0x224400FF, 0x224422FF, 0x224444FF, 0x224466FF, 0x224488FF, 0x2244AAFF, 0x2244CCFF, 0x2244EEFF,
  18. 0x226600FF, 0x226622FF, 0x226644FF, 0x226666FF, 0x226688FF, 0x2266AAFF, 0x2266CCFF, 0x2266EEFF,
  19. 0x228800FF, 0x228822FF, 0x228844FF, 0x228866FF, 0x228888FF, 0x2288AAFF, 0x2288CCFF, 0x2288EEFF,
  20. 0x22AA00FF, 0x22AA22FF, 0x22AA44FF, 0x22AA66FF, 0x22AA88FF, 0x22AAAAFF, 0x22AACCFF, 0x22AAEEFF,
  21. 0x22CC00FF, 0x22CC22FF, 0x22CC44FF, 0x22CC66FF, 0x22CC88FF, 0x22CCAAFF, 0x22CCCCFF, 0x22CCEEFF,
  22. 0x22EE00FF, 0x22EE22FF, 0x22EE44FF, 0x22EE66FF, 0x22EE88FF, 0x22EEAAFF, 0x22EECCFF, 0x22EEEEFF,
  23.  
  24. 0x440000FF, 0x440022FF, 0x440044FF, 0x440066FF, 0x440088FF, 0x4400AAFF, 0x4400CCFF, 0x4400FFFF,
  25. 0x442200FF, 0x442222FF, 0x442244FF, 0x442266FF, 0x442288FF, 0x4422AAFF, 0x4422CCFF, 0x4422EEFF,
  26. 0x444400FF, 0x444422FF, 0x444444FF, 0x444466FF, 0x444488FF, 0x4444AAFF, 0x4444CCFF, 0x4444EEFF,
  27. 0x446600FF, 0x446622FF, 0x446644FF, 0x446666FF, 0x446688FF, 0x4466AAFF, 0x4466CCFF, 0x4466EEFF,
  28. 0x448800FF, 0x448822FF, 0x448844FF, 0x448866FF, 0x448888FF, 0x4488AAFF, 0x4488CCFF, 0x4488EEFF,
  29. 0x44AA00FF, 0x44AA22FF, 0x44AA44FF, 0x44AA66FF, 0x44AA88FF, 0x44AAAAFF, 0x44AACCFF, 0x44AAEEFF,
  30. 0x44CC00FF, 0x44CC22FF, 0x44CC44FF, 0x44CC66FF, 0x44CC88FF, 0x44CCAAFF, 0x44CCCCFF, 0x44CCEEFF,
  31. 0x44EE00FF, 0x44EE22FF, 0x44EE44FF, 0x44EE66FF, 0x44EE88FF, 0x44EEAAFF, 0x44EECCFF, 0x44EEEEFF,
  32.  
  33. 0x660000FF, 0x660022FF, 0x660044FF, 0x660066FF, 0x660088FF, 0x6600AAFF, 0x6600CCFF, 0x6600FFFF,
  34. 0x662200FF, 0x662222FF, 0x662244FF, 0x662266FF, 0x662288FF, 0x6622AAFF, 0x6622CCFF, 0x6622EEFF,
  35. 0x664400FF, 0x664422FF, 0x664444FF, 0x664466FF, 0x664488FF, 0x6644AAFF, 0x6644CCFF, 0x6644EEFF,
  36. 0x666600FF, 0x666622FF, 0x666644FF, 0x666666FF, 0x666688FF, 0x6666AAFF, 0x6666CCFF, 0x6666EEFF,
  37. 0x668800FF, 0x668822FF, 0x668844FF, 0x668866FF, 0x668888FF, 0x6688AAFF, 0x6688CCFF, 0x6688EEFF,
  38. 0x66AA00FF, 0x66AA22FF, 0x66AA44FF, 0x66AA66FF, 0x66AA88FF, 0x66AAAAFF, 0x66AACCFF, 0x66AAEEFF,
  39. 0x66CC00FF, 0x66CC22FF, 0x66CC44FF, 0x66CC66FF, 0x66CC88FF, 0x66CCAAFF, 0x66CCCCFF, 0x66CCEEFF,
  40. 0x66EE00FF, 0x66EE22FF, 0x66EE44FF, 0x66EE66FF, 0x66EE88FF, 0x66EEAAFF, 0x66EECCFF, 0x66EEEEFF,
  41.  
  42. 0x880000FF, 0x880022FF, 0x880044FF, 0x880066FF, 0x880088FF, 0x8800AAFF, 0x8800CCFF, 0x8800FFFF,
  43. 0x882200FF, 0x882222FF, 0x882244FF, 0x882266FF, 0x882288FF, 0x8822AAFF, 0x8822CCFF, 0x8822EEFF,
  44. 0x884400FF, 0x884422FF, 0x884444FF, 0x884466FF, 0x884488FF, 0x8844AAFF, 0x8844CCFF, 0x8844EEFF,
  45. 0x886600FF, 0x886622FF, 0x886644FF, 0x886666FF, 0x886688FF, 0x8866AAFF, 0x8866CCFF, 0x8866EEFF,
  46. 0x888800FF, 0x888822FF, 0x888844FF, 0x888866FF, 0x888888FF, 0x8888AAFF, 0x8888CCFF, 0x8888EEFF,
  47. 0x88AA00FF, 0x88AA22FF, 0x88AA44FF, 0x88AA66FF, 0x88AA88FF, 0x88AAAAFF, 0x88AACCFF, 0x88AAEEFF,
  48. 0x88CC00FF, 0x88CC22FF, 0x88CC44FF, 0x88CC66FF, 0x88CC88FF, 0x88CCAAFF, 0x88CCCCFF, 0x88CCEEFF,
  49. 0x88EE00FF, 0x88EE22FF, 0x88EE44FF, 0x88EE66FF, 0x88EE88FF, 0x88EEAAFF, 0x88EECCFF, 0x88EEEEFF,
  50.  
  51. 0xAA0000FF, 0xAA0022FF, 0xAA0044FF, 0xAA0066FF, 0xAA0088FF, 0xAA00AAFF, 0xAA00CCFF, 0xAA00FFFF,
  52. 0xAA2200FF, 0xAA2222FF, 0xAA2244FF, 0xAA2266FF, 0xAA2288FF, 0xAA22AAFF, 0xAA22CCFF, 0xAA22EEFF,
  53. 0xAA4400FF, 0xAA4422FF, 0xAA4444FF, 0xAA4466FF, 0xAA4488FF, 0xAA44AAFF, 0xAA44CCFF, 0xAA44EEFF,
  54. 0xAA6600FF, 0xAA6622FF, 0xAA6644FF, 0xAA6666FF, 0xAA6688FF, 0xAA66AAFF, 0xAA66CCFF, 0xAA66EEFF,
  55. 0xAA8800FF, 0xAA8822FF, 0xAA8844FF, 0xAA8866FF, 0xAA8888FF, 0xAA88AAFF, 0xAA88CCFF, 0xAA88EEFF,
  56. 0xAAAA00FF, 0xAAAA22FF, 0xAAAA44FF, 0xAAAA66FF, 0xAAAA88FF, 0xAAAAAAFF, 0xAAAACCFF, 0xAAAAEEFF,
  57. 0xAACC00FF, 0xAACC22FF, 0xAACC44FF, 0xAACC66FF, 0xAACC88FF, 0xAACCAAFF, 0xAACCCCFF, 0xAACCEEFF,
  58. 0xAAEE00FF, 0xAAEE22FF, 0xAAEE44FF, 0xAAEE66FF, 0xAAEE88FF, 0xAAEEAAFF, 0xAAEECCFF, 0xAAEEEEFF,
  59.  
  60. 0xCC0000FF, 0xCC0022FF, 0xCC0044FF, 0xCC0066FF, 0xCC0088FF, 0xCC00AAFF, 0xCC00CCFF, 0xCC00FFFF,
  61. 0xCC2200FF, 0xCC2222FF, 0xCC2244FF, 0xCC2266FF, 0xCC2288FF, 0xCC22AAFF, 0xCC22CCFF, 0xCC22EEFF,
  62. 0xCC4400FF, 0xCC4422FF, 0xCC4444FF, 0xCC4466FF, 0xCC4488FF, 0xCC44AAFF, 0xCC44CCFF, 0xCC44EEFF,
  63. 0xCC6600FF, 0xCC6622FF, 0xCC6644FF, 0xCC6666FF, 0xCC6688FF, 0xCC66AAFF, 0xCC66CCFF, 0xCC66EEFF,
  64. 0xCC8800FF, 0xCC8822FF, 0xCC8844FF, 0xCC8866FF, 0xCC8888FF, 0xCC88AAFF, 0xCC88CCFF, 0xCC88EEFF,
  65. 0xCCAA00FF, 0xCCAA22FF, 0xCCAA44FF, 0xCCAA66FF, 0xCCAA88FF, 0xCCAAAAFF, 0xCCAACCFF, 0xCCAAEEFF,
  66. 0xCCCC00FF, 0xCCCC22FF, 0xCCCC44FF, 0xCCCC66FF, 0xCCCC88FF, 0xCCCCAAFF, 0xCCCCCCFF, 0xCCCCEEFF,
  67. 0xCCEE00FF, 0xCCEE22FF, 0xCCEE44FF, 0xCCEE66FF, 0xCCEE88FF, 0xCCEEAAFF, 0xCCEECCFF, 0xCCEEEEFF,
  68.  
  69. 0xEE0000FF, 0xEE0022FF, 0xEE0044FF, 0xEE0066FF, 0xEE0088FF, 0xEE00AAFF, 0xEE00CCFF, 0xEE00FFFF,
  70. 0xEE2200FF, 0xEE2222FF, 0xEE2244FF, 0xEE2266FF, 0xEE2288FF, 0xEE22AAFF, 0xEE22CCFF, 0xEE22EEFF,
  71. 0xEE4400FF, 0xEE4422FF, 0xEE4444FF, 0xEE4466FF, 0xEE4488FF, 0xEE44AAFF, 0xEE44CCFF, 0xEE44EEFF,
  72. 0xEE6600FF, 0xEE6622FF, 0xEE6644FF, 0xEE6666FF, 0xEE6688FF, 0xEE66AAFF, 0xEE66CCFF, 0xEE66EEFF,
  73. 0xEE8800FF, 0xEE8822FF, 0xEE8844FF, 0xEE8866FF, 0xEE8888FF, 0xEE88AAFF, 0xEE88CCFF, 0xEE88EEFF,
  74. 0xEEAA00FF, 0xEEAA22FF, 0xEEAA44FF, 0xEEAA66FF, 0xEEAA88FF, 0xEEAAAAFF, 0xEEAACCFF, 0xEEAAEEFF,
  75. 0xEECC00FF, 0xEECC22FF, 0xEECC44FF, 0xEECC66FF, 0xEECC88FF, 0xEECCAAFF, 0xEECCCCFF, 0xEECCEEFF,
  76. 0xEEEE00FF, 0xEEEE22FF, 0xEEEE44FF, 0xEEEE66FF, 0xEEEE88FF, 0xEEEEAAFF, 0xEEEECCFF, 0xEEEEEEFF,
  77. };
  78. public OnFilterScriptInit()
  79. {
  80.     SetTimer("UpdateMap", 3000, 1);
  81. // Important
  82.     Test = TextDrawCreate(0.0, 0.0, "_");
  83.     TextDrawFont(Map[0], 0);
  84.     TextDrawTextSize(Map[0], 1.0, 1.0);
  85. // 
  86.     Map[0] = TextDrawCreate(0.0, 0.0, "samaps:gtasamapbit1");
  87.     TextDrawFont(Map[0], 4);
  88.     TextDrawBoxColor(Map[0], 0xFFFFFFAA);
  89.     TextDrawTextSize(Map[0], 320.0, 224.0);
  90.  
  91.     Map[1] = TextDrawCreate(320.0, 0.0, "samaps:gtasamapbit2");
  92.     TextDrawFont(Map[1], 4);
  93.     TextDrawBoxColor(Map[0], 0xFFFFFFAA);
  94.     TextDrawTextSize(Map[1], 320.0, 224.0);
  95.  
  96.     Map[2] = TextDrawCreate(0.0, 224.0, "samaps:gtasamapbit3");
  97.     TextDrawFont(Map[2], 4);
  98.     TextDrawBoxColor(Map[0], 0xFFFFFFAA);
  99.     TextDrawTextSize(Map[2], 320.0, 224.0);
  100.  
  101.     Map[3] = TextDrawCreate(320.0, 224.0, "samaps:gtasamapbit4");
  102.     TextDrawFont(Map[3], 4);
  103.     TextDrawBoxColor(Map[0], 0xFFFFFFAA);
  104.     TextDrawTextSize(Map[3], 320.0, 224.0);
  105.  
  106.     Map[4] = TextDrawCreate(0.0, 0.0, "samaps:map");
  107.     TextDrawFont(Map[4], 4);
  108.     TextDrawBoxColor(Map[0], 0xFFFFFFAA);
  109.     TextDrawTextSize(Map[4], 640.0, 448.0);
  110.  
  111.     ConnectNPC("Den_Kimyra", "blank");
  112.     ConnectNPC("Tomas_Angelo", "blank");
  113.     ConnectNPC("Jessy_James", "blank");
  114.     ConnectNPC("Michle_Jackson", "blank");
  115.     ConnectNPC("Sergio_Armani", "blank");
  116.     ConnectNPC("Mike_Tyson", "blank");
  117.     ConnectNPC("Andy_Smith", "blank");
  118.     ConnectNPC("Angelo_Melan", "blank");
  119.     ConnectNPC("Ahmed_Simonov", "blank");
  120.     ConnectNPC("Alex_McNally", "blank");
  121.     ConnectNPC("Frank_Lampard", "blank");
  122.     ConnectNPC("Anya_Molen", "blank");
  123.     ConnectNPC("Masha_Angel", "blank");
  124.     ConnectNPC("Misha_Potapov", "blank");
  125.     ConnectNPC("Jenny_Smith", "blank");
  126.     ConnectNPC("Semen_Mironov", "blank");
  127.     ConnectNPC("Mose_Larsen", "blank");
  128.     ConnectNPC("Masa_Debose", "blank");
  129.     ConnectNPC("Mickle_Melan", "blank");
  130.     ConnectNPC("Fedya_Lomanov", "blank");
  131.     ConnectNPC("Roman_Beztolov", "blank");
  132.     ConnectNPC("Rick_Mick", "blank");
  133.     ConnectNPC("Lenny_Smith", "blank");
  134.     ConnectNPC("Mac_Ferrary", "blank");
  135.     ConnectNPC("Dage_Sen", "blank");
  136.     ConnectNPC("Angela_Kimyra", "blank");
  137.     ConnectNPC("Den_Simpson", "blank");
  138.     ConnectNPC("Mo_Debose", "blank");
  139.     ConnectNPC("Denny_Dese", "blank");
  140.     ConnectNPC("Marry_Jack", "blank");
  141.     ConnectNPC("Seck_Mack", "blank");
  142.     ConnectNPC("Danny_Dense", "blank");
  143.     ConnectNPC("Masha_Kimmy", "blank");
  144.     ConnectNPC("Leonardo_Da_Vinci", "blank");
  145.     ConnectNPC("Mick_Toobig", "blank");
  146.     ConnectNPC("Tycon_Jake", "blank");
  147.     ConnectNPC("James_Dreas", "blank");
  148.     ConnectNPC("Armani_Ot_Armani", "blank");
  149.     ConnectNPC("Tender_Medlton", "blank");
  150.     ConnectNPC("Kate_Jackson", "blank");
  151.     ConnectNPC("Den_Jackson", "blank");
  152.     ConnectNPC("Lebron_James", "blank");
  153.     ConnectNPC("Shil_Herro", "blank");
  154.     ConnectNPC("Fred_Melan", "blank");
  155.     ConnectNPC("Drake_House", "blank");
  156.     ConnectNPC("Alf_House", "blank");
  157.     ConnectNPC("Denis_Lebronov", "blank");
  158.     ConnectNPC("Misha_Portov", "blank");
  159.     ConnectNPC("Kirill_Lenio", "blank");
  160.     ConnectNPC("Morse_Debo", "blank");
  161.     ConnectNPC("Anoma_De_Arich", "blank");
  162.     ConnectNPC("Fred_McEazzy", "blank");
  163.     ConnectNPC("Dick_Mich", "blank");
  164.     ConnectNPC("Roman_Zlatov", "blank");
  165.     ConnectNPC("Rick_Rich", "blank");
  166.     ConnectNPC("Lenny_Meane", "blank");
  167.     ConnectNPC("Fill_Tern", "blank");
  168.     ConnectNPC("Zein_Bermont", "blank");
  169.     ConnectNPC("Masha_Cole", "blank");
  170.     ConnectNPC("Jonny_Smith", "blank");
  171.     ConnectNPC("Holly_Wood", "blank");
  172.     ConnectNPC("Mersedes_Melan", "blank");
  173.     ConnectNPC("Jake_Tyler", "blank");
  174.     ConnectNPC("Oleg_Horyainov", "blank");
  175.     ConnectNPC("Sean_McKinly", "blank");
  176.     ConnectNPC("Den_Shnaider", "blank");
  177.     ConnectNPC("Mike_Jordan", "blank");
  178.     ConnectNPC("Lenon_Lerby", "blank");
  179.     ConnectNPC("Unly_Tolife", "blank");
  180.     ConnectNPC("Jack_Tack", "blank");
  181.     ConnectNPC("Melany_Fox", "blank");
  182.     ConnectNPC("Tommy_Kolombo", "blank");
  183.     ConnectNPC("Zein_Bern", "blank");
  184.     ConnectNPC("Homer_Simpson", "blank");
  185.     ConnectNPC("Den_Lampard", "blank");
  186.     ConnectNPC("Only_Deas", "blank");
  187.     ConnectNPC("Hender_Smith", "blank");
  188.     ConnectNPC("Kind_Ferron", "blank");
  189.     ConnectNPC("Tomas_Heran", "blank");
  190.     ConnectNPC("Ben_Moran", "blank");
  191.     ConnectNPC("Lacio_Rio_Postern", "blank");
  192.     ConnectNPC("Din_Bin", "blank");
  193.     ConnectNPC("Usama_Bin_Laden", "blank");
  194.     ConnectNPC("Misha_Medvedev", "blank");
  195.  
  196.     return 1;
  197. }
  198. public OnFilterScriptExit()
  199. {
  200.     for(new i; i < sizeof(Map); i++)
  201.     {
  202.         TextDrawHideForAll(Map[i]);
  203.         TextDrawDestroy(Map[i]);
  204.     }
  205.     for(new i, j = GetMaxPlayers(); i != j; i++)
  206.     {
  207.         TextDrawHideForAll(Player[i]);
  208.         TextDrawDestroy(Player[i]);
  209.         TextDrawHideForAll(Stats[i]);
  210.         TextDrawDestroy(Stats[i]);
  211.         if(IsPlayerNPC(i)) Kick(i);
  212.         if(GetPVarInt(i, "ShowMap") == 1) SetPVarInt(i, "ShowMap", 0);
  213. //      ShowPlayerDialog(i, -1, DIALOG_STYLE_PASSWORD, "_", "_", "", "");
  214.     }
  215.     return 1;
  216. }
  217. public OnPlayerSpawn(playerid)
  218. {
  219.     if(IsPlayerNPC(playerid))
  220.     {
  221.         if(playerid < 20)
  222.         {
  223.             SetPlayerPos(playerid, 40.0 * playerid, 40.0 * playerid, 10.0);
  224.         }
  225.         else if(playerid > 19 && playerid < 40)
  226.         {
  227.             SetPlayerPos(playerid, -40.0 * playerid, -40.0 * playerid, 10.0);
  228.         }
  229.         else if(playerid > 39 && playerid < 60)
  230.         {
  231.             SetPlayerPos(playerid, -40.0 * playerid, 40.0 * playerid, 10.0);
  232.         }
  233.         else if(playerid > 59 && playerid < 90)
  234.         {
  235.             SetPlayerPos(playerid, 40.0 * playerid, -40.0 * playerid, 10.0);
  236.         }
  237.     }
  238.     TextDrawShowForPlayer(playerid, Test);
  239.     return 1;
  240. }
  241. public OnPlayerCommandText(playerid, cmdtext[])
  242. {
  243.     if(strcmp(cmdtext, "/map", true) == 0)
  244.     {
  245.         new mstatus[30], tstatus[30], sstatus[30];
  246.         mstatus[0] = 0; tstatus[0] = 0; sstatus[0] = 0;
  247.         if(GetPVarInt(playerid, "ShowMap") == 1) strcat(mstatus, "{FF0000}[OFF]");
  248.         else if(GetPVarInt(playerid, "ShowMap") == 0) strcat(mstatus, "{00FF00}[ON]");
  249.         if(GetPVarInt(playerid, "MapType") == 1) strcat(tstatus, "{FFFF00}[LQ]");
  250.         else if(GetPVarInt(playerid, "MapType") == 0) strcat(tstatus, "{FF00FF}[HQ]");
  251.         if(GetPVarInt(playerid, "MapStat") == 1) strcat(sstatus, "{FF0000}[OFF]");
  252.         else if(GetPVarInt(playerid, "MapStat") == 0) strcat(sstatus, "{00FF00}[ON]");
  253.         new string[138];
  254.         format(string, sizeof(string), "Map-Radar\t\t\t%s\n{FFFFFF}Quality of Image\t\t%s\n{FFFFFF}Additional Info\t%s", mstatus, tstatus, sstatus);
  255.         ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_LIST, "Map-Radar", string, "Select", "Cancel");
  256.         return 1;
  257.     }
  258.     return 0;
  259. }
  260. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  261. {
  262.     if(dialogid == 1337)
  263.     {
  264.         if(response)
  265.         {
  266.             switch(listitem)
  267.             {
  268.                 case 0:
  269.                 {
  270.                     if(GetPVarInt(playerid, "ShowMap") == 1)
  271.                     {
  272.                         SetPVarInt(playerid, "ShowMap", 0);
  273.                         if(GetPVarInt(playerid, "MapType") == 0)
  274.                         {
  275.                             TextDrawHideForPlayer(playerid, Map[0]);
  276.                             TextDrawHideForPlayer(playerid, Map[1]);
  277.                             TextDrawHideForPlayer(playerid, Map[2]);
  278.                             TextDrawHideForPlayer(playerid, Map[3]);
  279.                         }
  280.                         else if(GetPVarInt(playerid, "MapType") == 1)
  281.                         {
  282.                             TextDrawHideForPlayer(playerid, Map[4]);
  283.                         }
  284.                         for(new i, j = GetMaxPlayers(); i != j; i++)
  285.                         {
  286.                             TextDrawHideForPlayer(playerid, Player[i]);
  287.                             TextDrawHideForPlayer(playerid, Stats[i]);
  288.                         }
  289.                     }
  290.                     else if(GetPVarInt(playerid, "ShowMap") == 0)
  291.                     {
  292.                         SetPVarInt(playerid, "ShowMap", 1);
  293.                         if(GetPVarInt(playerid, "MapType") == 0)
  294.                         {
  295.                             TextDrawShowForPlayer(playerid, Map[0]);
  296.                             TextDrawShowForPlayer(playerid, Map[1]);
  297.                             TextDrawShowForPlayer(playerid, Map[2]);
  298.                             TextDrawShowForPlayer(playerid, Map[3]);
  299.                         }
  300.                         else if(GetPVarInt(playerid, "MapType") == 1)
  301.                         {
  302.                             TextDrawShowForPlayer(playerid, Map[4]);
  303.                         }
  304.                     }
  305.                     new mstatus[30], tstatus[30], sstatus[30];
  306.                     mstatus[0] = 0; tstatus[0] = 0; sstatus[0] = 0;
  307.                     if(GetPVarInt(playerid, "ShowMap") == 1) strcat(mstatus, "{FF0000}[OFF]");
  308.                     else if(GetPVarInt(playerid, "ShowMap") == 0) strcat(mstatus, "{00FF00}[ON]");
  309.                     if(GetPVarInt(playerid, "MapType") == 1) strcat(tstatus, "{FFFF00}[LQ]");
  310.                     else if(GetPVarInt(playerid, "MapType") == 0) strcat(tstatus, "{FF00FF}[HQ]");
  311.                     if(GetPVarInt(playerid, "MapStat") == 1) strcat(sstatus, "{FF0000}[OFF]");
  312.                     else if(GetPVarInt(playerid, "MapStat") == 0) strcat(sstatus, "{00FF00}[ON]");
  313.                     new string[138];
  314.                     format(string, sizeof(string), "Map-Radar\t\t\t%s\n{FFFFFF}Quality of Image\t\t%s\n{FFFFFF}Additional Info\t%s", mstatus, tstatus, sstatus);
  315.                     ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_LIST, "Map-Radar", string, "Select", "Cancel");
  316.                 }
  317.                 case 1:
  318.                 {
  319.                     if(GetPVarInt(playerid, "MapType") == 0)
  320.                     {
  321.                         TextDrawHideForPlayer(playerid, Map[0]);
  322.                         TextDrawHideForPlayer(playerid, Map[1]);
  323.                         TextDrawHideForPlayer(playerid, Map[2]);
  324.                         TextDrawHideForPlayer(playerid, Map[3]);
  325.                     }
  326.                     else if(GetPVarInt(playerid, "MapType") == 1)
  327.                     {
  328.                         TextDrawHideForPlayer(playerid, Map[4]);
  329.                     }
  330.  
  331.                     if(GetPVarInt(playerid, "MapType") == 0) SetPVarInt(playerid, "MapType", 1);
  332.                     else if(GetPVarInt(playerid, "MapType") == 1) SetPVarInt(playerid, "MapType", 0);
  333.  
  334.                     if(GetPVarInt(playerid, "ShowMap") == 1)
  335.                     {
  336.                         if(GetPVarInt(playerid, "MapType") == 0)
  337.                         {
  338.                             TextDrawShowForPlayer(playerid, Map[0]);
  339.                             TextDrawShowForPlayer(playerid, Map[1]);
  340.                             TextDrawShowForPlayer(playerid, Map[2]);
  341.                             TextDrawShowForPlayer(playerid, Map[3]);
  342.                         }
  343.                         else if(GetPVarInt(playerid, "MapType") == 1)
  344.                         {
  345.                             TextDrawShowForPlayer(playerid, Map[4]);
  346.                         }
  347.                     }
  348.                    
  349.                     new mstatus[30], tstatus[30], sstatus[30];
  350.                     mstatus[0] = 0; tstatus[0] = 0; sstatus[0] = 0;
  351.                     if(GetPVarInt(playerid, "ShowMap") == 1) strcat(mstatus, "{FF0000}[OFF]");
  352.                     else if(GetPVarInt(playerid, "ShowMap") == 0) strcat(mstatus, "{00FF00}[ON]");
  353.                     if(GetPVarInt(playerid, "MapType") == 1) strcat(tstatus, "{FFFF00}[LQ]");
  354.                     else if(GetPVarInt(playerid, "MapType") == 0) strcat(tstatus, "{FF00FF}[HQ]");
  355.                     if(GetPVarInt(playerid, "MapStat") == 1) strcat(sstatus, "{FF0000}[OFF]");
  356.                     else if(GetPVarInt(playerid, "MapStat") == 0) strcat(sstatus, "{00FF00}[ON]");
  357.                     new string[138];
  358.                     format(string, sizeof(string), "Map-Radar\t\t\t%s\n{FFFFFF}Quality of Image\t\t%s\n{FFFFFF}Additional Info\t%s", mstatus, tstatus, sstatus);
  359.                     ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_LIST, "Map-Radar", string, "Select", "Cancel");
  360.                 }
  361.                 case 2:
  362.                 {
  363.                     if(GetPVarInt(playerid, "MapStat") == 0) SetPVarInt(playerid, "MapStat", 1);
  364.                     else if(GetPVarInt(playerid, "MapStat") == 1) SetPVarInt(playerid, "MapStat", 0);
  365.  
  366.                     new mstatus[30], tstatus[30], sstatus[30];
  367.                     mstatus[0] = 0; tstatus[0] = 0; sstatus[0] = 0;
  368.                     if(GetPVarInt(playerid, "ShowMap") == 1) strcat(mstatus, "{FF0000}[OFF]");
  369.                     else if(GetPVarInt(playerid, "ShowMap") == 0) strcat(mstatus, "{00FF00}[ON]");
  370.                     if(GetPVarInt(playerid, "MapType") == 1) strcat(tstatus, "{FFFF00}[LQ]");
  371.                     else if(GetPVarInt(playerid, "MapType") == 0) strcat(tstatus, "{FF00FF}[HQ]");
  372.                     if(GetPVarInt(playerid, "MapStat") == 1) strcat(sstatus, "{FF0000}[OFF]");
  373.                     else if(GetPVarInt(playerid, "MapStat") == 0) strcat(sstatus, "{00FF00}[ON]");
  374.                     new string[138];
  375.                     format(string, sizeof(string), "Map-Radar\t\t\t%s\n{FFFFFF}Quality of Image\t\t%s\n{FFFFFF}Additional Info\t%s", mstatus, tstatus, sstatus);
  376.                     ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_LIST, "Map-Radar", string, "Select", "Cancel");
  377.                 }
  378.             }
  379.         }
  380.     }
  381.     return 0;
  382. }
  383. forward UpdateMap();
  384. public UpdateMap()
  385. {
  386.     for(new i, j = GetMaxPlayers(); i != j; i++)
  387.     {
  388.         TextDrawHideForAll(Player[i]);
  389.         TextDrawDestroy(Player[i]);
  390.         TextDrawHideForAll(Stats[i]);
  391.         TextDrawDestroy(Stats[i]);
  392.     }
  393.     new Float:x, Float:y, Float:z, PlayerName[MAX_PLAYER_NAME], Float:HP, Float:AP, string[128];
  394.     for(new i, j = GetMaxPlayers(); i != j; i++)
  395.     {
  396.         if(!IsPlayerConnected(i)) continue;
  397. //      if(IsPlayerNPC(i)) continue;
  398.         GetPlayerPos(i, x, y, z);
  399.         if(y < -3000 || y > 3000 || x < -3000 || x > 3000) continue;
  400.         new Float:PosX, Float:PosY;
  401. // (316.0 ; 207.0) Scale center
  402.         if(y < 0) PosY = 207 + 224 * -y / 3000;
  403.         else if(y >= 0) PosY = 207 - 224 * y / 3000;
  404.         if(x < 0) PosX = 316 - -x * 320 / 3000;
  405.         else if(x >= 0) PosX = 316 + x * 320 / 3000;
  406.  
  407.         Player[i] = TextDrawCreate(PosX, PosY, "-");
  408.         TextDrawFont(Player[i], 1);
  409.         TextDrawLetterSize(Player[i], 0.49, 2.9);
  410.         TextDrawColor(Player[i], PlayerRainbowColors[210 + i]);
  411.         TextDrawSetOutline(Player[i], 1);
  412.  
  413.         GetPlayerName(i, PlayerName, sizeof(PlayerName));
  414.         GetPlayerHealth(i, HP);
  415.         GetPlayerArmour(i, AP);
  416.  
  417.         format(string, sizeof(string), "ID: %d NAME: %s HP: %.1f AP: %.1f~n~X: %.4f Y: %.4f Z: %.4f", i, PlayerName, HP, AP, x, y, z);
  418.         Stats[i] = TextDrawCreate(PosX, PosY, string);
  419.         TextDrawFont(Stats[i], 1);
  420.         TextDrawLetterSize(Stats[i], 0.16, 0.6);
  421.         TextDrawColor(Stats[i], 0xFFFFFFFF);
  422.         TextDrawSetOutline(Stats[i], 1);
  423.  
  424.         for(new h, k = GetMaxPlayers(); h != k; h++)
  425.         {
  426.             if(!IsPlayerConnected(h)) continue;
  427.             if(IsPlayerNPC(h)) continue;
  428.             if(GetPVarInt(h, "ShowMap") == 0) continue;
  429.             TextDrawShowForPlayer(h, Player[i]);
  430.             if(GetPVarInt(h, "MapStat") == 1) TextDrawShowForPlayer(h, Stats[i]);
  431.         }
  432.     }
  433.     return 1;
  434. }
RAW Paste Data