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

[CS:GO] Simple Connect Message


Post New Thread Reply   
 
Thread Tools Display Modes
Wizzardoff
Senior Member
Join Date: Dec 2022
Old 01-08-2023 , 17:48   Re: [CS:GO] Simple Connect Message
Reply With Quote #11

Any chance someone can add colors? i get all purple text,i would like at least name and country to be other colors
Wizzardoff is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 01-09-2023 , 16:05   Re: [CS:GO] Simple Connect Message
Reply With Quote #12

PHP Code:
#pragma semicolon 1

#include <geoip>

bool
    bIn
,
    
bOut;
char
    sSteamID
[24],
    
sIP[16],
    
sCountry[64];

public 
Plugin myinfo 
{
    
name "Connect MSG",
    
author "Crazy",
    
description "Provides Info of the player when he joins",
    
version "1.1",
}

public 
OnPluginStart()
{
    
ConVar cvar;
    
cvar CreateConVar("sm_connectmsg""1""Shows a connect message in the chat once a player joins."_true_true1.0);
    
cvar.AddChangeHook(CVarChange_In);
    
bIn cvar.BoolValue;

    
cvar CreateConVar("sm_disconnectmsg""1""Shows a disconnect message in the chat once a player leaves."_true_true1.0);
    
cvar.AddChangeHook(CVarChange_Out);
    
bOut cvar.BoolValue;
}

public 
void CVarChange_In(ConVar cvar, const char[] oldValue, const char[] newValue)
{
    
bIn cvar.BoolValue;
}

public 
void CVarChange_Out(ConVar cvar, const char[] oldValue, const char[] newValue)
{
    
bOut cvar.BoolValue;
}

public 
OnClientPutInServer(int client)
{
    if(
bIn && GetInfo(client))
        
PrintToChatAll(" \x04[CONNECT]\x03 %N (%s) has joined the server from [%s]"clientsSteamIDsCountry);
}

public 
void OnClientDisconnect(int client)
{
    if(
bOut && GetInfo(client))
        
PrintToChatAll(" \x04[DISCONNECT]\x03 %N (%s) has left the server from [%s]"clientsSteamIDsCountry);
}

stock bool GetInfo(int client)
{
    if(
IsFakeClient(client))
        return 
false;

    
GetClientAuthId(clientAuthId_Steam2sSteamIDsizeof(sSteamID));
    if(!
GetClientIP(clientsIPsizeof(sIP), true) || !GeoipCountry(sIPsCountrysizeof(sCountry)))
        
sCountry "Unknown Country";
    return 
true;

Attached Thumbnails
Click image for larger version

Name:	csgo_colors_.png
Views:	36
Size:	7.9 KB
ID:	198897  
__________________
Grey83 is offline
Wizzardoff
Senior Member
Join Date: Dec 2022
Old 01-26-2023 , 16:51   Re: [CS:GO] Simple Connect Message
Reply With Quote #13

Thanks mate
Wizzardoff 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 21:58.


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