Raised This Month: $32 Target: $400
 8% 

[REQ] Chat Control and Steam Acess Group


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gildevanaraujo
Senior Member
Join Date: Oct 2018
Location: Brazil
Old 11-19-2018 , 07:55   [REQ] Chat Control and Steam Acess Group
Reply With Quote #1

Hello everyone!
I would like a help, I would like to know where I find a plugin that I have moderation in the chat, type, only with VIP access or something similar can write in the chat and a plugin that to use skins on the server it will be mandatory to join the group of steam. Thanks!
gildevanaraujo is offline
HvG Community
AlliedModders Donor
Join Date: Sep 2012
Old 11-19-2018 , 10:37   Re: [REQ] Chat Control and Steam Acess Group
Reply With Quote #2

1) I don't understand, do you want only people with certain flag to be able to type in chat?

2) You check if client is part of steam group with SteamWorks and give him a flag accordingly. Then override the skin command only for that flag with sourcemod.
HvG Community is offline
gildevanaraujo
Senior Member
Join Date: Oct 2018
Location: Brazil
Old 11-19-2018 , 13:17   Re: [REQ] Chat Control and Steam Acess Group
Reply With Quote #3

Quote:
Originally Posted by HvG Community View Post
1) I don't understand, do you want only people with certain flag to be able to type in chat?

2) You check if client is part of steam group with SteamWorks and give him a flag accordingly. Then override the skin command only for that flag with sourcemod.
1) Yes, exactly!

2) How exactly do I do this? (I'm new to this part of servers in general).
Thanks!
gildevanaraujo is offline
Cruze
Veteran Member
Join Date: May 2017
Old 11-19-2018 , 14:09   Re: [REQ] Chat Control and Steam Acess Group
Reply With Quote #4

Quote:
1) Yes, exactly!
PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo 
{
    
name "Chat access for certain people",
    
author "Cruze",
    
description "",
    
version "1.0",
    
url "http://steamcommunity.com/profiles/76561198132924835 "
}

