hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.25. 06:54



Jelenlévő felhasználók

Jelenleg 197 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 196 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot] az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Lőszercsomag küldés
HozzászólásElküldve: 2013.10.03. 13:14 
Offline
Őstag
Avatar

Csatlakozott: 2011.11.15. 16:29
Hozzászólások: 1142
Megköszönt másnak: 8 alkalommal
Megköszönték neki: 24 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <zombieplague>
  6.  
  7. #define PLUGIN "[ZP] Donate Ammo Packs"
  8. #define VERSION "1.0"
  9. #define AUTHOR "r1laX , PomanoB"
  10.  
  11. new g_UserTotalAmmo[33]
  12. new g_CvarAllowDonate
  13. new SayText
  14.  
  15.  
  16. public plugin_init() {
  17. register_plugin(PLUGIN, VERSION, AUTHOR)
  18.  
  19. g_CvarAllowDonate = register_cvar("zp_stats_allow_donate", "1")
  20.  
  21. register_clcmd("say", "handleSay")
  22. register_clcmd("say_team", "handleSay")
  23.  
  24. register_event("HLTV", "RoundStart", "a", "1=0", "2=0")
  25.  
  26. SayText = get_user_msgid("SayText")
  27.  
  28. }
  29.  
  30. public RoundStart()
  31. {
  32. if (get_pcvar_num(g_CvarAllowDonate))
  33. set_task(2.2, "MsgOnRoundStart")
  34.  
  35. }
  36.  
  37. public MsgOnRoundStart()
  38. {
  39. if(get_pcvar_num(g_CvarAllowDonate))
  40. client_printcolor(0, "!g[ZP] !yTo donate others Ammo Packs, type !g/donate")
  41.  
  42. }
  43.  
  44. public handleSay(id)
  45. {
  46. new args[64]
  47.  
  48. read_args(args, charsmax(args))
  49. remove_quotes(args)
  50.  
  51. new arg1[16]
  52. new arg2[32]
  53.  
  54. strbreak(args, arg1, charsmax(arg1), arg2, charsmax(arg2))
  55. if (get_pcvar_num(g_CvarAllowDonate) && equal(arg1,"/donate", 7))
  56. donate(id, arg2)
  57.  
  58. }
  59.  
  60. public donate(id, arg[])
  61. {
  62. new to[32], count[10]
  63. strbreak(arg, to, 31, count, 9)
  64.  
  65. if (!to[0] || !count[0])
  66. {
  67. client_printcolor(id, "!g[ZP] !yUsage: say /donate <name> <amount>")
  68. return
  69. }
  70. new ammo_sender = zp_get_user_ammo_packs(id)
  71. new ammo
  72. if (equal(count, "all"))
  73. ammo = ammo_sender
  74. else
  75. ammo = str_to_num(count)
  76. if (ammo <= 0)
  77. {
  78. client_printcolor(id, "!g[ZP] !yWrong ammo quantity!")
  79. return
  80. }
  81. ammo_sender -= ammo
  82. if (ammo_sender < 0)
  83. {
  84. ammo+=ammo_sender
  85. ammo_sender = 0
  86.  
  87. }
  88. new reciever = cmd_target(id, to, (CMDTARGET_ALLOW_SELF))
  89. if (!reciever || reciever == id)
  90. {
  91. client_printcolor(id, "!g[ZP] !yPlayer !g%s !yhas not been found on the server!", to)
  92. return
  93. }
  94.  
  95. zp_set_user_ammo_packs(reciever, zp_get_user_ammo_packs(reciever) + ammo)
  96. g_UserTotalAmmo[reciever] += ammo
  97. zp_set_user_ammo_packs(id, ammo_sender)
  98. new aName[32], vName[32]
  99.  
  100. get_user_name(id, aName, 31)
  101. get_user_name(reciever, vName, 31)
  102.  
  103. set_hudmessage(255, 0, 0, -1.0, 0.3, 0, 6.0, 6.0)
  104. show_hudmessage(0, "%s donated %d Ammo Packs to %s!", aName, ammo, vName)
  105.  
  106. }
  107.  
  108. stock client_printcolor(const id, const input[], any:...)
  109. {
  110. new count = 1, players[32]
  111. static msg[191]
  112. vformat(msg, 190, input, 3)
  113.  
  114. replace_all(msg, 190, "!g", "^4") // Green Color
  115. replace_all(msg, 190, "!y", "^1") // Default Color
  116. replace_all(msg, 190, "!t", "^3") // Team Color
  117.  
  118. if (id) players[0] = id; else get_players(players, count, "ch")
  119. {
  120. for ( new i = 0; i < count; i++ )
  121. {
  122. if ( is_user_connected(players[i]) )
  123. {
  124. message_begin(MSG_ONE_UNRELIABLE, SayText, _, players[i])
  125. write_byte(players[i]);
  126. write_string(msg);
  127. message_end();
  128. }
  129. }
  130. }
  131. }
  132. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  133. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
  134. */
  135.  


Valaki kibírná szedni azt ,hogy ki írja hud üzenetbe kinek mennyi lett küldvé és hogy ezzel a két opcióval is működjön!

/kuldes <név> <lőszer>
kuldes <név> <lőszer>

