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

Solved player announce


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Munoon
Member
Join Date: Jul 2018
Location: www.Train4Game.com
Old 08-26-2018 , 13:32   player announce
Reply With Quote #1

Hi guys! I need plugin which will send massage in chat when some player (which I will point out) connect to the server.

Last edited by Munoon; 09-11-2018 at 10:42.
Munoon is offline
LagMyAss
Member
Join Date: Sep 2016
Location: Greece
Old 08-26-2018 , 22:02   Re: player announce
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=77306
https://forums.alliedmods.net/showthread.php?p=2480656
__________________

Last edited by LagMyAss; 08-26-2018 at 22:04.
LagMyAss is offline
Munoon
Member
Join Date: Jul 2018
Location: www.Train4Game.com
Old 08-27-2018 , 05:17   Re: player announce
Reply With Quote #3

no, that plugin say about connect all people, but i need only specified
Munoon is offline
beastedout
Member
Join Date: Aug 2018
Old 08-27-2018 , 05:39   Re: player announce
Reply With Quote #4

connect message for only who have certain flag?
beastedout is offline
Munoon
Member
Join Date: Jul 2018
Location: www.Train4Game.com
Old 08-27-2018 , 09:54   Re: player announce
Reply With Quote #5

YES!
Munoon is offline
stephen473
Senior Member
Join Date: Jan 2017
Location: somewhere on earth
Old 08-27-2018 , 10:25   Re: player announce
Reply With Quote #6

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

#pragma newdecls required

ConVar g_cFlag;
public 
Plugin myinfo 
{
    
name "Connect/disconnect message"
    
author "stephen473(Hardy`)"
    
description "Shows info about connecting/disconnecting players"
    
version "1.0"
    
url "https://pluginsatis.com"
}

public 
void OnPluginStart()
{
    
g_cFlag CreateConVar("cd_message_adminflag""b""Enter a certain flag");
    
AutoExecConfig(true"cd_message");
}

public 
void OnClientPostAdminCheck(int client)
{
    if(
IsClientAdmin(client))
    {
        
char authid[64], country[46], ip[46];
        
        
GetClientAuthId(clientAuthId_Steam2authidsizeof(authid));
        
GetClientIP(clientipsizeof(ip));
        
        if (!
GeoipCountry(ipcountrysizeof(country))) {
            
Format(countrysizeof(country), "Unknown Country");
        }
        
PrintToChatAll(" \x04%N \x05[%s] \x01connected from %s"clientauthidcountry);
    }
}

public 
void OnClientDisconnect(int client)
{
    if(
IsClientAdmin(client))
    {    
        
char authid[64], country[46], ip[46];
    
        
GetClientAuthId(clientAuthId_Steam2authidsizeof(authid));
        
GetClientIP(clientipsizeof(ip));
        
        if (!
GeoipCountry(ipcountrysizeof(country))) {
            
Format(countrysizeof(country), "Unknown Country");
        }
    
        
PrintToChatAll(" \x04%N \x05[%s] \x01disconnected from %s"clientauthidcountry);
    }
}

bool IsClientAdmin(int client)
{
    
char flag[4];
    
g_cFlag.GetString(flagsizeof(flag));
    
    
int iFlag ReadFlagString(flag);
    
    if ((
GetUserFlagBits(client) & iFlag) == iFlag) {
        return 
true;
    }
    
    return 
false;

Attached Files
File Type: sp Get Plugin or Get Source (connectmessage.sp - 268 views - 1.6 KB)
File Type: smx connectmessage.smx (4.8 KB, 116 views)
__________________
Also known as Hardy`.

Feel free to contact me if you have a private plugin request!

My Steam Profile | Discord: Hardy`#3792

Last edited by stephen473; 08-27-2018 at 10:25.
stephen473 is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 08-27-2018 , 12:21   Re: player announce
Reply With Quote #7

PHP Code:
CheckCommandAcces(); 
mug1wara is offline
Munoon
Member
Join Date: Jul 2018
Location: www.Train4Game.com
Old 08-28-2018 , 05:54   Re: player announce
Reply With Quote #8

@stephen473 thanks you a lot!

Last edited by Munoon; 08-28-2018 at 05:54.
Munoon is offline
Reply



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