public 
void OnPluginStart() 
{
    
AddCommandListener(ChatMessage"say");
    
AddCommandListener(ChatMessage"say_team");
}
public 
Action ChatMessage(int client, const char[] commandint args)
{
    if(
CheckCommandAccess(client"sm_admin"ADMFLAG_GENERIC))
        return 
Plugin_Continue;
    else
        return 
Plugin_Handled;

edit:- Other admin flag can be found here
Quote:
2) How exactly do I do this? (I'm new to this part of servers in general).
Thanks!
https://forums.alliedmods.net/showthread.php?t=300505
Attached Files
File Type: smx Chat access for certain people.smx (3.7 KB, 49 views)
__________________
Taking paid private requests! Contact me

Last edited by Cruze; 11-19-2018 at 14:13.
Cruze is offline
gildevanaraujo
Senior Member
Join Date: Oct 2018
Location: Brazil
Old 11-19-2018 , 16:20   Re: [REQ] Chat Control and Steam Acess Group
Reply With Quote #5

PHP Code:
public Action ChatMessage(int client, const char[] commandint args

    if(
CheckCommandAccess(client"sm_admin"ADMFLAG_GENERIC)) 
        return 
Plugin_Continue
    else 
        return 
Plugin_Handled

Is part I change to which flag do I want correct?
For example:

PHP Code:
public Action ChatMessage(int client, const char[] commandint args

    if(
CheckCommandAccess(client"sm_admin"ADMFLAG_GENERIC ADMFLAG_CUSTOM1)) 
        return 
Plugin_Continue
    else 
        return 
Plugin_Handled

With this, only admins and custom1 can write in the right chat?
gildevanaraujo is offline
Cruze
Veteran Member
Join Date: May 2017
Old 11-19-2018 , 21:33   Re: [REQ] Chat Control and Steam Acess Group
Reply With Quote #6

You gotta change "sm_admin" to a command that admflag_custom1 has access to because admflag_custom1 doesn't have access to sm_admin. For example if you have vip plugin:-
PHP Code:
public Action ChatMessage(int client, const char[] commandint args

    if(
CheckCommandAccess(client"sm_admin"ADMFLAG_GENERIC) || CheckCommandAccess(client"sm_vip"ADMFLAG_CUSTOM1)) 
        return 
Plugin_Continue
    else 
        return 
Plugin_Handled

Quote:
With this, only admins and custom1 can write in the right chat?
Now it'll work (if sm_vip command is there in your server.)
__________________
Taking paid private requests! Contact me

Last edited by Cruze; 11-20-2018 at 01:33.
Cruze is offline
gildevanaraujo
Senior Member
Join Date: Oct 2018
Location: Brazil
Old 11-20-2018 , 13:29   Re: [REQ] Chat Control and Steam Acess Group
Reply With Quote #7

Quote:
Originally Posted by Cruze View Post
You gotta change "sm_admin" to a command that admflag_custom1 has access to because admflag_custom1 doesn't have access to sm_admin. For example if you have vip plugin:-
PHP Code:
public Action ChatMessage(int client, const char[] commandint args

    if(
CheckCommandAccess(client"sm_admin"ADMFLAG_GENERIC) || CheckCommandAccess(client"sm_vip"ADMFLAG_CUSTOM1)) 
        return 
Plugin_Continue
    else 
        return 
Plugin_Handled

Now it'll work (if sm_vip command is there in your server.)
Hello Cruze! There was an error for lack of a ")", I compiled and everything went fine, but could you do an update on the plugin? Send a message saying that it is only possible to speak use the "say" only vip? Thank you.

Ex: Chat for everyone only for admins and vips.
gildevanaraujo is offline
Cruze
Veteran Member
Join Date: May 2017
Old 11-20-2018 , 14:01   Re: [REQ] Chat Control and Steam Acess Group
Reply With Quote #8

Quote:
Originally Posted by gildevanaraujo View Post
Hello Cruze! There was an error for lack of a ")", I compiled and everything went fine
Yeah, I edited some hours before. (was sleepy)
Quote:
but could you do an update on the plugin? Send a message saying that it is only possible to speak use the "say" only vip? Thank you.

Ex: Chat for everyone only for admins and vips.
PHP Code:
#include <sourcemod> 

#pragma semicolon 1 
#pragma newdecls required 

public Plugin myinfo =  

    
name "Chat access for certain people"
    
author "Cruze"
    
description ""
    
version "1.1"
    
url "http://steamcommunity.com/profiles/76561198132924835 " 


public 
void OnPluginStart()  

    
AddCommandListener(ChatMessage"say"); 
    
AddCommandListener(ChatMessage"say_team"); 

public 
Action ChatMessage(int client, const char[] commandint args

    if(
CheckCommandAccess(client"sm_admin"ADMFLAG_GENERIC) || GetUserFlagBits(client) & ADMFLAG_CUSTOM1 == ADMFLAG_CUSTOM1)
        return 
Plugin_Continue
    else
        return 
Plugin_Handled

__________________
Taking paid private requests! Contact me
Cruze is offline
gildevanaraujo
Senior Member
Join Date: Oct 2018
Location: Brazil
Old 11-20-2018 , 14:29   Re: [REQ] Chat Control and Steam Acess Group
Reply With Quote #9

Thanks bro!!!

Do you have the commands to take the purchase of bombs in warmup?
gildevanaraujo is offline
Cruze
Veteran Member
Join Date: May 2017
Old 11-20-2018 , 14:39   Re: [REQ] Chat Control and Steam Acess Group
Reply With Quote #10

Quote:
Originally Posted by gildevanaraujo View Post
Thanks bro!!!

Do you have the commands to take the purchase of bombs in warmup?
https://forums.alliedmods.net/showthread.php?p=1400488
Untested..
PHP Code:
/**
    [CSS] Buy C4
    Terrorist can buy C4 bomb from buy zone within buy time.

    25.1.2011 Version 0.1
    - released
    26.1.2011 Version 0.2
    - Added chat announce to Terrorist when round start
    - Added work only bomb maps or all maps
    27.1.2011 Version 0.3
    - Add few PrintCenterText notified
    28.1.2011 Version 0.4
    - Little fix, not show "You are not in a buy zone." to dead people
    - Bomb limit added
    29.1.2011 Version 0.5
    - Little fix when work only bomb maps and it have disabled to not show chat announce
*/
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#define PLUGIN_VERSION    "1.0"

new Handle:buyc4_enabled INVALID_HANDLE;
new 
Handle:buyc4_cost INVALID_HANDLE;
new 
Handle:buyc4_chatannounce INVALID_HANDLE;
new 
Handle:buyc4_onlybombmaps INVALID_HANDLE;
new 
Handle:buyc4_limit INVALID_HANDLE;
new 
Handle:mp_buytime INVALID_HANDLE;
new 
Float:buytime;
new 
Float:roundfreezeend;
new 
bool:enable;
new 
count;
new 
EngineVersion:game;

public 
Plugin:myinfo =
{
    
name        "[CSS & CSGO] Buy C4",
    
author        "Bacardi",
    
description    "Terrorist can buy C4 bomb",
    
version        PLUGIN_VERSION,
    
url            "www.sourcemod.net"
}


public 
OnPluginStart()
{
    
game GetEngineVersion();

    
RegAdminCmd("sm_buyc4"Cmd_BuyC4ADMFLAG_SLAY"Terrorist can buy C4 from buy zone");    // Create command

    
buyc4_enabled CreateConVar("buyc4_enabled""1""When enabled, TERRORIST can buy C4 bomb"_true0.0true1.0);    // Create cvar
    
buyc4_cost CreateConVar("buyc4_cost""13000""Set price to weapon C4 bomb"_true0.0true16000.0);    // Create cvar
    
buyc4_chatannounce CreateConVar("buyc4_chatannounce""1""Print in chat announce to terrorist when round start"_true0.0true1.0);    // Create cvar
    
buyc4_onlybombmaps CreateConVar("buyc4_onlybombmaps""1""Works only maps where bomb site"_true0.0true1.0);    // Create cvar
    
buyc4_limit CreateConVar("buyc4_limit""0""Limit the number of bombs, 0 = unlimited"_true0.0);    // Create cvar
    
mp_buytime FindConVar("mp_buytime");    // To Hook cvar from srcds
    
buytime game == Engine_CSS GetConVarFloat(FindConVar("mp_buytime"))*60:GetConVarFloat(FindConVar("mp_buytime"));    // Convert minutes to seconds

    
HookEvent("round_start"Event_RoundStartEventHookMode_PostNoCopy);
    
HookEvent("round_freeze_end"Event_RoundFreezeEndEventHookMode_PostNoCopy);
    
HookConVarChange(mp_buytimebuytimechanged);    // Check cvar change

    
for(new 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i)) OnClientPutInServer(i);
    }
}

public 
OnMapStart()
{
    if(
GetConVarBool(buyc4_onlybombmaps) && FindEntityByClassname(-1"func_bomb_target") == -1)    // cvar 'buyc4_onlybombmaps' enabled and current map have not bomb plant site
    
{
        
enable false;
    }
    else    
// cvar 'buyc4_onlybombmaps' disabled (or cvar 'buyc4_onlybombmaps' enabled and bomb plant site exist)
    
{
        
enable true;
    }
}

public 
OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_WeaponCanUseOnWeaponCanUse);
}

public 
Action:OnWeaponCanUse(clientweapon)
{
    if(!
IsClientInGame(client) || GetClientTeam(client) < 2)
    {
        return 
Plugin_Continue;
    }

    new 
String:clsname[20];
    
GetEntityClassname(weaponclsnamesizeof(clsname));
    if(
StrEqual(clsname"weapon_c4"false) && GetPlayerWeaponSlot(client4) != -1)
    {
        return 
Plugin_Handled;
    }

    return 
Plugin_Continue;
}

public 
Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(
enable && GetConVarBool(buyc4_enabled))
    {
        
roundfreezeend GetGameTime();    // Get current map time
        
count 0;    // Reset counter

        
if(GetConVarBool(buyc4_chatannounce))
        {
            for (new 
1<= MaxClientsi++)
            {
                if (
IsClientInGame(i) && GetClientTeam(i) == && CheckCommandAccess(i"sm_buyc4"ADMFLAG_SLAY))
                {
                    new 
price GetConVarInt(buyc4_cost);

                    if(
price 0)
                    {
                        
PrintToChat(i"\x01\x03!buyc4 \x01cost \x03%i\x01$"price);
                    }
                    else
                    {
                        
PrintToChat(i"\x01\x03!buyc4 \x01now \x03FREE\x01!");
                    }
                }
            }
        }
    }
}

public 
Event_RoundFreezeEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(
enable && GetConVarBool(buyc4_enabled))
    {
        
roundfreezeend GetGameTime();    // Get current map time
    
}
}

