Quote:
Originally Posted by SSheriFF
|
Thanks, got it working with something like this:
Code:
#pragma semicolon 1
#include <sourcemod>
#include <multicolors>
new Handle:TestCmd = INVALID_HANDLE;
public OnPluginStart()
{
TestCmd = FindConVar("bot_forceattack");
RegAdminCmd("sm_testing", CommandTesting, ADMFLAG_ROOT);
}
public Action:CommandTesting(client, args)
{
ServerCommand("toggle bot_forceattack");
{
if (GetConVarInt(TestCmd) == 1)
{
CPrintToChat(client, "bot_forceattack value turned off"); // If 0, print turned off
}
else if (GetConVarInt(TestCmd) == 0)
{
CPrintToChat(client, "bot_forceattack value turned on"); // If 1, print turned on
}
}
return Plugin_Handled;
}
Inverted 0 and 1 for getting the ConVarInt for TestCmd is working correctly for some reason. doing vice versa will make it do bot_forceattack 1 when "off" and bot_forceattack 0 when "on"
__________________