• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help !giveammo Plugin doesnt work [solved]
#1
Hi everyone,
Today i want test the giveammo plugin on my server. The console shows that the plugin is enabled but i cant used the commands. Im Admin so i hve the Permission to do that but it still doesnt work.

I hope you can help me and thx in Advice.
  Reply
#2
I can help you but, can you maybe post a link.
I think you mean this topic.
http://www.itsmods.com/forum/Thread-Rele...-Ammo.html ?
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
  Reply
#3
This plugin doesn't work because it's using GetWeaponClipSize() maybe i'll fix it for you

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.PrimaryAmmoClip += Convert.ToInt32(ammo);
  31. }
  32. if (name.ToLower() == "all")
  33. {
  34. foreach (ServerClient client in GetClients())
  35. {
  36. Client.Ammo.PrimaryAmmoClip += Convert.ToInt32(ammo);
  37. }
  38. }
  39. else
  40. {
  41. foreach (ServerClient client in GetClients())
  42. {
  43. if (client.Name.ToLower().Contains(name.ToLower()))
  44. {
  45. Client.Ammo.PrimaryAmmoClip += Convert.ToInt32(ammo);
  46. }
  47. }
  48. }
  49. }
  50. return ChatType.ChatNone;
  51. }
  52. else
  53. {
  54. return ChatType.ChatContinue;
  55. }
  56. }
  57. }
  58. }


I removed the GetWeaponClipSize() stuff. Now it's just adding the value to the ammoclip


Attached Files
.zip   GiveAmmo.zip (Size: 2.33 KB / Downloads: 23)
  Reply
#4
(12-29-2012, 16:29)8q4s8 Wrote: This plugin doesn't work because it's using GetWeaponClipSize() maybe i'll fix it for you

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.PrimaryAmmoClip += Convert.ToInt32(ammo);
  31. }
  32. if (name.ToLower() == "all")
  33. {
  34. foreach (ServerClient client in GetClients())
  35. {
  36. Client.Ammo.PrimaryAmmoClip += Convert.ToInt32(ammo);
  37. }
  38. }
  39. else
  40. {
  41. foreach (ServerClient client in GetClients())
  42. {
  43. if (client.Name.ToLower().Contains(name.ToLower()))
  44. {
  45. Client.Ammo.PrimaryAmmoClip += Convert.ToInt32(ammo);
  46. }
  47. }
  48. }
  49. }
  50. return ChatType.ChatNone;
  51. }
  52. else
  53. {
  54. return ChatType.ChatContinue;
  55. }
  56. }
  57. }
  58. }


I removed the GetWeaponClipSize() stuff. Now it's just adding the value to the ammoclip

Thank you so much Big Grin.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 3,886 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 4,345 11-08-2013, 19:13
Last Post: clemi555
  [Release] Bunker Plugin 1.3 archit 68 38,168 10-30-2013, 11:59
Last Post: clacki
  Help Modifying plugin maverigh 5 5,246 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 4,612 10-19-2013, 06:59
Last Post: iRoNinja
  [Release] Yurio Map Plugin Yurio 101 57,454 09-26-2013, 13:38
Last Post: First_Semyon
Brick [Release] v1.1 ChangeMap/NextMap Plugin without any configuration milchshake 23 17,349 09-23-2013, 13:18
Last Post: SgtLegend
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 2,525 09-13-2013, 09:31
Last Post: Hallla
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 30,316 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  Search Plugin Fluid Killcam N3xT_974 1 2,841 09-10-2013, 20:27
Last Post: Nekochan

Forum Jump:


Users browsing this thread: 1 Guest(s)