Raised This Month: $ Target: $400
 0% 

Help in redirect command to chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PepeZukas
Member
Join Date: Oct 2015
Location: Banana Republic
Old 04-01-2017 , 00:49   Help in redirect command to chat
Reply With Quote #1

First sorry for my english, second, I use the plugin FakeSay, so i put sm_fakesay #userid and the message, but the problem is i have to call the console to get the #userid because typing the person's nickname is very laborious, then wanted to know if it is possible with your help to create something like a menu to select the player and then he sends the chat to enter the message, same as when we ban someone in sourcemod, we select the player, then we select the option Custom Reason and then he goes to chat, i hope you have understood me, I know it must be complicated and if it is, do not break your mind about it.

There is the full plugin code:

Code:
#include <sourcemod>
#include <admin>
#include <colors>

#define VERSION "1.0.0.0"

public Plugin:myinfo =
{
	name = "[Any] Fakesay",
	author = "Mitch",
	description = "Safe version of sm_fakesay from funcommandsx",
	version = VERSION,
	url = "http://forums.alliedmods.net/showthread.php?p=1534017"
};

public OnPluginStart()
{
	CreateConVar("sm_fakesay_version", VERSION, "Plugin Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
	RegAdminCmd("sm_fakesay", Command_Fakesay, ADMFLAG_BAN, "Makes a client say text.");
	LoadTranslations("common.phrases");
}

public Action:Command_Fakesay(client, args)
{
	if(args  != 2)
	{
		ReplyToCommand(client, "[SM] Usage: sm_fakesay <#userid|name> <text>");
		return Plugin_Handled;
	}

	decl String:Target[64];
	decl String:text[128];

	GetCmdArg(1, Target, sizeof(Target));
	GetCmdArg(2, text, sizeof(text));

	new itarget = FindTarget(client, Target);
	if(itarget == -1)
	{
		ReplyToCommand(client, "Unable to find target");
		return Plugin_Handled;
	}
	CPrintToChatAllEx(itarget, "{teamcolor}%N{default} :  %s", itarget, text);
	LogAction(client, itarget, "%L made %L say %s ", client, itarget, text);
	return Plugin_Handled;
}
PepeZukas is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 04-01-2017 , 05:58   Re: Help in redirect command to chat
Reply With Quote #2

Since you asked in scripting section, I guess you want to change the plugin by yourself.

https://wiki.alliedmods.net/Menu_API_(SourceMod)
https://wiki.alliedmods.net/Menus_St...eMod_Scripting)

Also check other plugins that have this ability (eg in sm github repo)
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
PepeZukas
Member
Join Date: Oct 2015
Location: Banana Republic
Old 04-01-2017 , 08:46   Re: Help in redirect command to chat
Reply With Quote #3

Quote:
Originally Posted by KissLick View Post
Since you asked in scripting section, I guess you want to change the plugin by yourself.

https://wiki.alliedmods.net/Menu_API_(SourceMod)
https://wiki.alliedmods.net/Menus_St...eMod_Scripting)

Also check other plugins that have this ability (eg in sm github repo)
Thx for the help
PepeZukas is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode