Help me to do something

 

I want to put this console command to give some "Coins" to other player.
The problem is... i dont know how to do that.

Comand from console: givecoins name or steamid - the ammount of coins will be configured in (config.GiveCoins) Please help me with that.

[ConsoleCommand("givecoins")]
private void CmdExpGive(ConsoleSystem.Arg args)
{
 // i wanna put in this par of the code to give coins to other players
BasePlayer player = args.Player();
if(player == null) return;

ExShops[player.userID].EXP += config.GiveCoins;
return;
}

Hello,
Your code must be

        [ConsoleCommand("givecoins")]
        private void CmdExpGive(ConsoleSystem.Arg args)
        {
            if (args.Args.Length == 0)
                return;

            BasePlayer player = BasePlayer.Find(args.Args[0]);
            if (player == null) return;

            ExShops[player.userID].EXP += config.GiveCoins;
        }
​
VCnIXpvBzhtGZgL.jpg sami37

Hello,
Your code must be

        [ConsoleCommand("givecoins")]
        private void CmdExpGive(ConsoleSystem.Arg args)
        {
            if (args.Args.Length == 0)
                return;

            BasePlayer player = BasePlayer.Find(args.Args[0]);
            if (player == null) return;

            ExShops[player.userID].EXP += config.GiveCoins;
        }
​
Thanks you <3 it works fine. have a good day/night  i love you