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

[REQUEST] How to apply That only for VIP?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ApoziX
Member
Join Date: Sep 2018
Old 11-16-2018 , 12:43   [REQUEST] How to apply That only for VIP?
Reply With Quote #1

TITLE

Thanks and +rep for helpers

PHP Code:
#include <sourcemod>
#include <morecolors>

#define PLUGIN_VERSION    "1.0"

new Handle:h_Enable INVALID_HANDLE;
new 
Handle:h_Message INVALID_HANDLE;


public 
Plugin:myinfo 
{
    
name "Welcome Player Message // WPM",
    
author "RaT3D - Martin J.Berthelsen",
    
description "A simple plugin, which welcomes a player to your server with a custom message.",
    
version PLUGIN_VERSION,
    
url "http://royalgaming.net23.net"
}

public 
OnPluginStart()
{
    
CreateConVar("sm_wpm_version"PLUGIN_VERSION"WPM plugin version" FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
h_Enable CreateConVar("sm_wpm""1""Enables WPM plugin when client join server. 1 = Enabled, 0 = Disabled."FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
h_Message CreateConVar("sm_wpm_message""NONE""Set a message for client join."FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
AutoExecConfig(true"wpmConfig.cfg");
}

public 
OnClientPutInServer(client)
{
    new 
IsEnabled GetConVarInt(h_Enable);
    if(
IsEnabled == 1)
    {
        new 
String:SMsg[99];
        
GetConVarString(h_MessageSMsgsizeof (SMsg));
        
        if(
StrEqual(SMsg"NONE") || StrEqual(SMsg""))
        {
            
PrintToServer("[WPM] Join message not found!")
        } else{
            for(new 
1;GetMaxClients();i++)
            {
                if(
IsClientInGame(i) && IsClientConnected(i))
                {
                    
CPrintToAll(client"{aqua}[WPM] {default}s% {aqua}%s"SMsgclient)
                }
            }
        }
    }

__________________
Looking To Start A TF2 Community
My Discord | My Steam

Last edited by ApoziX; 11-16-2018 at 12:46.
ApoziX is offline
heroicpower7613
Member
Join Date: Nov 2016
Old 11-16-2018 , 13:19   Re: [REQUEST] How to apply That only for VIP?
Reply With Quote #2

edit ADMFLAG_CUSTOM1 to whatever flag you're looking for

PHP Code:
#include <sourcemod>
#include <morecolors>

#define PLUGIN_VERSION    "1.0"

new Handle:h_Enable INVALID_HANDLE;
new 
Handle:h_Message INVALID_HANDLE;


public 
Plugin:myinfo 
{
    
name "Welcome Player Message // WPM",
    
author "RaT3D - Martin J.Berthelsen",
    
description "A simple plugin, which welcomes a player to your server with a custom message.",
    
version PLUGIN_VERSION,
    
url "http://royalgaming.net23.net"
}

public 
OnPluginStart()
{
    
CreateConVar("sm_wpm_version"PLUGIN_VERSION"WPM plugin version" FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
h_Enable CreateConVar("sm_wpm""1""Enables WPM plugin when client join server. 1 = Enabled, 0 = Disabled."FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
h_Message CreateConVar("sm_wpm_message""NONE""Set a message for client join."FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
AutoExecConfig(true"wpmConfig.cfg");
}

public 
OnClientPostAdminCheck(client)
{
    new 
IsEnabled GetConVarInt(h_Enable);
    if(
IsEnabled == 1)
    {
        new 
String:SMsg[99];
        
GetConVarString(h_MessageSMsgsizeof (SMsg));
        
        if(
StrEqual(SMsg"NONE") || StrEqual(SMsg""))
        {
            
PrintToServer("[WPM] Join message not found!")
        } else {
            for(new 
1<= MaxClientsi++)
            {
                if( 
IsClientInGame(i) && IsClientConnected(i) && GetUserFlagBits(i) & ADMFLAG_CUSTOM1 )
                {
                    
CPrintToAll(client"{aqua}[WPM] {default}s% {aqua}%s"SMsgclient)
                }
            }
        }
    }

heroicpower7613 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-16-2018 , 13:48   Re: [REQUEST] How to apply That only for VIP?
Reply With Quote #3

CheckCommandAccess...
Bacardi is offline
ApoziX
Member
Join Date: Sep 2018
Old 11-17-2018 , 05:44   Re: [REQUEST] How to apply That only for VIP?
Reply With Quote #4

Quote:
Originally Posted by heroicpower7613 View Post
edit ADMFLAG_CUSTOM1 to whatever flag you're looking for

PHP Code:
#include <sourcemod>
#include <morecolors>

#define PLUGIN_VERSION    "1.0"

new Handle:h_Enable INVALID_HANDLE;
new 
Handle:h_Message INVALID_HANDLE;


public 
Plugin:myinfo 
{
    
name "Welcome Player Message // WPM",
    
author "RaT3D - Martin J.Berthelsen",
    
description "A simple plugin, which welcomes a player to your server with a custom message.",
    
version PLUGIN_VERSION,
    
url "http://royalgaming.net23.net"
}

public 
OnPluginStart()
{
    
CreateConVar("sm_wpm_version"PLUGIN_VERSION"WPM plugin version" FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
h_Enable CreateConVar("sm_wpm""1""Enables WPM plugin when client join server. 1 = Enabled, 0 = Disabled."FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
h_Message CreateConVar("sm_wpm_message""NONE""Set a message for client join."FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
AutoExecConfig(true"wpmConfig.cfg");
}

public 
OnClientPostAdminCheck(client)
{
    new 
IsEnabled GetConVarInt(h_Enable);
    if(
IsEnabled == 1)
    {
        new 
String:SMsg[99];
        
GetConVarString(h_MessageSMsgsizeof (SMsg));
        
        if(
StrEqual(SMsg"NONE") || StrEqual(SMsg""))
        {
            
PrintToServer("[WPM] Join message not found!")
        } else {
            for(new 
1<= MaxClientsi++)
            {
                if( 
IsClientInGame(i) && IsClientConnected(i) && GetUserFlagBits(i) & ADMFLAG_CUSTOM1 )
                {
                    
CPrintToAll(client"{aqua}[WPM] {default}s% {aqua}%s"SMsgclient)
                }
            }
        }
    }

thanks mate +rep
__________________
Looking To Start A TF2 Community
My Discord | My Steam
ApoziX 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:11.


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