public 
Action:Cmd_BuyC4(clientarg)
{
    if(
enable)
    {
        if(
GameRules_GetProp("m_bWarmupPeriod") != 1)
        {
            
PrintToChat(client"You can only use this command in warmup.");
            return 
Plugin_Handled;
        }
        if(
client == 0)    // Prevent command usage from server input and via RCON
        
{
            
PrintToConsole(client"Can't use this command from server input");
            return 
Plugin_Handled;
        }

        if(!
GetConVarBool(buyc4_enabled))
        {
            
PrintToConsole(client"[CSS] Buy C4 is disabled");
            return 
Plugin_Handled;
        }

        if(
GetClientTeam(client) == && GetEntProp(clientProp_Send"m_bInBuyZone") == 1// Client is TERRORIST and inside buy zone
        
{
            new 
Float:buytimeleft = (roundfreezeend buytime) - GetGameTime();    // Get buy time left

            
if(buytimeleft 0)
            {
                if(
GetPlayerWeaponSlot(client4) != -1)    // Player have bomb already
                
{
                    
PrintCenterText(client"You cannot carry any more.");
                    return 
Plugin_Handled;
                }

                new 
limit GetConVarInt(buyc4_limit);    // Get bomb limit from cvar

                
if(limit 0)    // limit have been set greater than 0
                
{
                    new 
ent = -1;
                    
count 0;    // Reset counter
                    
while ((ent FindEntityByClassname(ent"weapon_c4")) != -1// Find all C4 bombs
                    
{
                        
count++; // Count bombs
                    
}
    
                    if(
count >= limit)    // Bomb limit reached
                    
{
                        
PrintCenterText(client"C4 Bomb limit reached\nThere is now %i bombs under way"count);
                        return 
Plugin_Handled;
                    }
                }

                new 
cash GetEntProp(clientProp_Send"m_iAccount");    // Check player cash
                
new cost GetConVarInt(buyc4_cost);    // Check C4 price

                
if(cash cost)    // Player not have enough money
                
{
                    
PrintCenterText(client"You not have enough money\nC4 Bomb cost %i$"cost);
                    
EmitSoundToClient(client"weapons/clipempty_rifle.wav");
                }
                else
                {
                    new 
cashback cash cost;
                    
SetEntProp(clientProp_Send"m_iAccount"cashback);
                    
GivePlayerItem(client"weapon_c4");
                    
PrintCenterText(client"You have purchased C4 Bomb");
                }
            }
            else
            {
                
PrintCenterText(client"%0.0f seconds have passed.\nYou can't buy anything now."buytime);
            }
        }
        else if(
IsPlayerAlive(client) && GetClientTeam(client) == && GetEntProp(clientProp_Send"m_bInBuyZone") == 0// Client is TERRORIST and outside buy zone
        
{
            
PrintCenterText(client"You are not in a buy zone.");
        }
    }
    return 
Plugin_Handled;    // This prevent print "Unknown command" in client console
}

public 
buytimechanged(Handle:convar, const String:oldValue[], const String:newValue[])
{
    
buytime game == Engine_CSS StringToFloat(newValue)*60:StringToFloat(newValue);// Update buy time and in seconds when mp_buytime change

__________________
Taking paid private requests! Contact me

Last edited by Cruze; 11-20-2018 at 14:57. Reason: edited the .sp file so that it works only in warmup.
Cruze 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 08:33.


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