Thread: Add new Convar
View Single Post
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 10-26-2018 , 05:23   Re: Add new Convar
Reply With Quote #3

Harry56, do you mean chat command, like
Quote:
!test 1
?

Code:
public void OnPluginStart()
{
	RegConsoleCmd("sm_test", Cmd_Test, "Description");
}

public Action Cmd_Test(int client, int args)
{
	if (args < 1)
	{
		PrintToChat(client, "[SM] Usage: !test <Number>");
		return Plugin_Handled;
	}
	char arg[5];
	GetCmdArg(1, arg, sizeof(arg));
	int num = StringToInt(arg);
	
	PrintToChat(client, "[SM] You are selected number %i", num);

	return Plugin_Handled;
}
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline