Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
give ammo plugin
#1
I did this but if i load dsr file with one primary weapon and no secondary it doesnt work. Can someone fix it?


Code:
using System;
using System.Collections.Generic;
using System.Text;
using Addon;

namespace giveammo
{
    public class Class1:CPlugin
    {
        public override void OnServerLoad()
        {
            ServerPrint("Ammo Plugin");
        }
        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, " invalid values", true);
                    TellClient(Client.ClientNum, "!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;
            }
        }
    }
}
Reply

#2
So, there is already a fix, only search in archive for it.

Halllla
Reply

#3
everybody can fix this problem?
this is great job.
how can fix this cod?
Nyan Cat You can't teach an old dog new tricks Nyan Cat
Nyan Cat You can't teach grandmother to suck eggs Nyan Cat
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Request] Shop plugin for infected server Petrosyan 0 2,152 01-11-2016, 21:01
Last Post: Petrosyan
  [Request] Full specialist plugin (.dll file prefered) plz check Ph4ntoM 4 3,028 10-24-2015, 20:51
Last Post: Casper
  Help health and ping plugin tamir20121 7 5,259 10-22-2015, 16:09
Last Post: Ph4ntoM
  [Request] Full specialist plugin (.dll file prefered) Ph4ntoM 0 1,709 10-18-2015, 21:18
Last Post: Ph4ntoM
  [Request] Welcome plugin that checks user for VAC bans. graphix2004 0 1,905 07-26-2015, 12:19
Last Post: graphix2004
Brick [Request] Flying plugin 7ru7a21 6 4,843 06-13-2015, 15:27
Last Post: leroi
  Need HUD plugin s.j-rez 7 5,286 11-08-2014, 21:16
Last Post: clacki
Heart [Request] Bunker Plugin (Can pay) as4dkhan 2 2,890 08-24-2014, 19:08
Last Post: as4dkhan
Tongue MW3 working jump height, gravity and fall damage plugin request/help Semyel 9 7,383 04-12-2014, 17:36
Last Post: Casper
  Plugin to get weapons xxxLik3aB0SSxxx 51 23,430 03-21-2014, 03:39
Last Post: Dude

Forum Jump:


Users browsing this thread:
1 Guest(s)

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