Raised This Month: $12 Target: $400
 3% 

Proceed if user has flag


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
einsfuhrer
Member
Join Date: Jun 2019
Old 10-08-2019 , 12:20   Proceed if user has flag
Reply With Quote #1

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"), RadioMsgtrue);
    }
}

public 
Action RadioMsg(UserMsg msg_idProtobuf msg, const int[] playersint playersNumbool reliablebool 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.
einsfuhrer is offline
Reply


Thread Tools
Display Modes

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 05:26.


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