Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using CodeHatch.Build;
- using CodeHatch.Engine.Networking;
- using CodeHatch.Networking.Events.Players;
- namespace Oxide.Plugins
- {
- [Info("Private Chat", "ZakMc", "1.0.0")]
- public class Whisper : ReignOfKingsPlugin
- {
- void Loaded()
- {
- cmd.AddChatCommand("whisper", this, "WhisperTo");
- }
- void WhisperTo(Player player, string cmd, string[] args)
- {
- if( args.Length < 2 )
- {
- PrintToChat(player, "Usage: /whisper username message");
- return ;
- }
- Player WhisperToPlayer = Server.GetPlayerByName( args[0] );
- if( WhisperToPlayer == null )
- {
- PrintToChat(player, "Player not found");
- return ;
- }
- var whisperMessage = "";
- foreach (var message in args)
- {
- if( message == args[0] )
- {
- continue;
- }
- whisperMessage += " " + message;
- }
- PrintToChat(WhisperToPlayer, "[22AA79]" + player.DisplayName + " : " + whisperMessage);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment