ItsMods
[Release] Give Ammo - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: [Release] Give Ammo (/Thread-Release-Give-Ammo.html)

Pages: 1 2


Give Ammo - archit - 09-05-2012

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

Code:
using System; using System.Collections.Generic; using System.Text; using Addon; namespace giveammo { public class Class1:CPlugin { public override void OnServerLoad() { ServerPrint("Give Ammo plugin loaded!"); } public override ChatType OnSay(string Message, ServerClient Client, bool Teamchat) { if (Message.ToLower().StartsWith("!giveammo")) { string[] options = Message.Split(' '); if (options.Length != 3) { TellClient(Client.ClientNum, "^2GiveAmmo: ^4Wrong options try again", true); TellClient(Client.ClientNum, "^2GiveAmmo: ^4Format:!giveammo [playername] [ammo]", true); } else { string name = options[1]; string ammo = options[2]; if (name.ToLower() == "me") { Client.Ammo.PrimaryAmmo += Convert.ToInt32(ammo); Client.Ammo.PrimaryAmmoClip += GetWeaponClipSize(Client.Other.PrimaryWeapon); } if (name.ToLower() == "all") { foreach (ServerClient client in GetClients()) { Client.Ammo.PrimaryAmmo += Convert.ToInt32(ammo); Client.Ammo.PrimaryAmmoClip += GetWeaponClipSize(Client.Other.PrimaryWeapon); } } else { foreach (ServerClient client in GetClients()) { if (client.Name.ToLower().Contains(name.ToLower())) { Client.Ammo.PrimaryAmmo += Convert.ToInt32(ammo); Client.Ammo.PrimaryAmmoClip += GetWeaponClipSize(Client.Other.PrimaryWeapon); } } } } return ChatType.ChatNone; } else { return ChatType.ChatContinue; } } } }



RE: Give Ammo - hillbilly - 09-05-2012

nice one


RE: Give Ammo - Kasperle - 09-05-2012

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....


RE: Give Ammo - archit - 09-05-2012

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


RE: Give Ammo - Kasperle - 09-05-2012

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


RE: Give Ammo - hillbilly - 09-05-2012

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.


RE: Give Ammo - Ich1994 - 09-05-2012

(09-05-2012, 14:55)archit Wrote:
Code:
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


RE: Give Ammo - archit - 09-06-2012

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


RE: Give Ammo - Kasperle - 09-06-2012

(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


RE: Give Ammo - archit - 09-07-2012

New update released fixing the problems