hlmod.hu
https://hlmod.hu/

Ammó küldés
https://hlmod.hu/viewtopic.php?f=9&t=4461
Oldal: 1 / 1

Szerző:  ChaspeR [2012.05.19. 19:17 ]
Hozzászólás témája:  Ammó küldés

Amit felraktam még annó Juic3maci néven ammó küldőt.

Valaki kibirná szedni belőle hogy ki irja hudba kinek mennyit küldött?! csak simán lehessen vele küldeni és kész:))

Szerző:  fear_ezmegmi [2012.05.19. 19:21 ]
Hozzászólás témája:  Re: Ammó küldés

Try this :
Kód:
  1.  

  2. AMX MOD X HU SMA Megtekintés - www.amxx.try.hu - Plugin

  3. /************************************************\

  4.         ==================================             

  5.          * || [ZP] Donate Plugin v1.0|| *

  6.         ==================================

  7.                     *by @bdul!*

  8.  

  9.         -------------------

  10.          *||DESCRIPTION||*

  11.         -------------------

  12.  

  13.         With this plugin u can donate ammo packs

  14.         to others. Usage say:

  15.         /donate <nickname> <amount>

  16.  

  17. \************************************************/

  18.  

  19. #include <amxmodx>

  20. #include <amxmisc>

  21. #include <zombieplague>

  22.  

  23. new const PLUGIN[] =    "[ZP] Donate Plugin"

  24. new const AUTHOR[] =    "@bdul!"

  25. new const VERSION[] =   "1.0"

  26.  

  27. new g_msgSayText

  28.  

  29. public plugin_init()

  30. {

  31.         register_plugin(PLUGIN, VERSION, AUTHOR)

  32.  

  33.         register_clcmd("say", "handleSay")

  34.         register_clcmd("say_team", "handleSay")

  35.  

  36.         g_msgSayText = get_user_msgid("SayText")

  37. }

  38.  

  39.  

  40. public handleSay(id)

  41. {

  42.         new args[64]

  43.  

  44.         read_args(args, charsmax(args))

  45.         remove_quotes(args)

  46.  

  47.         new arg1[16]

  48.         new arg2[32]

  49.  

  50.         strbreak(args, arg1, charsmax(arg1), arg2, charsmax(arg2))

  51.  

  52.         if (equal(arg1,"/kuldes", 7))

  53.                 donate(id, arg2)

  54.  

  55. }

  56.  

  57. public donate(id, arg[])

  58. {

  59.         new to[32], count[10]

  60.         strbreak(arg, to, 31, count, 9)

  61.  

  62.         if (!to[0] || !count[0])

  63.         }

  64.         new ammo_sender = zp_get_user_ammo_packs(id)

  65.         new ammo

  66.         if (equal(count, "all"))

  67.                 ammo = ammo_sender

  68.         else

  69.                 ammo = str_to_num(count)

  70.         if (ammo <= 0)

  71.         }

  72.         ammo_sender -= ammo

  73.         if (ammo_sender < 0)

  74.         {

  75.                 ammo+=ammo_sender

  76.                 ammo_sender = 0

  77.  

  78.         }

  79.         new reciever = cmd_target(id, to, (CMDTARGET_OBEY_IMMUNITY|CMDTARGET_ALLOW_SELF))

  80.         if (!reciever || reciever == id)

  81.         }

  82.  

  83.         zp_set_user_ammo_packs(reciever, zp_get_user_ammo_packs(reciever) + ammo)

  84.         zp_set_user_ammo_packs(id, ammo_sender)

  85.         new aName[32], vName[32]

  86.  

  87.         get_user_name(id, aName, 31)

  88.         get_user_name(reciever, vName, 31)

  89. }

  90.  

  91. stock client_printcolor(id, const input[], any:...)

  92. {

  93.         new iCount = 1, iPlayers[32]

  94.  

  95.         static szMsg[191]

  96.         vformat(szMsg, charsmax(szMsg), input, 3)

  97.  

  98.         replace_all(szMsg, 190, "/g", "^4") // green txt

  99.         replace_all(szMsg, 190, "/y", "^1") // orange txt

  100.         replace_all(szMsg, 190, "/ctr", "^3") // team txt

  101.         replace_all(szMsg, 190, "/w", "^0") // team txt

  102.  

  103.         if(id) iPlayers[0] = id

  104.         else get_players(iPlayers, iCount, "ch")

  105.  

  106.         for (new i = 0; i < iCount; i++)

  107.         {

  108.                 if (is_user_connected(iPlayers[i]))

  109.                 {

  110.                         message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])

  111.                         write_byte(iPlayers[i])

  112.                         write_string(szMsg)

  113.                         message_end()

  114.                 }

  115.         }

  116. }

Szerző:  ChaspeR [2012.05.19. 19:52 ]
Hozzászólás témája:  Re: Ammó küldés

Tesztelem majd amint megkapom a szervert , köszi ! ;)

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