Advertisement
Guest User

KeyMap by MrToddy_

a guest
Dec 22nd, 2018
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. /*==============================================================================
  2.  
  3. Include Criada por MrToddy_ Usado no Just Scavenge
  4. Used in Just Scavenge server.
  5. Scavenge and Survive by Southclaw
  6.  
  7.  
  8. CONCEITOS DA INCLUDE
  9.  
  10. > MAP KEY < (Tecla para abrir o mapa, sem precisar entrar no ESC)
  11.  
  12. {{{{{{{{{{{}}}}}}}}}}}}} Include by MrToddy_
  13.  
  14.  
  15.  
  16.  
  17. ==============================================================================*/
  18.  
  19. #include <a_samp> // by SA-MP team
  20. #include <YSI\y_hooks> // by Y_Less
  21. #include <DOF2> // Não achei quem criou, então caso alguém saiba, por favor, deixe aí que eu irei mudar =(
  22.  
  23. /*
  24. Callbacks
  25. */
  26.  
  27. forward OpenMap(playerid); // Não usadas
  28. forward ExitMap(playerid); // Não usadas
  29.  
  30. /*
  31. News
  32. */
  33. new Text:MAPA;
  34.  
  35. public OnFilterScriptInit()
  36. {
  37. printf("/*=========================\n\n");
  38. printf("\nInclude KeyMap by: MrToddy_\n\n");
  39. printf("=============================*/");
  40. return 1;
  41. }
  42.  
  43. hook OnPlayerConnect(playerid)
  44. {
  45. MAPA = TextDrawCreate(120.0, 20.0, "samaps:map");
  46. TextDrawFont(MAPA, 4);
  47. TextDrawColor(MAPA, 0xFFFFFFFF);
  48. TextDrawTextSize(MAPA, 400.0, 400.0);
  49. return 1;
  50. }
  51.  
  52. hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  53. {
  54. if(newkeys & KEY_WALK)
  55. {
  56. if(IsPlayerConnected(playerid))
  57. {
  58. MostrarMapa(playerid);
  59. }
  60. }
  61. if(newkeys & KEY_CROUCH)
  62. {
  63. if(IsPlayerConnected(playerid))
  64. {
  65. TirarMapa(playerid);
  66. }
  67. }
  68. return 1;
  69. }
  70.  
  71.  
  72. public OnFilterScriptExit()
  73. {
  74. printf("/*========================\n\n");
  75. printf("\nInclude KeyMap desligando.\n\n");
  76. printf("============================*/");
  77. return 1;
  78. }
  79.  
  80.  
  81. /*
  82. Stocks
  83. */
  84.  
  85. stock MostrarMapa(playerid)
  86. {
  87.  
  88. TextDrawShowForPlayer(playerid, MAPA);
  89. SendClientMessage(playerid, -1, "[ > ] Você abriu o Mapa, você pode fecha-lo apertando C !");
  90. return 1;
  91.  
  92. }
  93.  
  94. stock TirarMapa(playerid)
  95. {
  96.  
  97. TextDrawHideForPlayer(playerid, MAPA);
  98. SendClientMessage(playerid, -1, "[ > ] Você fechou o Mapa, você pode abri-lo apertando L-ALT !");
  99. return 1; }
  100. }
  101. //======================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement