So I want users that have Admin to be able to use the command radio menu and people that doesn't have a certain flag to get a message in chat: "You cannot use radio commands".
I got this plugin from someone else and decided to implement this feature, I tried but something is wrong. Can you guys help me out?
Code:
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
public Plugin myinfo =
{
name = "",
author = "Trum",
description = "",
version = "1.0",
url = ""
};
public void OnPluginStart()
{
if (GetUserMessageType() == UM_Protobuf)
{
HookUserMessage(GetUserMessageId("RadioText"), RadioMsg, true);
}
}
public Action RadioMsg(UserMsg msg_id, Protobuf msg, const int[] players, int playersNum, bool reliable, bool init)
{
int client;
if (!CheckCommandAccess(client, "sm_ban", ADMFLAG_BAN))
{
PrintToChatAll("You cannot use radio commands.");
}
else
{
return Plugin_Handled;
}
}
I get no error, it just let me use the commands when I don't have the flag.