Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Give Ammo
#1
This plugin gives ammo to whoever calls it ,requested by Kasperle.

Format:
!giveammo option ammo

Options:
  1. all-Gives the designated ammo to everybody on the server
  2. me-Gives ammo to its caller
  3. [name] - Name of the person whom to give without the []


Example
Code:
!giveammo archit 200
wil give 200 ammo to player archit
Code:
!giveammo all 45
will give 45 ammo to everyone on server
Code:
!giveammo me 65
will give 65 ammo to whoever types this


Credits:
@Kasperle
@surtek

CSHARP Code
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Addon;
  5.  
  6. namespace giveammo
  7. {
  8. public class Class1:CPlugin
  9. {
  10. public override void OnServerLoad()
  11. {
  12. ServerPrint("Give Ammo plugin loaded!");
  13. }
  14. public override ChatType OnSay(string Message, ServerClient Client, bool Teamchat)
  15. {
  16. if (Message.ToLower().StartsWith("!giveammo"))
  17. {
  18. string[] options = Message.Split(' ');
  19. if (options.Length != 3)
  20. {
  21. TellClient(Client.ClientNum, "^2GiveAmmo: ^4Wrong options try again", true);
  22. TellClient(Client.ClientNum, "^2GiveAmmo: ^4Format:!giveammo [playername] [ammo]", true);
  23. }
  24. else
  25. {
  26. string name = options[1];
  27. string ammo = options[2];
  28. if (name.ToLower() == "me")
  29. {
  30. Client.Ammo.PrimaryAmmo += Convert.ToInt32(ammo);
  31. Client.Ammo.PrimaryAmmoClip += GetWeaponClipSize(Client.Other.PrimaryWeapon);
  32. }
  33. if (name.ToLower() == "all")
  34. {
  35. foreach (ServerClient client in GetClients())
  36. {
  37. Client.Ammo.PrimaryAmmo += Convert.ToInt32(ammo);
  38. Client.Ammo.PrimaryAmmoClip += GetWeaponClipSize(Client.Other.PrimaryWeapon);
  39. }
  40. }
  41. else
  42. {
  43. foreach (ServerClient client in GetClients())
  44. {
  45. if (client.Name.ToLower().Contains(name.ToLower()))
  46. {
  47. Client.Ammo.PrimaryAmmo += Convert.ToInt32(ammo);
  48. Client.Ammo.PrimaryAmmoClip += GetWeaponClipSize(Client.Other.PrimaryWeapon);
  49. }
  50. }
  51. }
  52. }
  53. return ChatType.ChatNone;
  54. }
  55. else
  56. {
  57. return ChatType.ChatContinue;
  58. }
  59. }
  60. }
  61. }


Attached Files
.rar   giveammo.rar (Size: 2.24 KB / Downloads: 67)
.rar   giveammo 1.1.rar (Size: 2.29 KB / Downloads: 32)
.rar   giveammo 1.2.rar (Size: 2.36 KB / Downloads: 224)
Reply

#2
nice one
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#3
Thank you! Nice one Big Grin

Wont works, Plugin isnt loading?!
I put it in Plugins ordner and run server, wont works, than i made restart, wont works, in the console, stand, it dont loads....
[Image: b_560_95_1.png]
[Image: b_560_95_1.png]
[Image: b_560_95_1.png]
Reply

#4
There isn't any console output will include in next update
Reply

#5
Ah ok, but if i go on my server and use !giveammo kasper 100 then nothing happens...
I also put the command to admin to permissions plugin Admin_Commands=*ALL*,!giveammo but this also wont works... Sad

So what can be the problem...

Plugins I use:

Permissions Plugin by Pozzuh
GodPlugin2.1 by OzonE
Giveammo by Archit
[Image: b_560_95_1.png]
[Image: b_560_95_1.png]
[Image: b_560_95_1.png]
Reply

#6
Give Ammo plugin loaded!

1.1 same issue, it's loading and the error messages come up when you type in the command wrong. But it doesn't actually give any ammo.
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#7
(09-05-2012, 14:55)archit Wrote:
CSHARP Code
  1. Client.Ammo.PrimaryAmmoClip = GetWeaponClipSize(Client.Other.PrimaryWeapon);

Dumb Bitch I searched the stock ammo's in the MW3 wiki and added them in a Dictionary manually before that
[Image: compiling.png][Image: aLKA8og_460sa.gif]
Reply

#8
Someone please compile it and upload. I can't(My visual studio stopped working)
Reply

#9
(09-06-2012, 16:09)archit Wrote: Someone please compile it and upload. I can't(My visual studio stopped working)

@Ich1994
maybe you can make it Rolleyes
[Image: b_560_95_1.png]
[Image: b_560_95_1.png]
[Image: b_560_95_1.png]
Reply

#10
New update released fixing the problems
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Request] no ammo for infected gamemode ExoGamer* 8 5,513 08-15-2013, 18:59
Last Post: Dr3am95
  M320 and GP25 ammo McKinleySPB 3 3,068 07-06-2013, 12:56
Last Post: archit
Smile [Release] Unlimited ammo v2.3 & @Nukems unlammo hillbilly 40 23,898 06-26-2013, 11:33
Last Post: X-Track
Question can't find it (ammo box) DJSKilly 8 5,241 05-29-2013, 11:27
Last Post: Dr3am95
Wink Help Ammo box Dr3am95 6 4,382 03-31-2013, 15:39
Last Post: NyZzE
Heart Help give points for the deaths of bullets [HARD] Tony. 11 6,604 03-11-2013, 19:02
Last Post: Nekochan
  Help Problem unlimited ammo plugin 4nonymous 2 3,089 03-10-2013, 20:14
Last Post: hillbilly
Smile Need Someone to Make an Ammo Replenishing Box SkATerJoN 5 3,946 01-18-2013, 17:31
Last Post: tomglazer
  Help Setting ammo for M320/Shotgun Attachment yokai134 2 2,787 12-12-2012, 07:03
Last Post: yokai134
  Give Gun Error [SOLVED] koro35 4 3,867 11-17-2012, 15:15
Last Post: koro35

Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.