hlmod.hu
https://hlmod.hu/

Bolt!
https://hlmod.hu/viewtopic.php?f=24&t=19350
Oldal: 1 / 1

Szerző:  PiStA99 [2015.02.06. 15:58 ]
Hozzászólás témája:  Bolt!

Cső,valaki tudna segiteni hogy mikor be irom hogy /bolt akkor 1.Bolt arra ra megyek és be hozza a bolt-ot,és még annyi hogy amikor meg veszem az USP -et akkor Dobja a kezembe KÖSZÖNÖM
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmodx>
  3. #include <fun>
  4. #include <cstrike>
  5. #include <hamsandwich>
  6. #include <fakemeta>
  7.  
  8. new pont[33]
  9.  
  10. #define PLUGIN "BOLT"
  11. #define VERSION "1.0"
  12. #define AUTHOR "Pista"
  13.  
  14. public plugin_precache() {
  15. precache_model("models/fegyver/usp.mdl")
  16. }
  17.  
  18. public plugin_init() {
  19. register_plugin(PLUGIN, VERSION, AUTHOR)
  20. register_clcmd("say /bolt","boltmenu")
  21. register_event("DeathMsg","halal","a")
  22. register_event("CurWeapon", "ecw", "be", "1=1")
  23. }
  24. public halal(){
  25. new killer = read_data(1)
  26. new victim = read_data(2)
  27.  
  28. if(killer != victim)
  29. {
  30. pont[killer] += 10
  31. }
  32. }
  33. public ecw(id){
  34. new fegyver = get_user_weapon(id)
  35. if(pont[id] == 0 && fegyver == CSW_USP)
  36. {
  37. set_pev(id, pev_viewmodel2, "models/fegyver/usp.mdl")
  38. }
  39. }
  40. public boltmenu(id){
  41. new cim[121]
  42. format(cim, charsmax(cim),"Bolt^nPont: %d",pont[id])
  43. new menu = menu_create(cim, "menu_h")
  44. menu_additem(menu,"USP","1",0)
  45. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  46.  
  47. menu_display(id, menu, 0)
  48. }
  49. public menu_h(id, menu, item)
  50. {
  51. if( item == MENU_EXIT )
  52. {
  53. menu_destroy(menu);
  54. return PLUGIN_HANDLED;
  55. }
  56.  
  57. new data[6], szName[64];
  58. new access, callback;
  59. menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
  60. new key = str_to_num(data);
  61. switch(key)
  62. {
  63. case 1:{
  64. if(pont[id] >= 10)
  65. {
  66. give_item(id, "wepaon_usp")
  67. cs_set_user_bpammo(id,CSW_USP,120)
  68. pont[id] -= 10
  69. client_print(id, print_chat, "Meg vetted az USP-t!")
  70. }
  71. else {
  72. client_print(id, print_chat, "Nincs eleg pontod!")
  73. }
  74. }
  75. }
  76. }

Szerző:  6almasok [2015.02.06. 16:32 ]
Hozzászólás témája:  Re: Bolt!

Nem tudom működik-e de ha valami nem jó írd le
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmodx>
  3. #include <fun>
  4. #include <cstrike>
  5. #include <hamsandwich>
  6. #include <fakemeta>
  7.  
  8. new pont[33],usp[33]
  9.  
  10. #define PLUGIN "BOLT"
  11. #define VERSION "1.0"
  12. #define AUTHOR "Pista"
  13.  
  14. public plugin_precache() {
  15. precache_model("models/fegyver/usp.mdl")
  16. }
  17.  
  18. public plugin_init() {
  19. register_plugin(PLUGIN, VERSION, AUTHOR)
  20. register_clcmd("say /bolt","boltmenu")
  21. register_event("DeathMsg","halal","a")
  22. register_event("CurWeapon", "ecw", "be", "1=1")
  23. }
  24. public halal(){
  25. new killer = read_data(1)
  26. new victim = read_data(2)
  27.  
  28. if(killer != victim)
  29. {
  30. pont[killer] += 10
  31. }
  32. }
  33. public ecw(id){
  34. new fegyver = get_user_weapon(id)
  35. if(usp[id] == 0 && fegyver == CSW_USP)
  36. {
  37. set_pev(id, pev_viewmodel2, "models/fegyver/usp.mdl")
  38. }
  39. }
  40. public boltmenu(id){
  41. new cim[121]
  42. format(cim, charsmax(cim),"Bolt^nPont: %d",pont[id])
  43.  
  44. new menu = menu_create(cim, "menu_hhan" )
  45.  
  46. if(pont[id] >= 300)
  47. menu_additem(menu,"USP","1",0)
  48.  
  49. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  50. menu_setprop(menu, MPROP_BACKNAME, "Vissza");
  51. menu_setprop(menu, MPROP_NEXTNAME, "Elore");
  52. menu_setprop(menu, MPROP_EXITNAME, "Kilepes");
  53. menu_display(id, menu, 0);
  54. }
  55. public menu_hhan(id, menu, item)
  56. {
  57. if( item == MENU_EXIT )
  58. {
  59. menu_destroy(id);
  60. return PLUGIN_HANDLED;
  61. }
  62. new data[9], szName[64];
  63. new access, callback;
  64. menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
  65. new key = str_to_num(data);
  66.  
  67. switch(key)
  68. {
  69. case 1:{
  70. if(pont[id] >= 10)
  71. {
  72. usp[id] = 0
  73. give_item(id, "weapon_usp")
  74. cs_set_user_bpammo(id,CSW_USP,120)
  75. pont[id] -= 10
  76. client_print(id, print_chat, "Megvetted az USP-t!");
  77. }
  78. else
  79. {
  80. client_print(id, print_chat, "Nincs eleg pontod!");
  81. }
  82. }
  83. }
  84. }

Szerző:  PiStA99 [2015.02.06. 18:14 ]
Hozzászólás témája:  Re: Bolt!

Már a menü se jön be

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