Tehát per jel nélkül is lehessen! Köszönöm!

_________________
[url=http://www.gametracker.com/server_info/188.227.227.114:27286/][img]http://cache.www.gametracker.com/server_info/188.227.227.114:27286/b_350_20_323957_202743_F19A15_111111.png[/img][/url]


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Lőszercsomag küldés
HozzászólásElküldve: 2013.10.03. 19:24 
Offline
Jómunkásember
Avatar

Csatlakozott: 2012.09.23. 20:29
Hozzászólások: 325
Megköszönt másnak: 26 alkalommal
Megköszönték neki: 87 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <zombieplague>
  6.  
  7. #define PLUGIN "[ZP] Donate Ammo Packs"
  8. #define VERSION "1.0"
  9. #define AUTHOR "r1laX , PomanoB"
  10.  
  11. new g_UserTotalAmmo[33]
  12. new g_CvarAllowDonate
  13. new SayText
  14.  
  15.  
  16. public plugin_init() {
  17. register_plugin(PLUGIN, VERSION, AUTHOR)
  18.  
  19. g_CvarAllowDonate = register_cvar("zp_stats_allow_donate", "1")
  20.  
  21. register_clcmd("say", "handleSay")
  22. register_clcmd("say_team", "handleSay")
  23.  
  24. register_event("HLTV", "RoundStart", "a", "1=0", "2=0")
  25.  
  26. SayText = get_user_msgid("SayText")
  27.  
  28. }
  29.  
  30. public RoundStart()
  31. {
  32. if (get_pcvar_num(g_CvarAllowDonate))
  33. set_task(2.2, "MsgOnRoundStart")
  34.  
  35. }
  36.  
  37. public MsgOnRoundStart()
  38. {
  39. if(get_pcvar_num(g_CvarAllowDonate))
  40. client_printcolor(0, "!g[ZP] !yTo donate others Ammo Packs, type !g/donate")
  41.  
  42. }
  43.  
  44. public handleSay(id)
  45. {
  46. new args[64]
  47.  
  48. read_args(args, charsmax(args))
  49. remove_quotes(args)
  50.  
  51. new arg1[16]
  52. new arg2[32]
  53.  
  54. strbreak(args, arg1, charsmax(arg1), arg2, charsmax(arg2))
  55. if (get_pcvar_num(g_CvarAllowDonate) && equal(arg1,"/kuldes", 7) || equal(arg1, "kuldes",6))
  56. donate(id, arg2)
  57.  
  58. }
  59.  
  60. public donate(id, arg[])
  61. {
  62. new to[32], count[10]
  63. strbreak(arg, to, 31, count, 9)
  64.  
  65. if (!to[0] || !count[0])
  66. {
  67. client_printcolor(id, "!g[ZP] !yUsage: say /donate <name> <amount>")
  68. return
  69. }
  70. new ammo_sender = zp_get_user_ammo_packs(id)
  71. new ammo
  72. if (equal(count, "all"))
  73. ammo = ammo_sender
  74. else
  75. ammo = str_to_num(count)
  76. if (ammo <= 0)
  77. {
  78. client_printcolor(id, "!g[ZP] !yWrong ammo quantity!")
  79. return
  80. }
  81. ammo_sender -= ammo
  82. if (ammo_sender < 0)
  83. {
  84. ammo+=ammo_sender
  85. ammo_sender = 0
  86.  
  87. }
  88. new reciever = cmd_target(id, to, (CMDTARGET_ALLOW_SELF))
  89. if (!reciever || reciever == id)
  90. {
  91. client_printcolor(id, "!g[ZP] !yPlayer !g%s !yhas not been found on the server!", to)
  92. return
  93. }
  94.  
  95. zp_set_user_ammo_packs(reciever, zp_get_user_ammo_packs(reciever) + ammo)
  96. g_UserTotalAmmo[reciever] += ammo
  97. zp_set_user_ammo_packs(id, ammo_sender)
  98. new aName[32], vName[32]
  99.  
  100. get_user_name(id, aName, 31)
  101. get_user_name(reciever, vName, 31)
  102.  
  103. client_printcolor(id, "!g[ZP] !t%s!y-nek kuldtel !t%d!y ammo-t!",vName)
  104. client_printcolor(reciever, "!g[ZP] !t%s!y-tol kaptal %d!y ammo-t!",aName)
  105. }
  106.  
  107. stock client_printcolor(const id, const input[], any:...)
  108. {
  109. new count = 1, players[32]
  110. static msg[191]
  111. vformat(msg, 190, input, 3)
  112.  
  113. replace_all(msg, 190, "!g", "^4") // Green Color
  114. replace_all(msg, 190, "!y", "^1") // Default Color
  115. replace_all(msg, 190, "!t", "^3") // Team Color
  116.  
  117. if (id) players[0] = id; else get_players(players, count, "ch")
  118. {
  119. for ( new i = 0; i < count; i++ )
  120. {
  121. if ( is_user_connected(players[i]) )
  122. {
  123. message_begin(MSG_ONE_UNRELIABLE, SayText, _, players[i])
  124. write_byte(players[i]);
  125. write_string(msg);
  126. message_end();
  127. }
  128. }
  129. }
  130. }


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 4 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole