hlmod.hu
https://hlmod.hu/

Jump menü
https://hlmod.hu/viewtopic.php?f=29&t=10034
Oldal: 1 / 1

Szerző:  demon [ 2013.08.10. 14:14 ]
Hozzászólás témája:  Jump menü

Sziasztok

Egy olyan plugin kellene ami /jumpmenu parancsra kihoz egy menüt amiben benne van 2 menüpont 1. Egy ugrás 2. Kettő ugrás és az általam kiválasztott menüpont érvényesüljön tehát ha kiválasztom a 2. menüpontot akkor 2-t tudjak ugrani, az 1. menüpontnál ne csináljon semmit.

Előre is köszönöm :D

Szerző:  Vinnice [ 2013.08.10. 15:11 ]
Hozzászólás témája:  Re: Jump menü

Teszteld.
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fakemeta>
  4.  
  5. new bool:dupla[33]
  6. new bool:duplaugrass[33];
  7.  
  8. public plugin_init()
  9. {
  10. register_plugin("Dupla", "1.0", "Vinnice");
  11. register_clcmd("say /menu", "Menuj");
  12. register_forward(FM_CmdStart, "duplaugras");
  13. }
  14.  
  15. public client_connect(id) dupla[id] = false;
  16.  
  17. public Menuj(id)
  18. {
  19. new menu = menu_create("UgrasMenu", "handler");
  20.  
  21. menu_additem(menu, "1 ugras", "", 0);
  22. menu_additem(menu, "2 ugras", "", 0);
  23.  
  24. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  25. menu_display(id, menu, 0);
  26.  
  27. return PLUGIN_HANDLED;
  28. }
  29. public handler(id, menu, item)
  30. {
  31. if(item == MENU_EXIT)
  32. {
  33. menu_cancel(id);
  34. return PLUGIN_HANDLED;
  35. }
  36.  
  37. new command[6], name[64], access, callback;
  38.  
  39. menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
  40.  
  41. switch(item)
  42. {
  43. case 0:
  44. {
  45. client_print(id, print_chat, "Csak 1et ugorhatsz")
  46. dupla[id] = false
  47. }
  48. case 1:
  49. {
  50. client_print(id, print_chat, "DuplaUgras engedelyezve!")
  51. dupla[id] = true
  52. }
  53. }
  54. menu_destroy(menu);
  55. return PLUGIN_HANDLED;
  56. }
  57. public duplaugras(id, uc_handle)
  58. {
  59. if(!dupla[id])
  60. return FMRES_IGNORED;
  61.  
  62. new button = get_uc(uc_handle, UC_Buttons);
  63. new oldbutton = pev(id, pev_oldbuttons);
  64. new flags = pev(id, pev_flags);
  65. if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && duplaugrass[id])
  66. {
  67. duplaugrass[id] = false;
  68. new Float:velocity[3];
  69. pev(id, pev_velocity, velocity);
  70. velocity[2] = random_float(265.0,285.0);
  71. set_pev(id, pev_velocity, velocity);
  72.  
  73. }
  74. else if(flags & FL_ONGROUND)
  75. duplaugrass[id] = true;
  76.  
  77. return FMRES_IGNORED;
  78. }

Szerző:  demon [ 2013.08.10. 15:37 ]
Hozzászólás témája:  Re: Jump menü

Ha beleírsz még 3. menüpontot 3 ugrás névvel és 4. menüpontot 4 ugrás névvel és persze ha kiválasztom akkor anyit ugorjon akkor megy a köszönöm

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/