AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [REQUEST] How to apply That only for VIP? (https://forums.alliedmods.net/showthread.php?t=312105)

ApoziX 11-16-2018 12:43

[REQUEST] How to apply That only for VIP?
 
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)
                }
            }
        }
    }



heroicpower7613 11-16-2018 13:19

Re: [REQUEST] How to apply That only for VIP?
 
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)
                }
            }
        }
    }



Bacardi 11-16-2018 13:48

Re: [REQUEST] How to apply That only for VIP?
 
CheckCommandAccess...

ApoziX 11-17-2018 05:44

Re: [REQUEST] How to apply That only for VIP?
 
Quote:

Originally Posted by heroicpower7613 (Post 2624340)
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


All times are GMT -4. The time now is 00:07.

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